swap space descrepancy between top and 'swap'

swap space descrepancy between top and 'swap'

Post by stephan bea » Wed, 12 Nov 2003 21:40:04



Hello, Solaris gurus,

We have a problem on several Solaris 9 boxes where our web servers keep
failing with fork errors (out of memory). Using 'top' shows that the swap
space is indeed full, and thus the error is expected. Other tools, e.g.,
'swap' and 'df /tmp' show the swap space as being 90+% free/unused.

Can someone please clue me in on an accurate way to get the amount of swap
space available to the box? Adding swap files with 'swap -a file' does
indeed add more swap space, but top shows it being immediately (and
completely) as used, whereas swap/df show it as free swap space. (IMO it's
simply not possible that 3GB of swap space can be used up in under 2
seconds, but i'm not Solaris expert.)

In case it matters, this happens very often when our web servers (Apache
1.3.28) get traffic spikes (150-200 users). The servers do not show any
other odd behaviour or heavy load, except for the quasi-bogus
out-of-swap-space which leads to all sorts of other problems. The servers
have ample RAM and drive space and only run apache, so these errors are
particularly annoying. :/

Any tips would be greatly appreciated.

--
----- stephan beal
http://s11n.net/
Registered Linux User #71917 http://counter.li.org
I speak for myself, not my employer. Contents may
be hot. Slippery when wet. Reading disclaimers makes
you go blind. Writing them is worse. You have been Warned.

 
 
 

swap space descrepancy between top and 'swap'

Post by Casper H.S. Di » Wed, 12 Nov 2003 22:18:53



>We have a problem on several Solaris 9 boxes where our web servers keep
>failing with fork errors (out of memory). Using 'top' shows that the swap
>space is indeed full, and thus the error is expected. Other tools, e.g.,
>'swap' and 'df /tmp' show the swap space as being 90+% free/unused.

How did you call swap?  Please try "swap -s".

How big are the processes and are they forking?

Casper
--
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.

 
 
 

swap space descrepancy between top and 'swap'

Post by stephan bea » Wed, 12 Nov 2003 22:51:10



> How did you call swap?  Please try "swap -s".

swap -s and swap -l provide similar (bogus) results. i'm sorry, but i don't
have a snapshot to show at the moment (i will the next time it crashes,
though).

Quote:> How big are the processes and are they forking?

top shows them as approx 3MB each, but some of that is shared memory, so i
can't say exactly. We hit our critical point once we have approximately 150
threads. The processes are allowed up to 1024 file handles, so this isn't
our problem. We've actually been idly looking at this for several months,
but we only today noticed the descrepancy between top and df/swap (i've
been using df to check (e.g., /tmp), and therefor never saw any unusual
swap space usage), and that's mainly where my concern is at the moment. We
know generally what causes the errors (but we think they are bogus), but we
don't know how we can't get reliable swap information from the OS.

The machines each have a gig of RAM and between 3G and 5G of swap space,
well more than what the average Apache needs.

--
----- stephan beal
http://s11n.net/
Registered Linux User #71917 http://counter.li.org
I speak for myself, not my employer. Contents may
be hot. Slippery when wet. Reading disclaimers makes
you go blind. Writing them is worse. You have been Warned.

 
 
 

swap space descrepancy between top and 'swap'

Post by tmoo » Thu, 13 Nov 2003 06:24:14




> > How did you call swap?  Please try "swap -s".

> swap -s and swap -l provide similar (bogus) results. i'm sorry, but i don't
> have a snapshot to show at the moment (i will the next time it crashes,
> though).

> > How big are the processes and are they forking?

> top shows them as approx 3MB each, but some of that is shared memory, so i
> can't say exactly. We hit our critical point once we have approximately 150
> threads. The processes are allowed up to 1024 file handles, so this isn't
> our problem. We've actually been idly looking at this for several months,
> but we only today noticed the descrepancy between top and df/swap (i've
> been using df to check (e.g., /tmp), and therefor never saw any unusual
> swap space usage), and that's mainly where my concern is at the moment. We
> know generally what causes the errors (but we think they are bogus), but we
> don't know how we can't get reliable swap information from the OS.

> The machines each have a gig of RAM and between 3G and 5G of swap space,
> well more than what the average Apache needs.

We are having similar problems with iPlanet running on Solaris 8. Sun
is really no help either. The only way I have been able to see swap
space disappearing is to run "vmstat 5 50" (run vmstat at 5 second
intervals, an run it 50 times). It does show it degrading, but up to
now we have had a rough time pinpointing the cause. Thru the use of
some of the tools buil into Solaris 8 we have traced it to something
making a memory call to a semafor that is locked by the kernel.
Although we are running iPlanet, and you are runnning Apache, this
sound very firmiliar.....
 
 
 

1. Adding swap space using 'swap -a' command ?

Greetings,

I am using SCO OpenServer 5.0.4 on a compaq prolian 4500 server. The
initial swap space setup is too small. I want to increase the swap
space.

I first create a directory say '/hotswap' and inside the hotswap
directory, I created a empty file called 'swapfile2'. I then make the
file swapfile2 act as a swap space
using :
              swap -a /hotswap/swapfile2 65536

When I used 'swap -l' to list the current swap space, it appears to have
added to the system. But when I check the system disk space, it appear
to be the same as before the swap file is added to the system.

path                                        swaplo    block        free
block
=========================================
/dev/swap                  1,41            0        196668      186790
/hotswap/swapfile2     76,1            0        65536        65536

Can someone tell if I done it correctly?  If not, how should I do it ?


Thank in advance

Eric Chin

2. Trouble with file I/O

3. Determining process swap space/mem utilization with 'ps' and 'pstat' listings

4. Disk controllers

5. plenty of swap space, but keep receiving error "swap space limit exceeded"

6. Major Suse upgrade problems

7. Try to mount a seocn SWAP space-- error" unable to find swap space signature"

8. routing firewall (no masq), please help

9. Is swap space in SCO only swap space or is it consider virtual memory

10. Allocated swap space versus used swap space

11. 'Unable to find swap-space signature' !?

12. Linux & OS/2 sharing a swap space, here's how it's done.

13. SWAP SPACE NOT 'ON' WHEN LOGIN..!