Portal Home > Knowledgebase > Articles Database > VPS server crashes due to high load - http connections?


VPS server crashes due to high load - http connections?




Posted by ADD3AN, 09-07-2009, 06:25 AM
Hello, My webserver (VPS) keeps crashing due to high load. - Webserver specs (EuroVPS – CT -2800P): Guaranteed CPU Speed: 2 Ghz Guaranteed RAM: 512 MB - There are approximately 100-250 people online at the same time (Whos.Amung.us counter), - The actual number of active connections is lower, Munin NetStat never counts more than 100 active connections. - Yesterday our site got approximately 12000 visits, 70000 pageviews and people stayed on average 8 min. - The pages are all generated html (no php, not dynamic), the only connection to mysql is the advertisement (openx). - MySQL doesn’t have much work (queries) with the advertisements. At the moment of writing there around 30 active connections, and the CPU load averages are: 0.68 (1 min) 1.47 (5 mins) 9.52 (15 mins) We have submitted a support ticket to EuroVPS, and they told us: “We confirm that the issue is due to the huge number of http connections to your server which is causing the load.” Is it normal that a 2Ghz VPS can’t handle this kind of traffic? Can we do something to fix it? Is the huge number of http connections indeed the cause of the server crash? We hope you can provide us with some kind of explanation and/or a solution to this problem. Greetings, Adrian

Posted by adminpaul, 09-07-2009, 08:17 AM
Check is there any resource outage for your vps. You can do this using the following command. cat /proc/user_beancounters

Posted by ADD3AN, 09-07-2009, 08:39 AM
Edit: a more readable version here: http : / / upload.vanmaarten.be/2/1/output.jpg ) kmemsize and privvmpages are often mentioned in our Virtuozzo QoS alerts At the moment the server seems a bit stable again though. With currently 180 users online and 60 active connections the load average is at 0.99 (1 min), 0.60 (5 mins) and 0.70 (15 mins), whereas a lesser amount of users and connections caused a crash earlier this morning Last edited by ADD3AN; 09-07-2009 at 08:43 AM.

Posted by ianeeshps, 09-07-2009, 09:30 AM
Try to check number of httpd connections at the time of high load

Posted by ADD3AN, 09-07-2009, 09:52 AM
http: //upload.vanmaarten.be/4/1/connections.jpg This is a Munin graphic of our connections. The vertical black lines show where the server crashed.

Posted by inspiron, 09-07-2009, 10:00 AM
I think you should get optimized your apache and mysql. Hope this might solve your problem.

Posted by ADD3AN, 09-07-2009, 12:20 PM
It looks like the Apache server shuts down. When I look at the log files, the errors before a crash are always similar to this: There are also a lot of these errors: [Sun Sep 06 18:59:53 2009] [emerg] (43)Identifier removed: couldn't grab the accept mutex [Sun Sep 06 18:59:54 2009] [emerg] (22)Invalid argument: couldn't grab the accept mutex

Posted by UNIXy, 09-07-2009, 12:35 PM
Hi there, You have two issues based on the above user_beancounters output. The first one is a lack of kernel memory that's allocated to you (controlled by the provider) and a low limit on the number of processes you can launch (also controlled by the provider). Both of which need to be increased so you don't experience those issues anymore. Regards

Posted by ADD3AN, 09-08-2009, 07:04 AM
Thanks for the suggestions! We have tweaked our httpd config a bit and send a support ticket to have both kmemsize and privvmpages increased. Since the changes the server has been running for over a day with a low load average and without a crash, which was impossible before.

Posted by UNIXy, 09-08-2009, 02:45 PM
Hi again, I would also ask for an increase in numproc. Regards

Posted by FastServ, 09-08-2009, 03:41 PM
The main thing is to configure apache not to launch too many processes both so you don't exceed your process limit as well as your memory limit. Mysql should also be tuned with a max-connection similarly so you don't exceed your memory limit when apache+mysql usage is combined. An easy way to cut back on the number of apache process is to immediately disable keepalives or reconfigure it with a very low timeout, like a few seconds. mysqltuner.pl works wonders in helping you figure out how to best tweak mysql both for performance and available memory.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
SMTP OUTLOOK and CSF (Views: 522)
ssh command to do this (Views: 495)
PHP + Basis Joomla (Views: 488)
Cloud vs. Premium VPS (Views: 502)