New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Comments
I wouldn't call LOIC 'reasonable'. At your setting it's issued somewhere around 200 req/s.
You have to tackle this elsewhere.
You probably lost some protection upstream (eg iptables) when you reinstalled. Unless php-fpm is stuck for more than 5 minutes with a 3 second test, I don't think PHP-FPM is the culprit here.
Maybe too much number of nginx worker and connection that php5-fpm cannot endure the request?
I tried with 2 threads and still the same problem.
Out of curiosity, how long does it normally take for you to service just one request.
And you say it stays at 100%, but how long does it actually stay there? Try one thread LOIC run for 1 second, then wait for the server to at least handle N requests (default=10) * T (time per request). If php is taking an order of magnitude longer than expected, then there's something more to delve into.
I tested it again.
With 1 thread for 1 seconds = Does nothing With 1 thread for 5 seconds = Goes to 80% then after 7 seconds goes normal With 5 thread for 5 seconds = Goes to 100% then after 13 seconds goes normal With 10 thread for 5 seconds = Goes to 100% then after 24 seconds goes normal With 15 thread for 5 seconds = Goes to 100% then after 26 seconds goes normal
But isn't this bad if someone ddos, it will be down until I restart php-fpm.
You're hitting resource starvation and restarting php isn't going to solve it. You need to choose one of the solutions posted above. I personally prefer the nginx microcache method as that works for legit busy traffic as well. The best of course, is to have all three.
Only issue there seems to be is the jihad between apache zealots and nginx zealots. Since when are there security issues? Seeing as how apache has been THE web server on the internet for going on decades now that's probably news to some people.