Operating System - HP-UX
1833815 Members
2447 Online
110063 Solutions
New Discussion

what options I should use on the command swapinfo

 
Hanry Zhou
Super Advisor

what options I should use on the command swapinfo

Hi,

I have to commands, and got two different results as following:
swapinfo -dftr
Kb Kb Kb PCT START/ Kb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 1048576 0 1048576 0% 0 - 1 /dev/vg00/lvol2
reserve - 1035712 -1035712
total 1048576 1035712 12864 99% - 0 -

swapinfo -tam
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 1024 0 1024 0% 0 - 1 /dev/vg00/lvol2
reserve - 1011 -1011
memory 4448 2904 1544 65%
total 5472 3915 1557 72% - 0 -

I understand each indivitual option, and it's meaning, but what I don't understand is

1. how come I got two different value on total usage of the swap, one is 99% and another is 72%?

2. under what cicumstance I should use these two different commands, respectively?

thanks,
none
5 REPLIES 5
A. Clay Stephenson
Acclaimed Contributor

Re: what options I should use on the command swapinfo

1) Because one command includes the psedoswap (memory) and the other does not.

2) I would use -tam in every case because that gives you a "truer" picture of what's really going on.

In general, as long as no filesystem or device swap is being used then you are fine. If they are being used then use vmstat -v and look at the po (pageout) column. If that value is small (<10) then you are still fine. If pageouts are > 10 for any significant period of time then the system is feeling memory pressure.
If it ain't broke, I can fix that.
Sridhar Bhaskarla
Honored Contributor

Re: what options I should use on the command swapinfo

Hi Hanry,

'swapinfo -dftr' and 'swapinfo -ta' will coincide if the kernel parameter 'swapmem_on' is not turned on. swapinfo -dftr won't display information about pseudoswap - the memory line in swapinfo -ta output.

I use 'swapinfo -dft' (not r) to see the pageouts. If you see any non-zero value under the KB used column in the above output, it means the system paged out. It could be due to memory pressure or memory mapped files.

'swapinfo -ta' (m is to see the values in MB) is useful in determining the swap usage. Nearing 100% in total indicates that you are short on virtual memory and at 100%, you will not be able to bring up more processes.

One thing that can be noted from the differences of the above is that you would have run out of your swap space by now if you didn't turn on the pseudoswap.

-Sri


You may be disappointed if you fail, but you are doomed if you don't try
Sundar_7
Honored Contributor

Re: what options I should use on the command swapinfo

I dont think I can add anything more than what Clay has said.

you will see both swapinfo -dftr and swapinfo -tam are identical in systems that have pseudo swap disabled.

memory swap is enabled by default using the kernel parameter swapmem_on. So I prefer using swapinfo -mt.
Learn What to do ,How to do and more importantly When to do ?
Hanry Zhou
Super Advisor

Re: what options I should use on the command swapinfo

yeah, I know one(-dtrf) doesn't displays pseudoswap info, and another (-tam) displays pseudoswap info, but what exactly causes the difference of 99% and 72%.

since the device swap util is 0%, so I expect the result of these two commands should be reversed as showed.

What is "reserve" space?
none
Sundar_7
Honored Contributor

Re: what options I should use on the command swapinfo

Unless you have lazy swap allocation attribute set for a binary, any proces that is created will reserve the swap space even if it is not required at the moment the process is started. This ensures the process will not run out of swap space when it is required.

total column only counts the swap space avail/used/free from the swap devices that falls in to the category you have chosen to display.

-dftr - selects only device and filesystem swap and thus the TOTAL colum counts only the swap space available from device and filesystem swap - 99% of your device swap seem to be reserved by the processes runnign in the system.

Learn What to do ,How to do and more importantly When to do ?