I apologize in advance if this has been asked/answered a lot. I don’t know enough yet to know what I don’t know.
We have a WordPress site on a typical LAMP shared hosting platform that was getting hundreds of hits per day. We’re getting more popular and this number is now approaching 1000.
At times it is SLOW or simply times out. The site allows for image downloads and tracks those by user in a database so it’s essentially a very primitive, unpaid “store.” I mention that because it will probably get slightly more DB inserts than a typical very small WordPress site.
My question is: what are the factors that will matter most in scaling this up? Ideally, we would not recode anything and the server would magically handle the traffic better.
To my mind, there are 3 issues:
The number of simultaneous visitors being served static pages
The static content of all the images people might view or download (20gb)
The mySQL databse processing each request via PHP.
I’ve seen various articles on dedicated servers, using several nameservers to load balance, managed hosts and cloud services.
As I wrote, I’d like some feedback as to how to measure what is causing the bottlenecks and then which types of services we should consider to make the greatest improvement with the least effort and cost for our scenario. IOW: how can I predict the impact of different upgrades we might attempt (VPS vs. cloud service vs. managed host, etc.)
Answer
The most bang for your buck, and really only option guaranteed to improve performance at all is to ditch the shared hosting. Get a dedicated server, or at the very least, a VPS (virtual private server), so you have dedicated resources.
Your site does not sound very resource intensive, and it’s not hyperbole in the least to say that it could be run on a modern smart phone. This is to say that optimizing your site and improving your code’s performance as a solution to the problem assumes that bottleneck is on your site, which is almost certainly not the case. What’s happening is that you are competing with all the other sites on this shared host, and when too many of them get too busy at the same time, there’s not enough resources to service your site’s requests (and it’s a safe bet that the other sites on this particular shared host have these same problems at the same time your site does).
So your first course of action needs to be to get a small VPS or dedicated server. Once you have your site (or a test version) on there, you can do benchmarking and testing and optimizations to determine what other improvements, if any are needed, but my money’s on “if any.” I’d bet that simply eliminating the other sources of competition for computing resources will be enough to eliminate the problems you described.
Attribution
Source : Link , Question Author : jchwebdev , Answer Author : HopelessN00b