Dealing with a traffic surge

KevinF

Verified User
Joined
Mar 22, 2012
Messages
12
Hello everyone,

Yesterday I have experienced a bit of an issue on one of the websites I am hosting. Because another service went down, I experienced a traffic surge (from the usual 60-80 average users according to Google Analytics Realtime) where over 500 people were on the website at the same time, with up to 20 page views per second before my entire server finally gave up.

I ran webalizer after I managed to get the system up again and I got this as a result:
In a timespan of 45 minutes between the service going down and the website going down there have been 101 000 hits on the website, evening out to ~2222 hits per minute or ~37 hits per second.

I have a few questions about how I can prevent this in the future, and I would thank everyone that can give me some insight into this kindly.

- Is there any way I can know for sure what the max number of connections I can handle are?

- Would increasing the number of allowed httpd processed help my case? I am currently looking at the stats (there are around 200 visitors on the site right now) and the CPU is for about 90-80% idle.
Code:
Cpu(s): 13.3%us,  2.2%sy,  0.0%ni, 84.2%id,  0.0%wa,  0.0%hi,  0.3%si,  0.0%st
Mem:   1026052k total,   917340k used,   108712k free,    29880k buffers
Swap:  1048568k total,   126840k used,   921728k free,   393316k cached

- Is there a way for me to switch to a static HTML page showing a page saying 'Over Capacity' and some additional information I can quickly edit? I could make a .htacess to redirect people, but if the surge happens when I am asleep/not at computer it will not help.

- Are there any other configurations in Apache that might not be set optimally in a default DirectAdmin install?



With regards,
Kevin Felix
 
Back
Top