Simple PHP form very slow

Website: http://prefix.rf.gd/

When running a simple PHP script that finds words with a specific prefix, it takes a painful amount of time for a single prefix. When running on a different hosting server, the script takes 0.49 seconds to get 3 prefixes. When running here it takes 2.24 seconds. Any idea how to make this faster? The script is very well optimized and I’m sure its a hosting problem.

If your script uses any of the preg_ functions, those can take up CPU and RAM resources, slowing down the execution of the script and pushing you higher to the daily limits. Also, this is free hosting, you cannot expect immediate loading/response/processing times. If you need higher limits or a better server overall, please upgrade to premium.

3 Likes

What does the script do exactly?

I took a quick look at the code, and if I understand it correctly I see large part of it involves making a large number of cURL requests to third party services. And looking at the services you’re calling, all of those services are hosted in the US.

However, our servers are in the UK. Which means that if you’re calling those services dozens of times, you have to establish connections and transfer data across the Atlantic dozens of times. And by that time, even the speed of light becomes noticeably slow.

Is the other host you’re trying located in the US? Because that would give them a huge performance benefit in talking with the external services.

3 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.