sites easily die by apache "ab" pressure testing tool. any solution?

August 12, 2013 2k views
Hi there, I'm using Nginx+Varnish for web. My current ram is at 70% of the totally ram. Sawp is not using. plenty cache left. However, my site easily dies and get 502 error when I or someone use apache "ab" pressure testing. As soon as get these requests, the memory reaches to full and get 502 error. I used "DoS Deflate" for protection. but it only checks every 60sec. before it checks, the site could have already been down. I notice the outgoing bandwidth of DO is not enough which is one of the reason causing this problem. I have another 10/year VPS with low setup running a site from other provide takes the same test. it can process and send 30M/s outgoing data which is fine and hardly dies. I'm not saying their are better. I like DO but recently this issue is annoying me. any solution? thanks in advance. Cheers Frank
3 Answers
What OS are you using for the droplet? Also I don't have a lot of experience with ab - but as far I remember it is designed for apache, not for nginx. I think Varnish can use a lot of memory.
My configuration is Ubuntu(512 RAM) with swap and apache2 with a little bit tweaked configurations(as well as for mysql), and I am using fail2ban for basic protection - it serves well against scripts like slowloris and killapache - but before clean the connections the server is on the edge and some of the services can go down - that's why I am using monit as well.
Hi Chupa,

thanks for your reply. My droplet is 512mb Debian 7 64bit. I will try other solution. I don't think 64bit system is the problem eating up too much resource. Easily dies when attacker is using http GET.


Try assigning a lower memory limit for Varnish. Is your site static? If not, it could be a problem with your script -- try running 'ab' against a static file.
Have another answer? Share your knowledge.