0

I needed information on the following:

Can you please tell me the inference for the following in terms of high, low, negative and constant values from pidstat command in Linux.

kB_rd/s, kB_wr/s, kB_ccwr/s, VSZ, RSS, cswch/s, nvcswch/s and Memory.

Any directions towards relevant source of information will also be helpful.

1

From the man page of pidstat:

kB_rd/s

Number of kilobytes the task has caused to be read from disk per second. This defines how many kB has the process read per second. You can identify how many kB is being read by the process. More active the process reading large or several files in your disk, the higher the value.

kB_wr/s

Number of kilobytes the task has caused, or shall cause to be written to disk per second. This defines how many kB has the process wrote per second. You can identify how many kB is being wrote by the process. More active the process writing large or several files in your disk, the higher the value.

kB_ccwr/s

Number of kilobytes whose writing to disk has been cancelled by the task. This may occur when the task truncates some dirty pagecache. In this case, some IO which another task has been accounted for will not be happening. Self explanatory.

VSZ

Virtual Size: The virtual memory usage of entire task in kilobytes. Depending of the program, this value may be high or low. Process are allocated virtual memory while running. More info about Virtual Memory

RSS

Resident Set Size: The non-swapped physical memory used by the task in kilobytes. Amount of physical memory (RAM) used.

cswch/s

Total number of voluntary context switches the task made per second. A voluntary context switch occurs when a task blocks because it requires a resource that is unavailable. Or said in other terms, the system had no resources available when the process asked for them (can be I/O, Memory, CPU, etc.)

nvcswch/s

Total number of non voluntary context switches the task made per second. A involuntary context switch takes place when a task executes for the duration of its time slice and then is forced to relinquish the processor. Same as above, just that the process was forced to stop it's execution while running. Ex.: This can happens when a process with higher priority starts nagging for resources while normal priority ones are running.

I didn't found any specific information about 'Memory' like previous values, but the -r switch shows "page faults and memory utilization". None of the values should be in negative (at least not as they are defined).

pidstat is extremely useful, when you like to monitor the behavior of different process in an specific time and condition (like a snapshot), but for continuous monitoring other tools like top are more advisable.

The pidstat man page.

  • Am very glad at the answer Braiam. I used pidstat as it gave me more information than top. But what does it mean if I get -1 value for kB reads/s, kB writes/s, kB canceled wr/s for all three. – Subiah R Nagarajan Jul 23 '13 at 10:27
  • @SubiahRNagarajan the only guess I have is, that your kernel is older then 2.6.20, hence it doesn't support the -d switch – Braiam Jul 23 '13 at 10:31
  • My linux kernel version is 2.6.32-358.2.1.el6.x86_64 So what do you think would be the reason for me to get -1 value for both kb_rd/s kb_wr/s and kb_ccwr/s. – Subiah R Nagarajan Jul 24 '13 at 3:32
  • Check if your kernel was compiled with CONFIG_TASK_IO_ACCOUNTING option activated. If not, that's another guess. Use this nice answer to find out. – Braiam Jul 24 '13 at 4:14
  • I am checking it, will get back to you soon. – Subiah R Nagarajan Jul 24 '13 at 6:38

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.