linux is in swap --- yes or no?

Adam Auden adam at
Tue May 15 07:07:24 BST 2007

On 5/15/07, nigel at <nigel at> wrote:

>         I'm trying to work out whether or not a Linux server is using swap.
>         "top" and "free" seem to give equivocal results - vmstat too.
>         How can I at any instant in time say are you in swap - yes or no?
>         I was hoping this module ...
>         ... would give a definitive yes/no answer but it seems to also be
> a bit fuzzy when it comes to this question.
>         Any thoughts?

You can get to pswpin and pswpout using that module and, by monitoring
these values, you can work out how much swapping is taking place.

It should be noted what you're looking for to indicate performance
problems is lots of changes to what is in swap, not the existance of
swap.  The virtual memory management in linux will swap memory out for
idle processes even if not yet exhausted of memory.  This frees RAM up
for disk cache and means that the system is in a better position to
respond to an overall increase in RAM usage.



Adam Auden - UNIX Metal Geek

More information about the mailing list