2

Every now and again my apache server is crashing, getting an error saying the MaxClients has been reached. In my research I've gained the impression that I may be running out of memory (just checked and MaxClients is set to 1500, though number of apache processes hovers between 40 and 100)

Anyway that's just a bit of background.

When I run top I am told I've about 15GB in total, 14GB in used and the Free seems at the moment to be hovering between 500MB - 1GB (though about an hour earlier it was about 3-4 GB free)

I have also run ps_mem.py however and that shows only 3-4 GB being used!

Why the difference? And which one is correct?

komodosp
  • 121
  • 6

1 Answers1

0

ps_mem.py is IMO bit more precise because it assesses amount of shared memory correct where top is buggy.

top reads /proc/<PID>/statm whereas ps_mem.py reads more detailed info from /proc/<PID>/smaps and assesses total usage of multi-processing daemon with more precision.

For details I recommend reading through ps_mem.py code

Hrvoje Špoljar
  • 5,245
  • 26
  • 42