Nathan Riley
asked on
Linux Server Crashing Issues
My dedicated server every day or two will become unresponsive. I can't get to any of my sites, WHM, or even SSH in via putty when this happens. I have to request a power cycle and then the server and everything comes back up.
I want to figure out how/why this is happening. I'm on a CentOS box running whm/panel. How/where do I look at log files to see what is causing this issue?
I want to figure out how/why this is happening. I'm on a CentOS box running whm/panel. How/where do I look at log files to see what is causing this issue?
Is this by chance a server hosted on Liquidweb?
ASKER
No, it's godaddy.
When this happens, are you even able to ping your server and get responses, or is it totally frozen?
ASKER
Totally frozen.
Okay, please log into your server as root, open /var/log/messages in a text editor, and look for the date/time of the last freeze, and paste as many lines leading up to that freeze as you can grab.
I'm surprised the Godaddy admins aren't doing this for you...
I'm surprised the Godaddy admins aren't doing this for you...
ASKER
The server is unmanaged, so they don't troubleshoot issues like this unless I were to upgrade to managed. It's pretty expensive though and since the sites hosted on this server don't make an real $ it's not an option to upgrade.
I have putty open with the messages file open, how do I select and copy from it as it's a lot of messages and can't seem to highlight/pageup with keyboard.
I have putty open with the messages file open, how do I select and copy from it as it's a lot of messages and can't seem to highlight/pageup with keyboard.
Is there any way you can copy the file to somewhere in your web server tree, zip it up, and post a link to it so I can download it directly?
So:
cp /var/log/messages /path/to/my/webcontent
gzip -9 /path/to/my/webcontent/mes sages
So:
cp /var/log/messages /path/to/my/webcontent
gzip -9 /path/to/my/webcontent/mes
ASKER
Ok here you go. It happened ~8:40am this morning. So appears it happened at this point in the file:
Dec 11 08:36:26 - line 10714
But I'm not sure as I'm no expert in this area.
messages
Dec 11 08:36:26 - line 10714
But I'm not sure as I'm no expert in this area.
messages
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Not any webpages. I've added a teamspeak and jabber server in the past couple of months.
How can I tell which php code is spawning and not dying off?
How can I tell which php code is spawning and not dying off?
There's really no easy way of knowing which php processes were spawned by which pages without literally blocking the site to the outside world, and then visiting your pages one by one and looking in the process list ("ps ax | grep php") after you've hit each site.
How many php processes are running right now?
ps ax | grep php | wc -l
Since it actually shows php (and not just httpd) in the process list, that means you have some kind of web content that actually spawns external processes, because under normal circumstances, you would not see this. Do you have pages that kick off file system functionality, or perhaps an external database command? It may just be one rogue app doing this.
How many php processes are running right now?
ps ax | grep php | wc -l
Since it actually shows php (and not just httpd) in the process list, that means you have some kind of web content that actually spawns external processes, because under normal circumstances, you would not see this. Do you have pages that kick off file system functionality, or perhaps an external database command? It may just be one rogue app doing this.
ASKER
That code returned the number
2
I'm not aware of any web content that spawns external processes. I have websites and forums on the server. The teamspeak and jabber messenger I'm not sure what all they touch.
Is there monitoring software or something I can install to drill down more?
2
I'm not aware of any web content that spawns external processes. I have websites and forums on the server. The teamspeak and jabber messenger I'm not sure what all they touch.
Is there monitoring software or something I can install to drill down more?
Well, the fact that it returned 2, means there is one process with the name "php" in it running. I figure that number will grow over time.
There's not clear way of knowing whether the hundreds of running PHP processes at the time of your crash were a symptom or the cause, but in my experience, it's always a runaway web process spawning children that don't complete their operations and/or die off.
You might Google around and see if you can find anybody else having issues with Apache/PHP web servers after installing teamspeak and/or jabber.
There's not clear way of knowing whether the hundreds of running PHP processes at the time of your crash were a symptom or the cause, but in my experience, it's always a runaway web process spawning children that don't complete their operations and/or die off.
You might Google around and see if you can find anybody else having issues with Apache/PHP web servers after installing teamspeak and/or jabber.
ASKER
Hmm...what about something like?
http://www.nagios.com/
http://www.nagios.com/
Hi,
Turn on logging in your PHP ini file and have it write all actions to the log filelink, also make sure your apache server is logging all actions/requests.
Wait for the system to die then capture all logged code (in that period) on both files and post them here. This should help to identify what code is causing your issues.
D
Turn on logging in your PHP ini file and have it write all actions to the log filelink, also make sure your apache server is logging all actions/requests.
Wait for the system to die then capture all logged code (in that period) on both files and post them here. This should help to identify what code is causing your issues.
D
ASKER
Hm...I turned on logging via the method above, but it still isn't logging.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Never figured out what it was other than high traffic. Moved from apache to nginx and now it's working.