Portal Home > Knowledgebase > Articles Database > Apache killing memory


Apache killing memory




Posted by bonjurkes, 07-04-2011, 04:47 PM
So I am having a weird Apache issue. I am on 512 mb linode server, everything runs flawless, and sometimes **** happens. While everything is going on fine, server gets huge memory request then start to kill servers. It is like : [71.53] [58.43] [31.58] cpu : 0.1%us, 2.8%sy, 92.4%wa memory : 95.9% [417528 kB] swap : 99.9% [524180 kB] And when i use lish console it says killed process 29212 (apache2) total-vm:390176kB, anon-rss:7440kB, file-rss:1268kB Out of memory: Kill process 29214 (apache2) score 27 or sacrifice child Page full of this error. and server gets unresponsive. I use monit with rules like if load gets over 5 restart server, but I think it happens so fast that monit cant control the server. I will just check again now to be sure but i think some spam bots are causing it (vbulletin forum spam bots), i will check access logs. Is there any way to find what causes the real problem because it's so hard to check server-status while load is 78. Or how can i stop this kind of problems? Should i install firewall or what ?

Posted by madaboutlinux, 07-05-2011, 06:38 AM
Do you manage to check which files that were been processed at the time of high resource usage? It looks like a plain server without SuPHP?

Posted by bonjurkes, 07-05-2011, 06:47 AM
It's a plain server and no suphp. But I disabled like most sites on the server, so maybe like there is 5 sites on the server without many hits (not even 100 hits in a month perhaps) there is my wordpress site and a vbulletin forum and it looks like forum spammer bots are causing this issue, i am giving a try to cloudfare, let's see if that kind of service will help me or not

Posted by madaboutlinux, 07-05-2011, 06:55 AM
If you think forum spammer bots are the cause, enable captcha and see if it makes any difference. Or may be a poorly coded plugin that you may have recently enabled on any of your website? You can try tracking the Apache processes during the high resource usage to see which files they are accessing. It will also help to track the problem.

Posted by bonjurkes, 07-05-2011, 06:57 AM
the problem is load gets so high instantly that i cant track, i have server-status on server but cant even load that when loads are high. I have captcha on my forum, so they are not managing to do anything but they are just crawling on the forum so fast that probably apache cant handle that much of request at same time.

Posted by iTom, 07-05-2011, 08:05 AM
Do you have any idea of how many hit's your actually getting when this happens?

Posted by bonjurkes, 07-05-2011, 08:06 AM
not actually, i am checking access logs only and sometimes logs are full with same ip, so when i google that ip it mostly shown as some spammer bot for forums. Installing firewall software like apf+bfd can be a solution or will just cause more problems ?

Posted by CH-Shaun, 07-05-2011, 08:12 AM
I highly suggest that you setup a firewall and block the spammer bot IP(s). CSF is a great firewall script. Then you'll be able to check if Apache is still generating high CPU load and RAM. Using near 100% is definitely contributing to the slowness.

Posted by iTom, 07-05-2011, 08:28 AM
Yeh installing a firewall would certainly help if it's a single IP, cloudflare would also help you as that traffic/requests should be either blocked or offloaded. Although your website should be able to cope with a surge in traffic, so there is probably still a misconfiguration issue somewhere, I would check you apache configuration, may be even look at replacing it with something like Nginx or litespeed if this is getting to be a big issue.

Posted by bonjurkes, 07-05-2011, 08:30 AM
I didnt changed much configuration, mainly about keep alive settings etc, i can share it here if anyone wanna look at it. I switched to nginx, and performance got worse, at least for my wordpress site. Loads slower, throws 502 gateway errors etc. so i am mainly using apache2

Posted by quad3datwork, 07-05-2011, 01:57 PM
There is no excuse for not activating firewall or install/configure any front end for it. Theres probably something configured wrong w/ nginx configuration. Anyways, let's look at Apache first. Can you post all keep alive & MPM section settings?

Posted by netmultiple, 07-06-2011, 12:20 AM
Do you have apache status page. See this and see what IP crawlr often (Badbot who you do not want them crawlr) And then, block their IP by use iptables



Was this answer helpful?

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

Also Read
ixwebhosting.com down (Views: 887)
Alternative to CrocWeb (Views: 656)

Language: