Posted by UberTricep, 04-28-2012, 12:55 PM | Hello I currently have a dedicated server running apache2 and I have noticed that holding down the F5 key (refresh) causes the system to overload (the load (Linux) goes > the number of CPU's and the CPU's hit 100%).
This means that anyone can crash my server if they want to. Am I missing something obvious to stop this?
Does apache2 have something like: if # of hits per second > 5 then disconnect them?
Thank you in advance.
|
Posted by UNIXy, 04-28-2012, 01:00 PM | The right way to address this issue is to implement changes so the server can gracefully smooth out this kind of traffic "spike". Either through caching or code optimization. A temporary workaround would be to rate limit port 80 via iptables (or see PORTFLOOD option in CSF).
Regards
Joe / UNIXY
|
Posted by Patrick, 04-28-2012, 01:06 PM | What sort of site are you running? Do you know how PHP is configured, is it using suPHP, FastCGI, DSO?
In most situations, no, a single user holding down F5 (refresh) shouldn't be able to cause your server's CPU usage to jack up to 100% ... if that's the case there is something underlying that might need to be adjusted - regardless of any throttling or rate limiting measures implemented, which would help but is more of a band-aid than anything else.
|
Posted by UberTricep, 04-28-2012, 06:52 PM | Thank you for your replies.
All of my scripts are running mod_perl (not cgi). PHP isn't being used much in comparison to mod_perl.
The server usually sits at around 15% load, 25% peak time.
Thank you again.
|
Posted by VladimirR, 04-28-2012, 10:20 PM | What kind of page are you holding down F5 on? Regardless this shouldn't cause something THAT dramatic to happen, but if you have a script doing extremely intensive operations it may be plausible.
|
Posted by shovenose, 04-28-2012, 10:43 PM | I tried holding down F5 for two minutes it didn't do anything
|
Posted by UberTricep, 04-29-2012, 03:28 AM | Well my entire site uses mod_perl and is pretty busy, 100,000 page views per day are not uncommon. Also MySQL is being used.
I noticed the same problem occurs if I do the same with mod cgi with MySQL.
Perhaps there is something I am missing here? Or perhaps u should upgrade my server? I don't think the latter would be necessary because it only reaches 25% load during peak times.
|
Posted by renzuken08, 04-29-2012, 05:18 AM | use cache?
if your problem is to avoid the mysql getting raped by F5
static cache will be good
but this is the first time i heard F5 can kill server lol
|
|
Add to Favourites
Print this Article |