LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 09-08-2008, 12:11 PM   #1
h725
Member
 
Registered: Apr 2008
Posts: 114

Rep: Reputation: 15
Out of memory


Hi,

I've a problem with my server.
Basically it's a web server (apache 1.3) + mail server (qmail).
Sometimes his load become very high, almost 100 cpu usage, and I am forced to reboot the machine (the use of console is impossible..)

When I see the console, the error message is like:

Out of memory
VM: killing apache
VM: killing syslogd
...

I thinks it's a memory leak in some application, because sometimes the server runs fine for weeks.
How can I find the specific problem?

Thanks
 
Old 09-08-2008, 12:29 PM   #2
w3bd3vil
Senior Member
 
Registered: Jun 2006
Location: Hyderabad, India
Distribution: Fedora
Posts: 1,191

Rep: Reputation: 49
You will have to check your all your logs.
Start with apache and syslog to see what is the exact error they are reporting.
You can find the logs generally in /var/log/
 
Old 09-09-2008, 03:04 AM   #3
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,070

Rep: Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897
Quote:
...I thinks it's a memory leak in some application...
If its a memory leak in some application (& that is not clear from what you post), then it ought to be reasonably easy to detect.

It would probably be a good idea to monitor memory usage over some fixed period, maybe every 10 seconds, maybe longer depending on how long you think you will have to run. If it is a memory leak, that would normally gradually increase. To do this you'd probably run vmstat and you might want to store vmstat results away in a log file to try to get results close to the crash.

The other thing you would do would be to monitor individual processes to check whether any individual process has increasing memory usage. Probably top -n 1 would capture the info that you want (you may have more processes than top easily captures & I'm not sure how top determines the screen length in non-interactive sessions...) and you would want to capture a number of data dumps over a period to see how memory usage grows.

(You could do this more simply with ksysguard - given that its a server, you won't have kde installed on it, but you could use ksysguard on a desktop to monitor memory use on the server, if you place the 'sensors' remotely, but I haven't actually tried this.)

You'd be hoping (for the memory leak theory) to see some process growing over time until its memory size becomes too large; a difficulty is being sure that a process is growing 'illegitimately' (memory leak) versus one that is just growing because its worload has grown too high.
 
Old 09-09-2008, 03:20 AM   #4
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
Cpu alone usually do not make a text console lag with the schedulers we have nowadays.

So, the theory of leaking memory is very consistent. Not only you have the errors, but the behavior you describe is typical of a system with a very hight swapping activity. I'd say launch an ssh session and put that window in top of your face, run top or htop on it, and pay special attention to the swap level.
 
Old 09-09-2008, 03:40 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
If you have sysstat installed, sar has all the historical info you need to track this. Else try the "top" suggestion above, but run it in batch (-b) in addition to "-n 1". Write it out to a file - you could get creative and sort by memory and only pull (say) the top 5 if it really is a leak. May not be indicative tho' - you're likely to have tens (hundreds ???) of processes spawned by apache; or maybe a looping (cron) script. It all adds up.
 
  


Reply



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
Two USB memory devies (stick memory/jump drive) one works one not Mark_in_Hollywood Linux - Hardware 5 05-20-2008 07:35 PM
LXer: This week at LWN: Memory part 7: Memory performance tools LXer Syndicated Linux News 0 11-22-2007 08:51 AM
Difference between resident memory,shared memory and virtual memory in system monitor mathimca05 Linux - Newbie 1 11-11-2007 04:05 AM
Help!?! RH 8 Memory Mapping -High Memory-Virtural Memory issues.. Merlin53 Linux - Hardware 2 06-18-2003 04:48 PM
RH 8.0 Mapping Virtual Memory to get access to VMIC Reflective Memory PCI card. Merlin53 Linux - Hardware 0 05-05-2003 12:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:46 AM.

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
Open Source Consulting | Domain Registration