Question

A stress test of 2k concurrent clients is making Droplets unresponsive

Hello,

We’re in the process of moving a website from an inadequate windows host to Digital Ocean.

The website is a blog that gets 2k hits a day. As a starting point we’ve chosen the CPU-Optimised 4GB/2 CPU $42/month.

We’ve been attempting stress tests with Loader.io, and using a blank HTML page we get to 2000 concurrent clients. The Loader test finishes, but our Droplet becomes unresponsive, and unreachable.

The Graphs for Memory and CPU dont go over 50% used during the testing.

When we test with our PHP code, we can’t get above 100 concurrent clients.

Does anyone have any advice on starting points to debug our issue?

Thank you.


Submit an answer

This textbox defaults to using Markdown to format your answer.

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

Sign In or Sign Up to Answer

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.

Hello,

It sounds like that you might be hitting your Apache max clients connections.

You can change that by adding the following values:

ServerLimit 16
StartServers 2
MaxClients 200
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25

A few things that I would suggest are:

  • You could try switching from Apache to Nginx + PHP-FPM for better performance.
  • When running the load test, connect to your server and check the resource utilization. That way you can identify which service is the bottleneck and focus on the optimization for that specific service.

To check your resource utilization, you can follow the steps here.

https://www.digitalocean.com/community/questions/how-to-find-the-processes-that-are-consuming-the-most-server-resources

If it is not Apache that is causing the issue, it might also be MySQL. I could suggest following the steps here on how to optimize your MySQL service:

https://www.digitalocean.com/community/questions/how-to-tweak-mysql-mariadb-configuration-for-increased-performance-and-stability

Let me know how it goes.

Best,

Bobby