Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

It would be informative to know in real-time the swap activity (number of reads and writes per minute or similar measure). I intend to use it with conky.

I can gather similar statistics by vmstat or agregate output of iotop. Unfortunately I cannot learn about the activity specifically on each swap device. The swapon command doesn't provide such answer and neither do /proc/swaps.

(I use zram swap, so the moment when swapping occurs is not immediately obvious. And since zram swap makes penalty for cpu I would like to know if it happens when I start long computations. )

share|improve this question

I had to google the answer but the tool you need would be vmstat, example usage:

vmstat 5

Would print out data with updates every 5 seconds, change the 5 to suit to get information on the meaning of the columns of data it prints take a look at the manual page.

man vmstat

In your case it is probably si and so which will be of interest si=swap-ins and so=swap-outs, you can also view some stats including some counters since boot with with -s option.

share|improve this answer
Thank you. +1 for your effort. Unfortunately, AFAIK it doesn't show the swap statistics separately for each device. – Adam Ryczkowski Oct 29 '12 at 15:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.