Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

1 Answer 1

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

 
discard

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.