0

Is it possible to find (or derive) the amount of data swapped in our out per second from information contained in the /proc filesystem? I'd like to get something like what vmstat provides in its si/so columns.

I've looked in /proc/meminfo, /proc/stat, and a handful of other locations but haven't seen anything promising.

  • I think sar gets this information from the pswpin and pswpout fields in the /proc/vmstat file. – Bratchley Apr 14 '15 at 1:50
  • It's a cumulative count but that just means you need to do some periodic sampling and some arithmetic to get the data down to a time interval. – Bratchley Apr 14 '15 at 1:52
  • @Bratchley this seems to be what I'm looking for. If you submit your comment as an answer I will accept it. – Travis Bear Apr 14 '15 at 3:09
1

I think sar gets this information from the pswpin and pswpout fields in the /proc/vmstat file. It's a cumulative count but that just means you need to do some periodic sampling and some arithmetic to get the data down to a time interval.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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