Solved

Linux Server Crashing Issues

Posted on 2013-12-11
20
368 Views
Last Modified: 2014-01-31
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?
0
Comment
Question by:N R
  • 10
  • 7
20 Comments
 
LVL 19

Expert Comment

by:xterm
Comment Utility
Is this by chance a server hosted on Liquidweb?
0
 
LVL 11

Author Comment

by:N R
Comment Utility
No, it's godaddy.
0
 
LVL 19

Expert Comment

by:xterm
Comment Utility
When this happens, are you even able to ping your server and get responses, or is it totally frozen?
0
 
LVL 11

Author Comment

by:N R
Comment Utility
Totally frozen.
0
 
LVL 19

Expert Comment

by:xterm
Comment Utility
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
 
LVL 11

Author Comment

by:N R
Comment Utility
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
 
LVL 19

Expert Comment

by:xterm
Comment Utility
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
 
LVL 11

Author Comment

by:N R
Comment Utility
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
 
LVL 19

Assisted Solution

by:xterm
xterm earned 500 total points
Comment Utility
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 11

Author Comment

by:N R
Comment Utility
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
 
LVL 19

Expert Comment

by:xterm
Comment Utility
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
 
LVL 11

Author Comment

by:N R
Comment Utility
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
 
LVL 19

Expert Comment

by:xterm
Comment Utility
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
 
LVL 11

Author Comment

by:N R
Comment Utility
Hmm...what about something like?
http://www.nagios.com/
0
 
LVL 13

Expert Comment

by:darren-w-
Comment Utility
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
 
LVL 11

Author Comment

by:N R
Comment Utility
Hm...I turned on logging via the method above, but it still isn't logging.
0
 
LVL 11

Accepted Solution

by:
N R earned 0 total points
Comment Utility
I never figured out the issue.  Moved to nginx instead of apache and now all my issues are resolved.
0
 
LVL 11

Author Closing Comment

by:N R
Comment Utility
Never figured out what it was other than high traffic. Moved from apache to nginx and now it's working.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to count occurrences of each item in an array.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now