Knowledgebase

Apache Randomly Stops

Posted by dlewis23, 01-20-2011, 10:49 AM
I've been having this issue for a while now. It started shortly after a OS reinstall. Apache will just randomly stop. It happens pretty much every day, its always at different times, there is nothing in the logs and I can't figure out why this happens. When it stops I either have to go restart it or wait for cPanel to figure out apache has stopped and restart it. That takes about 20 minutes. I have tried many different Apache configs, my host has looked at the server and tried different apache configs and it just still happens. One of the techs thinks it might just be too much traffic but I had the same level of traffic before the reinstall and it didn't happen then. The only thing that changed with the server was I went from a main 250 GB drive to dual 500 GB drives on Raid1. I'm not sold on the too much traffic because 95% of the time when apache dies is not when I have the highest amount of traffic. The server is running the latest CentOS with cPanel and Apache 2.2. Does anyone have any ideas of why this might happen or anything for me to try? Thanks

Posted by asciiDigital, 01-20-2011, 11:48 AM
Without error logs this is hard to diagnose. You could always try some of the cPanel scripts in /scripts to help you out. Like /scripts/fixeverything. There are ones in there for apache also. Try them out.

Posted by lynxus, 01-20-2011, 12:14 PM
Yeah as above posted, Have a good look through your server logfiles. Something may appear in /var/log/messages or error.log ( if linux )

Posted by Techbrace, 01-20-2011, 02:52 PM
The only advice we can give you is, check the logs thoroughly and you'll find some hint, if not the root cause of the problem directly. To comment anything further, one would have to look into the system.

Posted by Squidix - SamBarrow, 01-20-2011, 03:12 PM
Did you try just recompiling apache from scratch?

Posted by dlewis23, 01-20-2011, 04:31 PM
Yes a few times.

Posted by GameFrame, 01-20-2011, 06:34 PM
To me it looks like something is making it down via the "kill" command. Because if it would crash due to hardware error, there should be a lot of segfault messages in dmesg. Also if it would go down due to out of ram issues, there should be messages about that. More than hard disk has changed in your system. Nothing goes down without reason. It could be also one of your clients who is crashing it. If you haven´t disabled these functions, anyone having PHP based scripts using the following functions can kill your apache: apache_child_terminate and posix_kill Add in to php.ini Without having access to box and without having more information that´s all for now i came up with. Last edited by GameFrame; 01-20-2011 at 06:43 PM.

Posted by bloodyman, 01-21-2011, 10:02 AM
I have one server running Apache 1 with the same problem. Apache simply hangs, but processes are still exist on server. cPanel needs to restart it. When I try to access webpage - it hangs during loading, after few seconds (apache timeout) it reports error on browser. Many configs, many rebuilds - no solution. No information in logs - error_log, access_log , /var/log/messages, /var/log/cron etc - nothing found.

Posted by lynxus, 01-21-2011, 10:50 AM
Try upgrading apache?

Posted by dlewis23, 01-21-2011, 06:34 PM
I will try that and see what happens. Thanks for the help so far everyone.

Posted by bloodyman, 01-22-2011, 04:40 AM
I try to setup cron to check via lynx if http://localhost/whm-server-status is available and if not - it restarts apache. It has connect_timeout set to 10 seconds. During apache hangs, this cron command does simply hangs too - even if I have connect timeout set to 10 seconds, this command does not restart apache. I also see 20-30 apache processes in 'ps aux' (like as normal) but they have only RAM used, not CPU - CPU is 0.0, RAM is normal 0.3 - 0.7 etc for each process. Only cPanel chksrvd can restart apache - it checks tcp connection to 80 port as far as I know. But chksrvd runs every 5 minuts, so in worst situation, after chksrvd run my apache is down for almost 5 minuts, then chksrvd restarts it. Anyone knows how to set a cron like chksrvd in cPanel to check apache for example every one minute? I don't belive that I would be able to track what is causing this apache freezes. No information in logs, no core dumps, server is under low load all time (0.5-1.0 with 8CPUs).

Posted by mugo, 01-22-2011, 06:06 AM
What are you running this on? Dedi? VPS? What mem/cpu/bw specs do you have?

Posted by bloodyman, 01-22-2011, 01:13 PM
Dedicated with 8 GB RAM, i7 920 CPU. free -m total used free shared buffers cached Mem: 8106 5405 2701 0 535 3726 -/+ buffers/cache: 1142 6963 Swap: 16002 0 16002

Posted by eSupun, 01-22-2011, 01:23 PM
I got the same issue because my /usr partition was full.

Posted by bloodyman, 01-22-2011, 08:14 PM
My usage: 6% / 2% /tmp 4% /var 65% /home 3% /boot 0% /dev/shm

Posted by dlewis23, 02-23-2011, 11:04 AM
GameFrame I tried your suggestion and it didn't make a difference, apache still randomly just stops. The only thing that seemed to make it not stop was switch all static content to Nginx (But that created a few other problems). Thanks for the help tho. Does anyone have any other suggestions?

Posted by CrocWeb, 02-23-2011, 11:23 AM
If you do not want to hire someone to optimize your server, try using LiteSpeed Web Server. I would recommend this over Nginx since it supports all the features that apache does. So simply install either their free edition or the trial and test it out.

Posted by DeltaAnime, 02-23-2011, 06:11 PM
What's your maxclients at? Do you have keepalives on? Francisco

Posted by dlewis23, 02-23-2011, 07:30 PM
This is where I am at right now. I've been using these settings for about a week now and performance wise they seem to be the best, but I can't get around this apache stopping problem.

Posted by DewlanceHosting, 02-23-2011, 08:22 PM
Post your apache error log, don't try to change any settings.. Maybe Error log located in: /usr/local/apache/logs

Posted by dlewis23, 02-26-2011, 03:07 PM
Here is the last few lines from my apache error log. I grabbed it right after it happened last night.

Posted by Techbrace, 02-26-2011, 03:26 PM
Your Apache configuration doesn't look good. You may require an expert look into your server to tune your Apache to suit the demand of your server and applications.



Was this answer helpful?

Add to Favourites Add to Favourites

Print this Article Print this Article

Also Read
Protagonist.net down? (Views: 641)


Language:

Client Login

Email

Password

Remember Me

Search