LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices



Reply
 
Search this Thread
Old 05-31-2012, 05:58 AM   #1
NabiVakili
LQ Newbie
 
Registered: Feb 2011
Posts: 13

Rep: Reputation: 6
CentOS runs out of memory


I have a CentOS 5.8 with Apache and Direct Admin panel.
There is one website on this server.
Some times the server runs out of memory and kills processes until it kills the "httpd" and website gets down.

I used top command to find out witch process uses physical memory more than others. Here is the output just before the server runs out of memory:
TOP log.txt

What's the problem?
 
Old 05-31-2012, 06:51 AM   #2
droyden
Member
 
Registered: Feb 2007
Location: UK
Posts: 150

Rep: Reputation: 19
Do you have swap configured?
 
Old 05-31-2012, 09:57 AM   #3
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6
Posts: 1,602

Rep: Reputation: 483Reputation: 483Reputation: 483Reputation: 483Reputation: 483
From reading your attachment it seems that your load average looks pretty high over all three time periods, also looks like your system isn't going in to swap so that would indicate that memory is OK.

Are you running anything that could account for the heavy load? Is this a "real" machine or a virtual server?
 
Old 06-01-2012, 05:22 AM   #4
NabiVakili
LQ Newbie
 
Registered: Feb 2011
Posts: 13

Original Poster
Rep: Reputation: 6
Quote:
Originally Posted by droyden View Post
Do you have swap configured?
I don't know, because someone else has configured this server
How can I find that swap is configured?

Quote:
Are you running anything that could account for the heavy load? Is this a "real" machine or a virtual server?
This is a virtual machine on Microsoft Hyper-V platform.
 
Old 06-01-2012, 05:24 AM   #5
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6
Posts: 1,602

Rep: Reputation: 483Reputation: 483Reputation: 483Reputation: 483Reputation: 483
Quote:
Originally Posted by NabiVakili View Post
This is a virtual machine on Microsoft Hyper-V platform.
Ok, so what are you running anything on that CentOS instance that would be generating such a heavy load? Is this a busy production web server with a database or some other "greedy" app? You may find that your virtual server is just not suitable for the load you're putting through it.
 
Old 06-01-2012, 12:38 PM   #6
droyden
Member
 
Registered: Feb 2007
Location: UK
Posts: 150

Rep: Reputation: 19
type at the console: free -m

and paste the output, that load avg is very high - something is eating resources. how many other vm's are on this host? could it be over allocated?
is there any monitoring of the host resources? it could be you have storage contention. if you also output:

vmstat 1 10
 
Old 06-02-2012, 01:10 AM   #7
NabiVakili
LQ Newbie
 
Registered: Feb 2011
Posts: 13

Original Poster
Rep: Reputation: 6
Quote:
Originally Posted by droyden View Post
type at the console: free -m

and paste the output, that load avg is very high - something is eating resources. how many other vm's are on this host? could it be over allocated?
is there any monitoring of the host resources? it could be you have storage contention. if you also output:

vmstat 1 10
There are only 10 other vm's on the host. All of them are okay and and there are free resources on the host.
This is the output of commands:
output.PNG
I think the swap is not configured. What's your idea?

There is only one website on this server, this website hasn't many visitors:
graph_image.png
As I said I didn't configured the server but I think there is no heavy process in the server.
 
Old 06-03-2012, 09:21 PM   #8
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.6, Centos 5.10
Posts: 16,324

Rep: Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041
Code:
Swap:	2064376k	total,	2064376k	used,		0k	free,	12588k	cached
Code:
168	root	10	-5	0	0	0	D	5.1	0.0	0:16.01	[kswapd0]
Your swap is full (0k free) and kswapd (kernel swap daemon) is 2nd on list of processes after mysqld.

You've got 1 or more runaway process(es) filling your disk....

Note the amt of procs in states S or D and refer to this page http://slack-linux.blogspot.com.au/2...ate-codes.html
 
Old 06-07-2012, 03:09 AM   #9
NabiVakili
LQ Newbie
 
Registered: Feb 2011
Posts: 13

Original Poster
Rep: Reputation: 6
How can I find those processes?
Is there any tool or any solution to find out the "runaway process(es)" ?
 
Old 06-07-2012, 05:01 AM   #10
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,500

Rep: Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077
Not necessarily a (just one) runaway - count those httpd. Seems you have a few around 5% of Mem (that's physical %MEM).
"top" can be run with your choice of field to sort by - I'd suggest you use %MEM, and see what floats to the top. And how many - say 18x5% doesn't leave much for anyone else. 20 is, of course, even worse ...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Name of Memory Filesystem Runs In? dman777 Linux - General 5 02-07-2011 09:01 PM
My server runs slow but it's ok of memory guarriman Linux - Server 2 11-29-2007 10:57 AM
Centos 4 runs out of memory where Centos 3 didn't! czamora Red Hat 5 12-21-2006 03:21 PM
LXer: When Linux Runs Out of Memory LXer Syndicated Linux News 0 12-01-2006 01:54 AM
Fedora runs out of memory and locks up bhf21279 Fedora 4 01-12-2005 10:47 AM


All times are GMT -5. The time now is 01:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration