1830565 Members
4981 Online
110014 Solutions
New Discussion

Re: vmstat - sar

 
jay_40
Occasional Contributor

vmstat - sar

Hi all,

What's difference between sar -q (field runq-sz)and vmstat (field r ).

Thank you
2 REPLIES 2
John Palmer
Honored Contributor

Re: vmstat - sar

sar reports the average length of the run queue over the interval whereas vmstat reports the length of the queue when the snapshot is taken. Hence vmstat's output is an integer whereas sar's is to one decimal place.

Regards,
John
Stefan Farrelly
Honored Contributor

Re: vmstat - sar


The vmstat field r is the number of processes actually heavily using a single cpu at the time. eg. on a 4 cpu server if you say have 3 large oracle db processes running - each will use a single cpu (say using 90%+ of each cpu) then vmstat shows 3 processes in the run q (one runing on each of 3 cpu's). If the 4th cpu gets used also this value could jump to 4 but I dont think it could ever go over 4 (the max number of cpu's on the server).

sar -q (runq-sz) is the number of processes backed up or in the global queue (all cpu's). Its more of a global metric (than vmstat above). The ideal is a run queue length of 1 per cpu - so on a 4 cpu server any runq up to 4 is fine. Uptime also reports runq length but over different time periods so its a bit better.
Im from Palmerston North, New Zealand, but somehow ended up in London...