- marked as major
Wrong memory read from Apache
When specifying the mpm workers to pre-allocate workers:
<IfModule mpm_prefork_module>
ServerLimit 256
StartServers 32
MinSpareServers 16
MaxSpareServers 32
# MaxRequestWorkers 150
MaxConnectionsPerChild 2500
</IfModule>
monit incorrectly specifies reads the amount of RAM used by the process. I currently have monit checking apache with the following:
check process apache with pidfile /usr/local/drupal/apache2/logs/httpd.pid
start program = "/etc/init.d/apache start"
stop program = "/etc/init.d/apache stop"
if total cpu is greater than 60% for 2 cycles then alert
if total cpu > 80% for 5 cycles then alert
if total memory > 3072 MB for 5 cycles then alert
if children > 250 then alert
if loadavg(5min) greater than 10 for 8 cycles then stop
if failed host 127.0.0.1 port 80
protocol HTTP request /monit/token then alert
if 5 restarts within 5 cycles then timeout
group apache
My systems only has 4G of RAM allocated to it:
free -m
total used free shared buffers cached
Mem: 4096 4069 26 0 24 930
-/+ buffers/cache: 3114 981
Swap: 2047
and monit is showing 12G used:
Process 'apache'
status Resource limit matched
monitoring status Monitored
pid 26524
parent pid 1
uid 0
effective uid 0
gid 0
uptime 1h 12m
children 64
memory kilobytes 20972
memory kilobytes total 13315844
memory percent 0.5%
memory percent total 317.4%
cpu percent 0.0%
cpu percent total 0.6%
port response time 0.500s to 127.0.0.1:80/monit/token [HTTP via TCP]
data collected Wed, 07 May 2014 10:33:22
An example of an app that gets the correct memory usage would be: smem
Comments (14)
-
Account Deleted reporter -
Account Deleted reporter - edited description
-
repo owner Monit adds the whole RSS of each child process when computing children total ... in the case of Apache, significant part of memory is shared, whereas we don't handle the shared memory intersection.
We'll fix.
-
repo owner -
assigned issue to
- changed component to Monit
- changed version to 5.8
-
assigned issue to
-
Account Deleted reporter Makes sense. Thanks :) Kind of a pain when I have it restarting the services because when a trigger is reached for memory, had to change it to alert.
-
repo owner - changed component to 1. Monit
-
repo owner - changed component to Monit
-
Same problem here, Monit reports more mem usage for Apache than what actually is available: http://screencast.com/t/H6dfJueoJ (512MB server with 1GB swap)
-
repo owner - changed status to on hold
The cross-platform fix will require process' memory map integration ... we'll fix, but as we're refactoring the process related stuff in next major release, we'll do it as part of this project.
Putting temporarily on hold.
-
Account Deleted reporter Curious how this bug is coming along?
-
repo owner Still on hold ... we will update as soon as we'll start on it.
-
Account Deleted reporter Thanks
-
It would be great to have a solution for this issue. Many thanks for working on it.
-
repo owner - removed version
Removing version: 5.8 (automated comment)
- Log in to comment