LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   CentOS runs out of memory (https://www.linuxquestions.org/questions/linux-server-73/centos-runs-out-of-memory-947733/)

NabiVakili 05-31-2012 04:58 AM

CentOS runs out of memory
 
1 Attachment(s)
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:
Attachment 9799

What's the problem?

droyden 05-31-2012 05:51 AM

Do you have swap configured?

TenTenths 05-31-2012 08:57 AM

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?

NabiVakili 06-01-2012 04:22 AM

Quote:

Originally Posted by droyden (Post 4691904)
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.

TenTenths 06-01-2012 04:24 AM

Quote:

Originally Posted by NabiVakili (Post 4692784)
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.

droyden 06-01-2012 11:38 AM

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

NabiVakili 06-02-2012 12:10 AM

2 Attachment(s)
Quote:

Originally Posted by droyden (Post 4693163)
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:
Attachment 9817
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:
Attachment 9818
As I said I didn't configured the server but I think there is no heavy process in the server.

chrism01 06-03-2012 08:21 PM

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

NabiVakili 06-07-2012 02:09 AM

How can I find those processes?
Is there any tool or any solution to find out the "runaway process(es)" ?

syg00 06-07-2012 04:01 AM

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 ...


All times are GMT -5. The time now is 11:42 AM.