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?
LVL 12
Nathan RileyFounderAsked:
Who is Participating?
 
Nathan RileyConnect With a Mentor FounderAuthor Commented:
I never figured out the issue.  Moved to nginx instead of apache and now all my issues are resolved.
0
 
xtermCommented:
Is this by chance a server hosted on Liquidweb?
0
 
Nathan RileyFounderAuthor Commented:
No, it's godaddy.
0
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

 
xtermCommented:
When this happens, are you even able to ping your server and get responses, or is it totally frozen?
0
 
Nathan RileyFounderAuthor Commented:
Totally frozen.
0
 
xtermCommented:
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...
0
 
Nathan RileyFounderAuthor Commented:
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.
0
 
xtermCommented:
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/messages
0
 
Nathan RileyFounderAuthor Commented:
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
0
 
xtermConnect With a Mentor Commented:
Okay, it's pretty clear what is happening - you have some PHP code on your webserver which spawns over and over again and the processes don't die off.  The machine runs out of memory, and tries to invoke the oom_killer which kills off memory hog processes, but does not always succeed in saving the system.

Have you added any new web apps via WHM lately which may be responsible for this?
0
 
Nathan RileyFounderAuthor Commented:
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?
0
 
xtermCommented:
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.
0
 
Nathan RileyFounderAuthor Commented:
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?
0
 
xtermCommented:
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.
0
 
Nathan RileyFounderAuthor Commented:
Hmm...what about something like?
http://www.nagios.com/
0
 
darren-w-Commented:
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
0
 
Nathan RileyFounderAuthor Commented:
Hm...I turned on logging via the method above, but it still isn't logging.
0
 
Nathan RileyFounderAuthor Commented:
Never figured out what it was other than high traffic. Moved from apache to nginx and now it's working.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.