Re: Memory leak and deep swap upon the restart?

2007-03-14 Thread Dan Nelson
In the last episode (Mar 15), Abdullah Ibn Hamad Al-Marri said:
> Hello,
> 
> I have a webmail server, has apache 2.2.4, mysql 5.0.33, php 5.2.1,
> clamav, mailscanner ..etc.
> 
> The weird issue it goes into deep swap when it starts or I restart it. 
> *sigh*
> This happened since like 6 months I don't know why? it was okay before that.
> 
> here is the top info
> 
> last pid:   790;  load averages:  0.00,  0.06,  0.05 up 0+00:06:50  03:51:28
> 69 processes:  1 running, 68 sleeping
> CPU states:  0.0% user,  0.0% nice,  0.4% system,  0.0% interrupt, 99.6% idle
> Mem: 323M Active, 91M Inact, 56M Wired, 27M Cache, 52M Buf, 988K Free
> Swap: 2048M Total, 104M Used, 1944M Free, 5% Inuse

Right now you're only showing 100M of swap being used; that looks fine,
as long as it's not being accessed constantly (watch for "##K in, ##K
out" to appear on the Swap: line, or watch the "pi" and "po" columns of
"vmstat 5").  If you see constant swap activity, that means you'll need
to reduce the number of worker processes for your multiprocess daemons
(from your ps output, that means apache, amavisd amd MailScanner), move
some processes to another machine, or add RAM.
 
> Here is the ps -aux output
> 
> mail# ps -aux
> USER   PID %CPU %MEM   VSZ   RSS  TT  STAT STARTED  TIME COMMAND
> vscan  482  0.0  0.0 46472 0  ??  IW   - 0:00.00 amavisd 
> (virgin child) (perl5.8.8)
> vscan  483  0.0  0.0 46472 0  ??  IW   - 0:00.00 amavisd 
> (virgin child) (perl5.8.8)

You have a bunch of amavisd processes that are completely swapped out
(0 RSS) and have never consumed any CPU (TIME column).  This probably
means that you could safely reduce the number of worker processes since
they're never used.

Also, the MailScanner process is pretty big; maybe there are some
settings you can change to make it use less.

-- 
Dan Nelson
[EMAIL PROTECTED]
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Memory leak and deep swap upon the restart?

2007-03-14 Thread Kris Kennaway
On Thu, Mar 15, 2007 at 06:55:24AM +0300, Abdullah Ibn Hamad Al-Marri wrote:
> Hello,
> 
> I have a webmail server, has apache 2.2.4, mysql 5.0.33, php 5.2.1,
> clamav, mailscanner ..etc.
> 
> The weird issue it goes into deep swap when it starts or I restart it. 
> *sigh*
> This happened since like 6 months I don't know why? it was okay before that.

Your running processes are trying to use more memory than is present
in your system, so swapping is the only possibility.

Look at the "VSZ" column (virtual size) to see how overloaded your
system is.

> USER   PID %CPU %MEM   VSZ   RSS  TT  STAT STARTED  TIME COMMAND

> vscan  449  0.0  0.7 45840  3520  ??  Ss3:45AM   0:00.48
> amavisd (master) (perl5.8.8)
> root   474  0.0 10.9 61788 56864  ??  Ss3:45AM   0:02.95
> /usr/local/bin/spamd -c -Q -d -r /var/run/spamd/spamd.pid (perl5.8
> vscan  482  0.0  0.0 46472 0  ??  IW   - 0:00.00
> amavisd (virgin child) (perl5.8.8)
> vscan  483  0.0  0.0 46472 0  ??  IW   - 0:00.00
> amavisd (virgin child) (perl5.8.8)
> vscan  484  0.0  0.0 46472 0  ??  IW   - 0:00.00
> amavisd (virgin child) (perl5.8.8)
> vscan  485  0.0  0.0 46472 0  ??  IW   - 0:00.00
> amavisd (virgin child) (perl5.8.8)
> vscan  486  0.0  0.0 46472 0  ??  IW   - 0:00.00
> amavisd (virgin child) (perl5.8.8)
> vscan  487  0.0  0.0 46472 0  ??  IW   - 0:00.00
> amavisd (virgin child) (perl5.8.8)
> vscan  488  0.0  0.0 46472 0  ??  IW   - 0:00.00
> amavisd (virgin child) (perl5.8.8)
> vscan  489  0.0  0.0 46472 0  ??  IW   - 0:00.00
> amavisd (virgin child) (perl5.8.8)
> root   646  0.0  0.7 61788  3428  ??  I 3:45AM   0:00.01 spamd
> child (perl5.8.8)
> root   647  0.0  0.3 61788  1424  ??  I 3:45AM   0:00.00 spamd
> child (perl5.8.8)
> postfix649  0.0  0.2 18916  1180  ??  Is3:45AM   0:00.01
> MailScanner: master waiting for children, sleeping (perl5.8.8)
> postfix650  0.0  0.5 79972  2464  ??  S 3:45AM   0:03.10
> MailScanner: waiting for messages (perl5.8.8)
> root   667  0.0  1.3 49788  6732  ??  Ss3:45AM   0:00.18
> /usr/local/sbin/httpd
> www742  0.0  0.0 49864 0  ??  IW   - 0:00.00
> /usr/local/sbin/httpd
> www763  0.0  1.3 50704  6980  ??  I 3:45AM   0:00.02
> /usr/local/sbin/httpd
> www765  0.0  2.0 52184 10140  ??  I 3:45AM   0:00.31
> /usr/local/sbin/httpd
> www766  0.0  0.7 49856  3476  ??  I 3:45AM   0:00.01
> /usr/local/sbin/httpd
> www767  0.0  0.7 49856  3476  ??  I 3:45AM   0:00.00
> /usr/local/sbin/httpd
> www768  0.0  0.7 49856  3476  ??  I 3:45AM   0:00.01
> /usr/local/sbin/httpd
> www769  0.0  2.1 50836 10788  ??  I 3:45AM   0:00.07
> /usr/local/sbin/httpd
> www770  0.0  2.3 50936 12172  ??  I 3:45AM   0:00.21
> /usr/local/sbin/httpd
> www771  0.0  0.0 49816 0  ??  IW   - 0:00.00
> /usr/local/sbin/httpd
> www772  0.0  0.0 49816 0  ??  IW   - 0:00.00
> /usr/local/sbin/httpd
> www773  0.0  0.0 49816 0  ??  IW   - 0:00.00
> /usr/local/sbin/httpd
> postfix774  0.0  0.3 79972  1600  ??  S 3:45AM   0:03.05
> MailScanner: waiting for messages (perl5.8.8)
> postfix775  0.0  0.3 79972  1792  ??  S 3:45AM   0:03.05
> MailScanner: waiting for messages (perl5.8.8)
> postfix776  0.0  0.3 79972  1376  ??  S 3:45AM   0:03.05
> MailScanner: waiting for messages (perl5.8.8)
> postfix777  0.0 14.4 79972 74812  ??  S 3:45AM   0:03.15
> MailScanner: waiting for messages (perl5.8.8)
> mysql  518  0.0  3.7 51508 19184 con- I 3:45AM   0:00.23
> /usr/local/libexec/mysqld --defaults-extra-file=/var/db/mysql/my.c

Kris
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"