Re: Swap performance statistics in 2.6 -- which /proc file has it?

From: Dominik Kubla
Date: Wed Dec 10 2003 - 05:35:16 EST


Stephen Satchell wrote:

How does sampling free pages give you an accurate measurement of swap
activity? If I look at the free-page count at one-minute intervals, the
system can, and WILL, inhale and exhale pages at a frightening clip, and
there is no way I can see that sampling free-page count in a
low-overhead way will do the trick.

First keep in mind that the Linux kernel uses paging instead of swapping out whole processes. So all you really are interested in is the sum of free pages and cache pages, because this is the amount of memory not yet used be running processes.

Second: If you happen to have a memory shortage, resulting in memory pages being paged out to disk, you will want to check with iostat the overall activity of the disk(s) your swap space (or rather paging space would be more accurate) is located. If you have lots of paging activity you will want to have one or more otherwise idle disks (and on a different i/o path if possible) to put your swap space on ('iostat -x' is your friend).

If your system is continously paging, you will most likley need to add memory if you are concerned with performance, but that is also depending on the kind of work load your system has.

How does vmstat disk-swap activity? Looking at the source for vmstat in
procps-2.0.11 I see how they do it for 2.4 kernels, but the part for 2.5
kernels doesn't seem to try to pick up swap statistics at all -- because
there are none to get?

First: you'll need sysstat installed (latest version appears to be 5.0). Forget about procps, it is not capable of what you need.

Second: as i tried to explain above, the collection of swap statistics is pretty much useless anyway. You need to look at pageing and i/o activity of the system as a whole.

Regards,
Dominik Kubla
--
Those who can make you believe absurdities can make you commit
atrocities. (Francois Marie Arouet aka Voltaire, 1694-1778)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/