Running 60+ WP sites on the same server. What is the best next step?

September 29, 2019 80 views
Scaling WordPress Server Optimization

This all started when I found Plesk and installed it on a new $40 droplet here at DO. It’s a Standard / 8 GB / 4 vCPUs droplet with 160 GB SSD.

The reason for doing this was to find a better way to host our clients websites - mostly small / medium sites running on Wordpress. We used Rackspace at that time for hosting and it’s just silly expensive and our server (10 at that time) was mostly running on Ubuntu 14.04 which will be a problem at some point.

So we’ve transfered one by one over the last 6 months and everything is running very nice. I do however feel like I’m pushing the limits a bit to hard, and even though the load on the server is fine 99% of the time it’s struggling with keeping up if there is a DDOS attack or other peaks of some sort.

Here is the graphs for the last 7 days: https://imgur.com/a/WYkM9f7

At this point I could really use some advice on how to proceed. Should I scale vertical or horizontal?

If I where to resize the droplet there are so many options. I’m tempted to try dedicated cpu’s instead of shared cpu’s but I’m not sure how the performance gain will be? If this is the right step then I guess resizing to General Purpose / 32 GB / 8 vCPU with the same disk size would be a good choice.

Maybe I should go all-in and choose General Purpose / 64 GB / 16 vCPU? It will be 10 times the cost, but as we’re running over 60 sites on the server the cost is not an issue.

Or - am I on the wrong track? Should I focus on spinning up a dedicated MySQL DB, and create a cluster of smaller droplets behind a Load Balancer instead? Our should I put a Varnish/Redis cache in front?

Please help me make the right decision my fellow DO friends :) Thank you so much!

1 Answer

Hello,

I personally try to avoid running too many websites on the same server as if one site is getting a huge spike in the traffic it might affect all of the other sites on the server. But there are shared hosting companies out there that host thousands of sites on a single server.

There are a few suggestions that I could give:

  • Add extra resources:

If you decide to do so, I would recommend just monitoring your graphs as you are currently doing and make sure to scale up accordingly by adding extra resources. That would be the easiest solution.

  • Monitor individual websites:

Also, make sure to monitor the sites individually, if there is a particular site that is getting most of the traffic, then you could suggest to this one client to move to a separate droplet. That way you would ensure that the rest of the sites are not affected by this one busy site.

  • Move your databases to a separate server:

If you ever decide to scale horizontally, you could start with moving your databases to a separate server. That way you would have two droplets: 1 Database dropet and 1 web droplet. You could even try the new Managed database solution provided by DigitalOcean. The setup would look something like this:

Database and webserver image

That is a really good step for starting your horizontal scaling up.

  • Use a CDN

CDN like CloudFlare is a good way to offload some of the load on your server.

  • Add a loadbalancer

Once you have your databases stored on a separate dedicated server, you could add a load balancer and shared storage for your droplets and start adding more droplets to the pool. That way the droplets would be using the same shared storage where the website files would be stored at and the same database so it would not matter if you are routed to any of the droplets, you would still be getting the same data. You would might want to add an option like Redis to store your sessions in, so that your visitors don’t lose their sessions every time they are routed by the load balancer to a different droplet.

The downside of this is that it would introduce more complexity to your overall setup but at the same time, you would have more redundancy.

  • Conclusion

The easiest way would be to just add some extra resources and move the busiest sites to their own droplets.

Hope that this helps!
Regards,
Bobby

Have another answer? Share your knowledge.