Subject: Re: Excessive swapping / Memory problems
To: Erik Berls <cyber@ono-sendai.com>
From: Vincent van Scherpenseel <mailinglists@vanscherpenseel.nl>
List: netbsd-users
Date: 09/06/2006 22:49:28
Erik Berls wrote:
> This really looks like it might be a periodic process that comes
> along, consumes a large amount of memory, then exits.
> 
> Note the amount of processes that only have 4k resident (likely the
> pcb).  Do you see the process kills at a particular time of day?
> Could it be something caused by cron?  mysqld forking off and that
> fork consuming large amounts of memory?
> 
> If you've got a low volume web site, you might reconsider how many
> httpd's you are running.  You might be able to drop from 10 down to 4.
> 
> -=erik.

I took another top -o size snapshot:

   PID USERNAME PRI NICE   SIZE   RES STATE      TIME   WCPU    CPU COMMAND
  9747 www       -4    0    35M 2596K semwait    0:32  0.00%  0.00% httpd
  9700 www       -4    0    35M 1508K semwait    0:31  0.00%  0.00% httpd
11517 www       -4    0    34M 3076K semwait    0:11  0.00%  0.00% httpd
12290 www       -4    0    33M 2304K semwait    0:37  0.00%  0.00% httpd
   363 mysql      2    4    33M 3112K select    25:39  0.00%  0.00% mysqld
11943 www       -4    0    32M 2648K semwait    0:35  0.00%  0.00% httpd
27633 www        2    0    28M 2696K select     0:01  0.00%  0.00% httpd
11518 www       -4    0    24M 4556K semwait    0:08  0.00%  0.00% httpd
27634 www       -4    0  3104K 2972K semwait    0:00  0.00%  0.00% httpd
27635 www       -4    0  3100K 2948K semwait    0:00  0.00%  0.00% httpd
27817 www       -4    0  2936K 3592K semwait    0:00  0.00%  0.00% httpd
   355 root       2    0  2704K  408K select     0:12  0.00%  0.00% httpd

Resident has increased quite a lot since the last snapshot (about 35 
minutes ago). There are indeed some cronjobs (mostly a perl script 
fetching weather information for me) but I don't think they're causing 
this, since they have nothing to do with httpd.

The problem of processes getting killed happens just every now and then 
when the system is out of swap. Just when I'm doing nothing on the 
system (not even logged in!) but also when I'm compiling etc.

So is there no chance this is hardware related? Because somehow I'm 
really looking into that corner.

Thanks for your help, Vincent van Scherpenseel

<snip>