1821639 Members
3459 Online
109633 Solutions
New Discussion юеВ

Vmstat interpretation

 
SOLVED
Go to solution
Becke
Super Advisor

Vmstat interpretation


Hi Guys,

I'm trying to interpret vmstat output on an AIX machine, I need to know what 'cs' field is really and how it works, what are the numbers underneath the 'cd' field..

Well 'cs' means context switch, but what is a context switch???

2. My other question is underneath the 'fre' field if this field is closer to zero constantly, does that mean we need to add more physical memory????

Thanks Guys
Raf

21 REPLIES 21
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: Vmstat interpretation

Context switch = process switch

Process A is run a little while; then Process B is run a little while; then Process C; then Process A ... each of these is a context switch
If it ain't broke, I can fix that.
Becke
Super Advisor

Re: Vmstat interpretation


Thanks Stephenson for your help and quick response. I have a couple of more queries.
Question 1. If the process is being blocked in the CPU waiting for something, what could the CPU be waiting for? If the CPU is waiting for something then is it still CPU bound??

Question 2. underneath the 'fre' field if this field is closer to zero constantly, does that mean we need to add more physical memory????

Thanks for your help, we have a great team here.

Kind Regards,
Raf
Kent Ostby
Honored Contributor

Re: Vmstat interpretation

Raf -- Take a look at this page regarding AIX and the memory management system:

http://www.unixguide.net/ibm/faq/faq1.300.shtml

Best regards,

Oz
"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"
Becke
Super Advisor

Re: Vmstat interpretation


Thanks for your quick response, I'm doing lot of research and reading documents...

Thanks Guys
Arunvijai_4
Honored Contributor

Re: Vmstat interpretation

Hi Raf,

Some good links about Unix Processes,

http://heather.cs.ucdavis.edu/~matloff/UnixAndC/Unix/Processes.html
http://userpages.umbc.edu/~jack/ifsm498/processes.html

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Becke
Super Advisor

Re: Vmstat interpretation

Thanks Arun
Chauhan Amit
Respected Contributor

Re: Vmstat interpretation

Hi Raf,

Replies are Inline to your questions:

Question 1. If the process is being blocked in the CPU waiting for something, what could the CPU be waiting for? If the CPU is waiting for something then is it still CPU bound??

No . For ex. CPU may be waiting for I/O , In this case it will be I/O Bound.

Question 2. underneath the 'fre' field if this field is closer to zero constantly, does that mean we need to add more physical memory????

Yes . Suggest to Compare this value with other systems having plenty of Memory.

If you are not a part of solution , then you are a part of problem
Muthukumar_5
Honored Contributor

Re: Vmstat interpretation

1) Regarding cs:

cs = context switching.

Switching process in processor resource usage based on priroity. It uses a scheduling method for switching.

2) free field on memory?

Is it free field on memory right. Not fr field on page.

If so,

It is indicating free virtual memory available presently. You can also interpret with sam as,

sam -> performance monitor -> system properties -> memory tab for all activities

--
Muthu
Easy to suggest when don't know about the problem!
Muthukumar_5
Honored Contributor

Re: Vmstat interpretation

To get process based memory and cpu statistics then,


# UNIX95= ps -ef -o sz,vsz,cpu,pcpu,pid,comm

it will give that.

--
Muthu
Easy to suggest when don't know about the problem!
Arunvijai_4
Honored Contributor

Re: Vmstat interpretation

Hello Raf,

You can use #swapinfo -tam.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Darrel Louis
Honored Contributor

Re: Vmstat interpretation

Hi,

If you've Glance on the servers, you use it to analyse why CPU, Disk or Memory usage for a specific process is high.
What is blocking etc.

Darrel
Becke
Super Advisor

Re: Vmstat interpretation


Muthu one more question,

So a context switch is physical thing on CPU or doest context swictch means proceses in processor resource as you said??? and I'm not able to read a lot about it on internet, if you could sched more light on context switch in a bit more detail...and in the vmstat ouput under 'cs' field what those numbers means when they changes, and whether the system is cpu bound or ioound??

Thanks Muthu and everyone for your responses, your info would definitely help, I have also done lot of reading on vmstat, so i can understand better how each field works....



Thanks Guys, I will assign points now...
Arunvijai_4
Honored Contributor

Re: Vmstat interpretation

Hi Raf,

You asked,
So a context switch is physical thing on CPU or doest context swictch means proceses in processor resource as you said??? and I'm not able to read a lot about it on internet, if you could sched more light on context switch in a bit more detail...and in the vmstat ouput under 'cs' field what those numbers means when they changes, and whether the system is cpu bound or ioound??

Yes, It is physical thing related to Processor. Just remember, Unix is a time sharing, multi tasking OS, where all the processes share the same resource like CPU, RAM, etc..

Hope this is clear.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Becke
Super Advisor

Re: Vmstat interpretation

Thanks for your response Arun, do u have any idea when interpretting vmstat ouput, what does this field 'cs'(ie context switch) means, how do u determine whether the system is cpu bound or i/o bound, by looking at the numbers underneath this particular'cs' field.

Thanks for your response
Arunvijai_4
Honored Contributor

Re: Vmstat interpretation

Hi Raf,

A bound CPU is a CPU that is assigned to and handles I/O interrupts for a virtual partition. Every virtual partition must have at least one bound CPU to handle its I/O interrupts.

CPUs that are not assigned to any virtual partition or that are assigned to a virtual partition but do not handle its I/O interrupts are unbound CPUs. Unbound CPUs are sometimes called floater CPUs.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Arunvijai_4
Honored Contributor

Re: Vmstat interpretation

Hi Raf,

Here is a good Wikipedia link,
http://en.wikipedia.org/wiki/Context_switching

It will clear all the doubts you have.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Becke
Super Advisor

Re: Vmstat interpretation

I appreciate your help mate, I'm already doing lot of research on the net and I will look at this site too...

Thanks
Raf
Arunvijai_4
Honored Contributor

Re: Vmstat interpretation

Hi Raf,

You can assign points as well, :-)

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Becke
Super Advisor

Re: Vmstat interpretation


Thanks Arun, I always assign points and in this instance, I have assigned points as well, thanks for reminding me....
Steven E. Protter
Exalted Contributor

Re: Vmstat interpretation

You have covered some really advanced topics here.

The book linked below covers this stuff in an understandable way and in more detail. I recommend it.

http://www.amazon.com/gp/product/0131463969/ref=sr_11_1/002-9020949-4683225?%5Fencoding=UTF8

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Becke
Super Advisor

Re: Vmstat interpretation


Thanks Steven, we have a great team here.

Regards,
Raf