Shared hosting server speed.

Community Forums/General Help/Shared hosting server speed.

CGV(Posted 2009) [#1]
I have a php/mysql script that executes in 3 seconds flat on my home box, which is a 2.5 Ghz dual core, but takes about 35-40 seconds to execute on my website.

Would that be considered a reasonable speed for a shared account or is the server way over-sold?


xlsior(Posted 2009) [#2]
Ideally the server load is light enough not to notice the other sites -- the problem is that shared hosting is always a crapshoot. If you're unlucky enough to be on the same server as either a suddenly really popular site or just way to many (due to the provider trying to save costs) then performance can be a lot less than expected.
Also, many shared hosting providers limit the % CPU and memory that your program has access to, so one badly-written script by one site won't take everyone else down.... So on your own computer tou get 100% of that 2.5GHz CPU (single threaded, most likely, so your second core won't even be used).
On a shared server, they may have multiple quad core processors, but if you have a single-threaded app it doesn't really matter how many CPU cores there are, you'll only use one of them anyway... And if they limit you to a % of CPU power, you may end up for example only be allowed 20% of the load one one core. Assume it's a 3GHz system, and you're talking about the functional equivalent of running your script on a 600MHz machine with all the waits that entails.


The real question: is the 35-40 seconds too long for you?
If not, then chalk it up to an acceptable trade-off to a cheap shared hosting account.
If it is, you have a few options:
1) Ask the provider to move your site to a different shared server, if you feel that the current one is overloaded. Most will do this without too many problems. If you are lucky, it may be faster. If you're unlucky, you can have the same or worse performance on the second server
2) Upgrade your hosting package. Some providers allow you to use a higher % of CPU power on a shared server if you pay more, or you can upgrade to a dedicated server where you'll get a guaranteed 100% of the resources instead of a fractional allotment... But you'll pay a lot more for this as well.
(On a shared server you can have a hundred other people pay part of the cost of the equipment and operating cost. On a dedicated server, it's just you paying for all of it)


GfK(Posted 2009) [#3]
I read somewhere once that if somebody visits a webpage and it doesn't load quickly, people generally wander off after only six seconds of nothing happening.

Personally, I would have hit Refresh at least half a dozen times if nothing happened in more than 30s.


CGV(Posted 2009) [#4]
Thanks for the informative reply, xlsior.

The script only runs once a day in the backgound to update my catalog so the speed's not an issue.

Visitors to my site never experience the delay.

I was just curious if it was a sign to upgrade my hosting. I'm only paying $10 a month for this shared account


xlsior(Posted 2009) [#5]
I'd say that if the visitor experience is speedy enough and you don't mind the slightly longer time to run your daily report yourself, there is no real reason to upgrade... Once your visitors start experience slowness it's another thing, of course.


AJ00200(Posted 2009) [#6]
Every second it takes for your page to load after 4 seconds, you loose (approx.) 10% of your viewers (from whats left, so 6 seconds doesn't mean 80%, at means 10% of the 90%).