virtual memory management

2007-01-20 Thread Zbigniew Szalbot
Dear all,

Is there a FBSD command to manage virtual memory? I think my swap size is
now a bit too much used:

last pid: 19824;  load averages:  0.06,  0.05,  0.02   up 50+10:00:17 
08:54:00
230 processes: 1 running, 227 sleeping, 2 zombie
CPU states:  0.0% user,  0.0% nice,  0.4% system,  0.8% interrupt, 98.8% idle
Mem: 232M Active, 27M Inact, 91M Wired, 212K Cache, 60M Buf, 142M Free
Swap: 512M Total, 482M Used, 29M Free, 94% Inuse

The swap size usage grow so big probably because I started wget to
download an iso image and then WinSCP to grab it from the FBSD machine to
my laptop. When I started wget, the swap usage was around 19% and had been
like that for many days.

Is there any way to handle swap size usage other than restarting the box?

Thank you very much in advance!

-- 
Zbigniew Szalbot

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


Re: virtual memory management

2007-01-20 Thread Kris Kennaway
On Sat, Jan 20, 2007 at 08:57:27AM +0100, Zbigniew Szalbot wrote:
 Dear all,
 
 Is there a FBSD command to manage virtual memory? I think my swap size is
 now a bit too much used:
 
 last pid: 19824;  load averages:  0.06,  0.05,  0.02   up 50+10:00:17 
 08:54:00
 230 processes: 1 running, 227 sleeping, 2 zombie
 CPU states:  0.0% user,  0.0% nice,  0.4% system,  0.8% interrupt, 98.8% idle
 Mem: 232M Active, 27M Inact, 91M Wired, 212K Cache, 60M Buf, 142M Free
 Swap: 512M Total, 482M Used, 29M Free, 94% Inuse
 
 The swap size usage grow so big probably because I started wget to
 download an iso image and then WinSCP to grab it from the FBSD machine to
 my laptop. When I started wget, the swap usage was around 19% and had been
 like that for many days.

That should not cause such a thing (wget does not try to fit the whole
file in memory, so it won't be pushing stuff out to swap).  Look at
the process sizes in top to see what is using the swap space -
something(s) that is still running is using that 482MB.

Probably you have one or more processes that are using a large amount
of virtual memory, which is too big to fit in RAM.  That's the
situation you need to address.

 Is there any way to handle swap size usage other than restarting the box?

kill(1).

Kris


pgpuL9xkWePKe.pgp
Description: PGP signature


Re: virtual memory management

2007-01-20 Thread Zbigniew Szalbot
Hello again,

 The swap size usage grow so big probably because I started wget to
 download an iso image and then WinSCP to grab it from the FBSD machine
  to my laptop. When I started wget, the swap usage was around 19% and
 had been like that for many days.

 That should not cause such a thing (wget does not try to fit the whole
 file in memory, so it won't be pushing stuff out to swap).  Look at the
 process sizes in top to see what is using the swap space - something(s)
 that is still running is using that 482MB.

I do not see such a process:

  PID USERNAME   THR PRI NICE   SIZERES STATETIME   WCPU COMMAND
21442 root 2  200   224M 26128K kserel   0:06  0.00% java
  896 mysql   16  200 70756K 14764K kserel 255:35  0.00% mysqld
98693 bind 1  960 32812K 32172K select   0:22  0.00% dnscache
 5035 www  1   40 28372K 15660K accept   5:05  1.86% httpd
 5026 www  1   40 28240K 15104K accept   4:46  0.00% httpd
 5065 www  1   40 28128K 15196K accept   4:29  0.00% httpd
 5030 www  1   40 27892K 15144K accept   4:21  0.00% httpd
 5126 www  1   40 27784K 14864K accept   4:20  0.00% httpd
 5029 www  1   40 27760K 14644K accept   4:22  0.00% httpd
 5027 www  1   40 27740K 15140K accept   4:30  0.00% httpd
 5028 www  1   40 27516K 14812K accept   4:03  0.00% httpd
95977 www  1   40 27216K 14532K accept   2:21  0.00% httpd
  703 root 1  960 16412K  2296K select   4:35  0.00% httpd
91014 mailman  1   80 11492K  1600K nanslp   6:00  0.00% python
91012 mailman  1   80 11024K  1560K nanslp   5:32  0.00% python
91010 mailman  1   80 11008K  1568K nanslp   5:23  0.00% python
91009 mailman  1   80 11008K  1552K nanslp   5:20  0.00% python

I have just restarted the java program as it used to hold 224M but it did
not help (and it is quite stable and never given me any problem). After
using Squirrel Mail for some time swap use went down to 71%

Mem: 258M Active, 49M Inact, 108M Wired, 16M Cache, 60M Buf, 61M Free
Swap: 512M Total, 440M Used, 71M Free, 86% Inuse

Thank you very much for your suggestion Kris!

-- 
Zbigniew Szalbot

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


Re: virtual memory management

2007-01-20 Thread Kris Kennaway
On Sat, Jan 20, 2007 at 09:13:48AM +0100, Zbigniew Szalbot wrote:
 Hello again,
 
  The swap size usage grow so big probably because I started wget to
  download an iso image and then WinSCP to grab it from the FBSD machine
   to my laptop. When I started wget, the swap usage was around 19% and
  had been like that for many days.
 
  That should not cause such a thing (wget does not try to fit the whole
  file in memory, so it won't be pushing stuff out to swap).  Look at the
  process sizes in top to see what is using the swap space - something(s)
  that is still running is using that 482MB.
 
 I do not see such a process:
 
   PID USERNAME   THR PRI NICE   SIZERES STATETIME   WCPU COMMAND
 21442 root 2  200   224M 26128K kserel   0:06  0.00% java
   896 mysql   16  200 70756K 14764K kserel 255:35  0.00% mysqld
 98693 bind 1  960 32812K 32172K select   0:22  0.00% dnscache
  5035 www  1   40 28372K 15660K accept   5:05  1.86% httpd
  5026 www  1   40 28240K 15104K accept   4:46  0.00% httpd
  5065 www  1   40 28128K 15196K accept   4:29  0.00% httpd
  5030 www  1   40 27892K 15144K accept   4:21  0.00% httpd
  5126 www  1   40 27784K 14864K accept   4:20  0.00% httpd
  5029 www  1   40 27760K 14644K accept   4:22  0.00% httpd
  5027 www  1   40 27740K 15140K accept   4:30  0.00% httpd
  5028 www  1   40 27516K 14812K accept   4:03  0.00% httpd
 95977 www  1   40 27216K 14532K accept   2:21  0.00% httpd
   703 root 1  960 16412K  2296K select   4:35  0.00% httpd
 91014 mailman  1   80 11492K  1600K nanslp   6:00  0.00% python
 91012 mailman  1   80 11024K  1560K nanslp   5:32  0.00% python
 91010 mailman  1   80 11008K  1568K nanslp   5:23  0.00% python
 91009 mailman  1   80 11008K  1552K nanslp   5:20  0.00% python

I see lots of them; every one in that list is contributinig.  If you
add up all those process sizes you'll see where the space is going.
Basically you are just overloading your system by trying to run too
much at once.  Reduce the load or add more RAM.

Kris


pgpA2qhyW02hO.pgp
Description: PGP signature


Re: virtual memory management

2007-01-20 Thread Kris Kennaway
On Sat, Jan 20, 2007 at 03:51:38AM -0500, Kris Kennaway wrote:
 On Sat, Jan 20, 2007 at 09:13:48AM +0100, Zbigniew Szalbot wrote:
  Hello again,
  
   The swap size usage grow so big probably because I started wget to
   download an iso image and then WinSCP to grab it from the FBSD machine
to my laptop. When I started wget, the swap usage was around 19% and
   had been like that for many days.
  
   That should not cause such a thing (wget does not try to fit the whole
   file in memory, so it won't be pushing stuff out to swap).  Look at the
   process sizes in top to see what is using the swap space - something(s)
   that is still running is using that 482MB.
  
  I do not see such a process:
  
PID USERNAME   THR PRI NICE   SIZERES STATETIME   WCPU COMMAND
  21442 root 2  200   224M 26128K kserel   0:06  0.00% java
896 mysql   16  200 70756K 14764K kserel 255:35  0.00% mysqld
  98693 bind 1  960 32812K 32172K select   0:22  0.00% dnscache
   5035 www  1   40 28372K 15660K accept   5:05  1.86% httpd
   5026 www  1   40 28240K 15104K accept   4:46  0.00% httpd
   5065 www  1   40 28128K 15196K accept   4:29  0.00% httpd
   5030 www  1   40 27892K 15144K accept   4:21  0.00% httpd
   5126 www  1   40 27784K 14864K accept   4:20  0.00% httpd
   5029 www  1   40 27760K 14644K accept   4:22  0.00% httpd
   5027 www  1   40 27740K 15140K accept   4:30  0.00% httpd
   5028 www  1   40 27516K 14812K accept   4:03  0.00% httpd
  95977 www  1   40 27216K 14532K accept   2:21  0.00% httpd
703 root 1  960 16412K  2296K select   4:35  0.00% httpd
  91014 mailman  1   80 11492K  1600K nanslp   6:00  0.00% python
  91012 mailman  1   80 11024K  1560K nanslp   5:32  0.00% python
  91010 mailman  1   80 11008K  1568K nanslp   5:23  0.00% python
  91009 mailman  1   80 11008K  1552K nanslp   5:20  0.00% python
 
 I see lots of them; every one in that list is contributinig.  If you
 add up all those process sizes you'll see where the space is going.

By which I mean the difference between size and res, which indicates
the amount of process memory allocated but not currently resident in
RAM.  This isn't a foolproof method (see e.g. the FAQ entry on
rpc.statd), but it's true in your case.

 Basically you are just overloading your system by trying to run too
 much at once.  Reduce the load or add more RAM.
 
 Kris




pgpTxEofIrvtn.pgp
Description: PGP signature


Re: virtual memory management

2007-01-20 Thread Zbigniew Szalbot
Dear Kris and all,

 I see lots of them; every one in that list is contributinig.  If you
 add up all those process sizes you'll see where the space is going.

 By which I mean the difference between size and res, which indicates
 the amount of process memory allocated but not currently resident in
 RAM.  This isn't a foolproof method (see e.g. the FAQ entry on
 rpc.statd), but it's true in your case.

 Basically you are just overloading your system by trying to run too
 much at once.  Reduce the load or add more RAM.

The problem is I cannot add more RAM (too old machine to do that) but I
know what to do to decrease the load a bit. So thanks for the pointer! I
appreciate it!

Warm regards,

-- 
Zbigniew Szalbot

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


Re: virtual memory management

2007-01-20 Thread Ivan Voras
Zbigniew Szalbot wrote:

 The problem is I cannot add more RAM (too old machine to do that) but I
 know what to do to decrease the load a bit. So thanks for the pointer! I
 appreciate it!

You might also want to stop using mod_php in apache and convert to
fastcgi setup - this way you'll get all Apache processes to use a much
more reasonable amount, like ~~5MB - 8MB and a small number of php-cgi
processes that use ~~20MB or more, saving you memory in the end.



signature.asc
Description: OpenPGP digital signature


Re: virtual memory management

2007-01-20 Thread Zbigniew Szalbot
hello,

 The problem is I cannot add more RAM (too old machine to do that) but I
 know what to do to decrease the load a bit. So thanks for the pointer! I
 appreciate it!

 You might also want to stop using mod_php in apache and convert to
 fastcgi setup - this way you'll get all Apache processes to use a much
 more reasonable amount, like ~~5MB - 8MB and a small number of php-cgi
 processes that use ~~20MB or more, saving you memory in the end.

Does this mean recompiling Apache? Or is it a question of httpd.conf? From
what I understand it probably involves recompilation?

Thank you!

-- 
Zbigniew Szalbot

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


Re: virtual memory management

2007-01-20 Thread Pieter de Goeje
On Saturday 20 January 2007 08:57, Zbigniew Szalbot wrote:
 Is there any way to handle swap size usage other than restarting the box?
Yes, you can add swap while the system is running with swapon(8). If you don't 
have an empty partition available you could create one with mdconfig(8).

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


Re: virtual memory management

2007-01-20 Thread Ivan Voras
Zbigniew Szalbot wrote:
 hello,
 
 The problem is I cannot add more RAM (too old machine to do that) but I
 know what to do to decrease the load a bit. So thanks for the pointer! I
 appreciate it!
 You might also want to stop using mod_php in apache and convert to
 fastcgi setup - this way you'll get all Apache processes to use a much
 more reasonable amount, like ~~5MB - 8MB and a small number of php-cgi
 processes that use ~~20MB or more, saving you memory in the end.
 
 Does this mean recompiling Apache? Or is it a question of httpd.conf? From
 what I understand it probably involves recompilation?

At most it would require recompilation of PHP (the main port, not the
extensions) and installing mod_fcgid. If you enabled CGI and FastCGI
during PHP build, you only need mod_fcgid.

See http://fastcgi.coremail.cn/configuration.htm#PHP for documentation.
(don't forget to remove mod_php from httpd.conf). Note that using
FastCGI is different in some important aspects from mod_php, so read up
on it if you haven't used it before.




signature.asc
Description: OpenPGP digital signature


Re: virtual memory management

2007-01-20 Thread Dan Nelson
In the last episode (Jan 20), Zbigniew Szalbot said:
  I see lots of them; every one in that list is contributinig.  If
  you add up all those process sizes you'll see where the space is
  going.
 
  By which I mean the difference between size and res, which indicates
  the amount of process memory allocated but not currently resident in
  RAM.  This isn't a foolproof method (see e.g. the FAQ entry on
  rpc.statd), but it's true in your case.
 
  Basically you are just overloading your system by trying to run
  too much at once.  Reduce the load or add more RAM.
 
 The problem is I cannot add more RAM (too old machine to do that) but
 I know what to do to decrease the load a bit. So thanks for the
 pointer! I appreciate it!

Also remember that swap usage itself is not a bad thing; it just means
the system has moved some unused process data to disk.  What /is/ bad
is when the system is so low on RAM that is it constantly shuffling
data to and from swap just to keep running.  This is called thrashing,
and you can track it by watching the ##Kb In, ##Kb Out values on the
Swap: line in top, and the pi and po columns in vmstat output.  As
long as you don't see constant swapping activity, you're okay.

-- 
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: virtual memory management

2007-01-20 Thread Jerry McAllister
On Sat, Jan 20, 2007 at 08:57:27AM +0100, Zbigniew Szalbot wrote:

 Dear all,
 
 Is there a FBSD command to manage virtual memory? I think my swap size is
 now a bit too much used:
 
 last pid: 19824;  load averages:  0.06,  0.05,  0.02   up 50+10:00:17 
 08:54:00
 230 processes: 1 running, 227 sleeping, 2 zombie
 CPU states:  0.0% user,  0.0% nice,  0.4% system,  0.8% interrupt, 98.8% idle
 Mem: 232M Active, 27M Inact, 91M Wired, 212K Cache, 60M Buf, 142M Free
 Swap: 512M Total, 482M Used, 29M Free, 94% Inuse
 
 The swap size usage grow so big probably because I started wget to
 download an iso image and then WinSCP to grab it from the FBSD machine to
 my laptop. When I started wget, the swap usage was around 19% and had been
 like that for many days.
 
 Is there any way to handle swap size usage other than restarting the box?

Don't forget that the system also pages to swap space and it takes the
attitude of parking as much as possible out there in case it comes in
to demand again.  Ten if it really needs the space for something, it 
invalidates the oldest stuff and uses that space.

So, you should really expect that your swap space should be 
nearly maxed all the time if things are working well.

Someone else can give you more accurate detailed information
if you want it.

jerry

 
 Thank you very much in advance!
 
 -- 
 Zbigniew Szalbot
 
 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to [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: virtual memory management

2007-01-20 Thread Zbigniew Szalbot
Dear all,


| Also remember that swap usage itself is not a bad thing; it just means

Problem solved. I should have thought about that earlier. Yesterday I was
playing with HotSaNIC software to use it on this box. In the end I decided
I didn't like it and I didn't really need it so I removed it from the
system stopping rrdtool first. Only today did I notice that I have an
unusually high (for my setup) number of sleeping processes. ps ax showed
me that I had about 150 perl processes that were started by HotSaNIC but
never really stopped. I killed them (what a joy :) and voila:

last pid: 62059;  load averages:  0.04,  0.12,  0.22   up 51+00:27:42 
23:21:25
81 processes:  1 running, 78 sleeping, 2 zombie
CPU states:  2.7% user,  0.0% nice,  0.8% system,  0.8% interrupt, 95.7% idle
Mem: 161M Active, 4348K Inact, 111M Wired, 128K Cache, 60M Buf, 216M Free
Swap: 512M Total, 81M Used, 431M Free, 15% Inuse

Thank you all for your support! My experience with FBSD is pretty much 51
days old :). But I read most of the posts hoping to learn new things. The
great adventure now is to upgrade to 6.2 from 6.1. Never been there before
:)

Warm regards,

-- 
Zbigniew Szalbot

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


Re: virtual memory management

2007-01-20 Thread [LoN]Kamikaze
 Don't forget that the system also pages to swap space and it takes the
 attitude of parking as much as possible out there in case it comes in
 to demand again.  Ten if it really needs the space for something, it 
 invalidates the oldest stuff and uses that space.
 
 So, you should really expect that your swap space should be 
 nearly maxed all the time if things are working well.

If this is the case something is really wrong on my system:

Swap: 4096M Total, 4096M Free

either top doesn't show the precautionary swapping or this is not happening.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: virtual memory management

2007-01-20 Thread Ivan Voras
[LoN]Kamikaze wrote:
 Don't forget that the system also pages to swap space and it takes the
 attitude of parking as much as possible out there in case it comes in
 to demand again.  Ten if it really needs the space for something, it 
 invalidates the oldest stuff and uses that space.

 So, you should really expect that your swap space should be 
 nearly maxed all the time if things are working well.
 
 If this is the case something is really wrong on my system:
 
 Swap: 4096M Total, 4096M Free
 
 either top doesn't show the precautionary swapping or this is not happening.

Precautionary swapping does exist, but it's not that often :) What the
poster probably meant is that it's possible to have a perfectly working
system which looks like it's using a lot of swap if the swapin/swapout
rate is low enough.




signature.asc
Description: OpenPGP digital signature