Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Something is eating up all my memory!?! Please help!

Status
Not open for further replies.

npa2007

Technical User
Mar 6, 2008
2
DE
This is going on for a week now. My hosting provider told me that I need more RAM but he wasn't right.
I uninstalled few things and the free memory increased but in few minutes raised again!

Does anybody have a clue what's going on here?

Here is the log

total used free shared buffers cached
Mem: 2000460 1969360 31100 0 64788 1540812
-/+ buffers/cache: 363760 1636700
Swap: 979956 8108 971848
Total: 2980416 1977468 1002948



PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND
9775 root 22 0 36468 35M 824 S 0.0 1.8 0:06 0 clamd
9919 root 16 0 34696 33M 2516 S 0.0 1.7 1:06 0 spamd
19977 root 15 0 33744 32M 2516 S 0.0 1.6 0:21 0 spamd
9884 root 15 0 30568 29M 2424 S 0.0 1.5 0:02 0 spamd
9687 mysql 5 -10 21676 21M 2672 S < 0.0 1.0 0:00 0 mysqld
9690 mysql 5 -10 21676 21M 2672 S < 0.0 1.0 0:00 0 mysqld
9691 mysql 5 -10 21676 21M 2672 S < 0.0 1.0 0:00 0 mysqld
10082 mysql 5 -10 21676 21M 2672 S < 0.0 1.0 0:01 0 mysqld
10085 mysql 5 -10 21676 21M 2672 S < 0.0 1.0 0:01 0 mysqld
10155 mysql 5 -10 21676 21M 2672 S < 0.0 1.0 0:01 0 mysqld
10118 root 15 0 15524 15M 7600 S 0.0 0.7 0:00 0 cpsrvd-ssl
10046 nobody 15 0 12100 11M 7280 S 0.0 0.6 0:05 0 httpd
10051 nobody 15 0 11732 11M 6852 S 0.0 0.5 0:08 0 httpd
10132 root 22 0 11556 11M 2976 S 0.0 0.5 0:00 0 cpdavd
22353 nobody 15 0 11412 11M 6612 S 0.1 0.5 0:06 0 httpd
10039 nobody 15 0 11272 11M 6592 S 0.0 0.5 0:04 0 httpd
10036 nobody 15 0 11136 10M 6272 S 0.0 0.5 0:08 0 httpd
10056 nobody 15 0 10944 10M 6132 S 0.0 0.5 0:09 0 httpd
22354 nobody 15 0 10844 10M 5908 S 0.0 0.5 0:04 0 httpd
10164 nobody 15 0 10820 10M 6140 S 0.0 0.5 0:06 0 httpd
10034 nobody 15 0 10692 10M 5996 S 0.0 0.5 0:04 0 httpd
10057 nobody 15 0 10620 10M 5776 S 0.0 0.5 0:04 0 httpd
16179 nobody 15 0 10584 10M 5908 S 0.0 0.5 0:03 0 httpd
16127 nobody 15 0 10576 10M 5824 S 0.0 0.5 0:02 0 httpd
10151 nobody 15 0 10468 10M 5768 S 0.0 0.5 0:03 0 httpd
10053 nobody 15 0 10420 10M 5760 S 0.0 0.5 0:03 0 httpd
10054 nobody 15 0 10416 10M 5684 S 0.0 0.5 0:04 0 httpd
10048 nobody 15 0 10392 10M 5792 S 0.0 0.5 0:06 0 httpd
16459 nobody 15 0 10388 10M 5648 S 0.0 0.5 0:01 0 httpd
10050 nobody 15 0 10340 10M 5716 S 0.0 0.5 0:06 0 httpd
10133 nobody 15 0 10332 10M 5480 S 0.0 0.5 0:01 0 httpd
10149 nobody 15 0 10332 10M 5424 S 0.0 0.5 0:09 0 httpd
10141 root 39 19 10260 10M 2472 S N 0.0 0.5 0:04 0 cpanellogd
10159 root 16 0 10244 10M 5260 S 0.0 0.5 0:00 0 cppop-ssl
10137 nobody 15 0 10228 9M 5588 S 0.0 0.5 0:04 0 httpd
18700 nobody 15 0 9964 9964 5416 S 0.0 0.4 0:01 0 httpd
10045 nobody 15 0 9792 9792 5024 S 0.0 0.4 0:04 0 httpd
16129 nobody 15 0 9704 9704 5172 S 0.0 0.4 0:03 0 httpd



 
It's not unusual for Linux OS to allocate most if it's available
memory to processes, and reserve them even after the
processes have stopped running.
Their just left in the cache in case the process is started again.
It might be that nothings wrong on your server.
Is the server running slow?
As far as I can see the amount of used swap-memory is low,
which is a good sign.
If you were running out of RAM, the amount of used swap
should increse to.


HTH
 
Your system is perfectly healthy.

[tt]total used free shared buffers cached
Mem: 2000460 1969360 31100 0 64788 1540812
-/+ buffers/cache: 363760 1636700
Swap: 979956 8108 971848
Total: 2980416 1977468 1002948[/tt]

The line in green is the one you should really look at. Linux will use most of the available memory in your system to cache filesystem data and speed up I/O to frequently used files. However it considers this memory to be 'low priority', and if an application requires more memory it will be immediately released. So in effect you can consider it to be a part of the 'free' memory in your system, which is why that line is reported in the output of the free command. So, in effect, you are currently only using about 18% of the system's memory for applications.

Annihilannic.
 
The server is going offline after it works for like from 1 to 2 hours. Then I have to contact the host to reboot the server and again the same story. Don't know what to do. They said that I should reinstall the whole server but that's pain in the ass and lost time...
 
Are you running sar or any other performance data collector? If not, you should, to get an idea of what is happening leading up to the hang/crash/whatever.

Is anything reported in the system logs just before it becomes unavailable?

What state is the server in when it goes offline? Has it panicked, or is it just hanging?

Annihilannic.
 
As the previous poster mentioned you need to thoroughly study your application logs. mysql, apache or your milter software. Sar as mentioned is a big help. You should really be running snmpd and trapping on load and application alerts.
 
This is a shot in the dark, but, do you get a ton of traffic to your website? If not, you might want to go into your httpd.conf file and drop your maximum concurrent httpd sessions down a bit. You could also lower your initial sessions depending on where you already have it set.

If you have a high maximum on your httpd sessions it is possible that someone could be pounding on your website and causing your system to spawn so many httpd sessions that it runs out of memory, freaks out, etc. Right now it looks like you have 24 httpd processes running. What that means is that at one time (unless your initial setting is that high) 24 people accessed your website at once. Every additional user above that number will spawn a new session - up to your maximum setting. They never go away except upon reboot, or in my case, the monthly cleaning cycle resets everything to startup values.

Just one possible thing to consider. I know when I set mine up this was set to some higher value and I knew my site wasn't going to be that busy so I dropped it by quite a bit.
 
You can sit at a console login (text) and run top

Top will show you what is running, how much memory, etc. etc. and allow you to see it "real time"



Just my 2¢
-Cole's Law: Shredded cabbage

--Greg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top