Question

High traffic crashes website

Hello, whenever I start getting higher traffic (at around 200 users online), website becomes unavailable.

I don’t get any alerts regarding CPU, Memory, Disk or Bandwidth related.

On the site I use WP Super Cache plugin + premium wordpress themes (including AMP).

Please assist to find the reason off website getting not available during these times.

Subscribe
Share

Hi @jasonjpeters ,

I’m using “8 GB 4 vCPUs 160 GB 5 TB”

Here are the graphs: https://i.imgur.com/dJMPFPi.png

You can see the small spike (this is when traffic came in).

A few questions / solutions:

  • What size is the droplet running the website? If you are using a smaller droplet size then you man need to look at increasing the size.

  • Do you have monitoring setup for the droplet? DO Offers monitoring for your droplet plans, however you do have to set this up. https://www.digitalocean.com/products/monitoring/

Another solution if you are seeing a large amount of traffic to your sever is to consider an HA setup where you spread your workload across multiple droplets, here is a good start:

https://www.digitalocean.com/community/tutorial_series/load-balancing-wordpress-with-haproxy


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi,

Wordpress depending on the plugins that you are running can require quite a lot of resources and the problems will start when concurrent connections increase. There is usually a resource that becomes pegged at that point, which is most likely CPU, and potentially RAM.

Based on your traffic graph that you provided it looks like 95% of the time the traffic is very low and then suddenly you get a large spike.

What you can do is use a load test to simulate the number of active concurrent connections and then see how your resource usage changes as those connections are processed.

So if you are normally receiving 1-10 connections per second look at your load. Then increase it to 10-25 and look at how load across CPU and RAM changes, then increase it to 25-50, 50-100, 100-200, etc.

That will show you the corresponding load on the system and eventually you will get to a point where the system is overloaded and the website stops loading, which will indicate, ok, this is the breaking point.

But now you will have an idea that a Droplet the size of X, runs out of CPU/RAM at Y load, so you can either increase it if you anticipate a future spike, or work in some more basic caching. Supercache is good, but it’s still a wordpress plugin, which means that it will still take up a lot of resources.

What we’ve done in the past is actually setup two separate web servers on the same system. One that is actually processing wordpress requests and a separate lightweight nginx server in front of it, that is reading off of a very basic static cache which is regenerated every 5-10 minutes. Usually the system is overloaded with requests to your index, or to a particular blog post, so this simple static cache handles those requests at 99% less load because it isn’t doing anything dynamic. It’s not an ideal solution, but it gives you some breathing room to figure out something more long term.