1748219 Members
4686 Online
108759 Solutions
New Discussion юеВ

Re: Swapinfo

 
sen_ux
Valued Contributor

Swapinfo

Can someone explain how the swap usage is 88% from the below command o/p.

$ swapinfo -tam
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 40960 0 40960 0% 0 - 1 /dev/vg00/lvol2
dev 40960 307 40653 1% 0 - 0 /dev/vg00/lvol13
dev 17408 0 17408 0% 0 - 1 /dev/vg00/lvol14
reserve - 86965 -86965
total 99328 87272 12056 88% - 0 -
$

Especially on the reserve.
From where it is getting reserved.? If it is from any of the dev swap, why the usage is not showing there.?

thanks
sen
10 REPLIES 10
Viveki
Trusted Contributor

Re: Swapinfo

As per swapinfo man pages, 'reserve' is the amount of paging space that could be needed by processes that are currently running, but that has not yet been allocated from one of the paging areas.

For device paging areas, this value is always ``├в ''. For file system paging areas, this value is the number of 1-Kbyte blocks reserved for file system use by ordinary users, the same as the reserve value given to swapon.

It is from the dev swap specified. When a process is created, or requests additional space, space is reserved for it by increasing the space shown on the reserve line. When paging activity actually occurs, space is used in one of the paging areas (the one with the lowest priority number that has free space available, already allocated), and that space will be shown as used in that area
Michael Steele_2
Honored Contributor

Re: Swapinfo

Hi

( 40960 + 40960 + 17408 ) / 87272
( 99328 ) / 87272
88%

You only use device swap to calculate the totals.

You ignore reserve swap because it is also known as Pseudo swap, or, swap reserved within device swap for every application and process startup.

See attached or link
"Copyrighted document deleted"
C:\Users\MFS\Documents\HP-UX\Understanding HP-UX swap reservation and allocation.htm
Support Fatherhood - Stop Family Law
sen_ux
Valued Contributor

Re: Swapinfo

Hi Michael,

PCT USED is 88%, which is calculated including 'reserve'. Psuedo swap is part of memory and this reserve is from the swap device itself. Correct me if i m wrong.And i think that can not be ignored. If I need more swap space, i can use only 12% remaining.?
Does the above output show that configured swap space is less.?

Thanks
Michael Steele_2
Honored Contributor

Re: Swapinfo

Hi

"...reserve swap because it is also known as Pseudo swap, or, swap reserved within device swap..."

within device swap

So you'd be counting it twice if you used your formula.

Read the attachement.
Support Fatherhood - Stop Family Law
Emil Velez
Honored Contributor

Re: Swapinfo


You are barely using any swap. It looks like you have 92 GB of memory on the system and at some time you filled up memory and did some paging since you used a little space 300MB on your priority 0 device swap. Evidently there is no paging pressure now and those processes that paged out pages are still running since they did not release the swap space.

Bottom line you are not using much real swap right now. It seems like you are using all of your memory.

Ignore the reserve line or memory line since that is based on pseudo swap. There are a myriad of documents that describe pseudo swap. I suggest that you read them for clarification.

GOod luck.

Michael Steele_2
Honored Contributor

Re: Swapinfo

Hi and Uhhh,

Please disregard the above comment, you are using

AVAIL USED FREE
99328 87272 12056 -or- 88% capcity ...

...and ALMOST OUT OF SWAP - IN FACT, YOU SHOULD ADD SOME RIGHT AWAY
Support Fatherhood - Stop Family Law
Michael Steele_2
Honored Contributor

Re: Swapinfo

Emil

you need to take a class about swap and paging. you should not be answering questions about either
Support Fatherhood - Stop Family Law
Dennis Handly
Acclaimed Contributor

Re: Swapinfo

The first thing you should do is to enable pseudo swap. This will allow most of memory to be included in the swap total. I assume this may be 50 Gb or more? See swapmem_on(5).

>Can someone explain how the swap usage is 88% from the below command

Obviously it is 87 Gb / 99 Gb. :-)
The total is the sum of the device swap and pseudo swap.
The amount used is the sum of the device used (307) + reserved and pseudo swap used.

>PCT USED is 88%, which is calculated including reserve.

Right.

>Pseudo swap is part of memory

Yes but you haven't enabled pseudo swap.

>If I need more swap space, I can use only 12% remaining?

Yes, unless you add more swap space. Or enable swapmem_on(5).

>Michael: 87272 / (40960 + 40960 + 17408)

I assume the total is obvious but sen_ux wants to know how to compute the 87 Gb?

You also need to consider pseudo swap, which is 0 in this misconfigured system.

>You ignore reserve swap because it is also known as Pseudo swap

No you don't. This is part of the total used. And it isn't pseudo swap.

>swap reserved within device swap for every application and process startup.

This fragment is correct.

>Emil: Ignore the reserve line or memory line since that is based on pseudo swap.

(You need to punctuate this better, otherwise you can read it wrong.)

You can't ignore either, you have to understand what each means. The simplest is to only look at the total.

>Michael: you need to take a class about swap and paging

You have made some misstatements too.