How cdm probe calculates paging activity on a linux based system

Document ID : KB000015727
Last Modified Date : 14/02/2018
Show Technical Document Details
Question:

How cdm probe calculates paging activity on a linux based system

Environment:
UIM 8.4x, 8.5xcdm 5.8x, 6.xx
Answer:

Paging data is found by reading the file “/proc/stat” on older Linux Kernels, and “/proc/vmstat” on newer systems.

Since the data is cumulative the difference since the last data gathering is used as the basis for calculating paging in KB/s .

 

Typical equation that we use in cdm probe for calculating paging activity is 

 

paging_kbps = paging_delta * pagesize / interval

 

                here 

                paging delta        =            paging at time 1 – paging at time 2

                pagesize*            =            the number of kilo bytes in a memory  page           

                interval                =            (time1 - time2)

 

 

*pagesize is calculated using system call getpagesize().  This call gives the number of bytes in a memory page.

  For reference http://man7.org/linux/man-pages/man2/getpagesize.2.html

 

In CDM probe we use “/proc/vmstat” file , for getting paging . 

This file contains pswpin and pswpout parameters among other paramters . paging is sum of values of pswapin and pswapout.

 

So we calculate paging (pswapin+pswapout) at two different time stamps as these values get updated automatically in proc/vmstat file by system itself . 

We find delta between them , then multiply this delta by pagesize(in kb) and finally divide the result by the time difference.  

 

 

Additional Information:

CPU, Disk and Memory probe (cdm) Technical Brief

https://support.ca.com/us/knowledge-base-articles.TEC000003028.html