Re: Memory leak and deep swap upon the restart?

2007-03-15 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]


Memory leak and deep swap upon the restart?

2007-03-14 Thread Abdullah Ibn Hamad Al-Marri

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



Here is the ps -aux output

mail# ps -aux
USER   PID %CPU %MEM   VSZ   RSS  TT  STAT STARTED  TIME COMMAND
root10 98.7  0.0 0 8  ??  RL3:45AM   5:55.48 [idle]
root 0  0.0  0.0 0 0  ??  WLs   3:45AM   0:00.00 [swapper]
root 1  0.0  0.0   820   140  ??  ILs   3:45AM   0:00.01 /sbin/init --
root 2  0.0  0.0 0 8  ??  DL3:45AM   0:00.02 [g_event]
root 3  0.0  0.0 0 8  ??  DL3:45AM   0:00.22 [g_up]
root 4  0.0  0.0 0 8  ??  DL3:45AM   0:00.17 [g_down]
root 5  0.0  0.0 0 8  ??  DL3:45AM   0:00.00 [thread taskq]
root 6  0.0  0.0 0 8  ??  DL3:45AM   0:00.00 [kqueue taskq]
root 7  0.0  0.0 0 8  ??  DL3:45AM   0:00.00 [acpi_task_0]
root 8  0.0  0.0 0 8  ??  DL3:45AM   0:00.00 [acpi_task_1]
root 9  0.0  0.0 0 8  ??  DL3:45AM   0:00.00 [acpi_task_2]
root11  0.0  0.0 0 8  ??  WL3:45AM   0:00.87 [swi4: clock]
root12  0.0  0.0 0 8  ??  WL3:45AM   0:00.00 [swi3: vm]
root13  0.0  0.0 0 8  ??  WL3:45AM   0:00.13 [swi1: net]
root14  0.0  0.0 0 8  ??  DL3:45AM   0:00.06 [yarrow]
root15  0.0  0.0 0 8  ??  WL3:45AM   0:00.00
[swi6: Giant taskq]
root16  0.0  0.0 0 8  ??  WL3:45AM   0:00.00
[swi6: task queue]
root17  0.0  0.0 0 8  ??  WL3:45AM   0:00.00 [swi5: +]
root18  0.0  0.0 0 8  ??  WL3:45AM   0:00.00 [irq20: acpi0]
root19  0.0  0.0 0 8  ??  WL3:45AM   0:00.19 [irq22: fxp0]
root20  0.0  0.0 0 8  ??  WL3:45AM   0:00.11 [irq14: ata0]
root21  0.0  0.0 0 8  ??  WL3:45AM   0:00.00 [irq15: ata1]
root22  0.0  0.0 0 8  ??  WL3:45AM   0:00.00 [irq1: atkbd0]
root23  0.0  0.0 0 8  ??  DL3:45AM   0:01.00 [pagedaemon]
root24  0.0  0.0 0 8  ??  DL3:45AM   0:00.78 [vmdaemon]
root25  0.0  0.0 0 8  ??  DL3:45AM   0:00.31 [pagezero]
root26  0.0  0.0 0 8  ??  DL3:45AM   0:00.00 [bufdaemon]
root27  0.0  0.0 0 8  ??  DL3:45AM   0:00.00 [vnlru]
root28  0.0  0.0 0 8  ??  DL3:45AM   0:00.03 [syncer]
root29  0.0  0.0 0 8  ??  DL3:45AM   0:00.01 [softdepflush]
root30  0.0  0.0 0 8  ??  DL3:45AM   0:00.02 [schedcpu]
root92  0.0  0.0  1364 0  ??  IWs  - 0:00.00 adjkerntz -i
root   344  0.0  0.1  1496   440  ??  Ss3:45AM   0:00.02
/usr/sbin/syslogd -ss -a /var/amavis/var/log
vscan  449  0.0  0.7 45840  3520  ??  Ss3:45AM   0:00.48
amavisd (master) (perl5.8.8)
postgrey   468  0.0  0.0  8800 0  ??  IWs  - 0:00.00
/usr/local/sbin/postgrey --pidfile=/var/run/postgrey.pid --inet=10
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   633  0.0  0.1  2444   412  ??  Ss3:45AM   0:00.01
/usr/local/libexec/postfix/master
postfix644  0.0  0.1  2476   416  ??  S 3:45AM   0:00.01
pickup -l -t fifo -u
postfix645  0.0  0.1  2524   480  ??  I 3:45AM   0:00.01 qmgr
-l -t fifo -u
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  ??  Is

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]