1834827 Members
2752 Online
110070 Solutions
New Discussion

swapinfo output

 
SOLVED
Go to solution
Sagar Sirdesai
Trusted Contributor

swapinfo output

Hi All,
I get very Confused whenever I see the output of swapinfo command

Till now what I understand about Memory Allocation is when I have swapmem_on =1 .
Then .75 RAM + swap device will be my swap space.

But when I execute swapinfo command.. Isee my swap space from disk is not used anfd RAM is about 93 % full ..

Server:/root >swapinfo -tam
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 4096 0 4096 0% 0 - 1 /dev/vg00/lvol2
dev 1536 0 1536 0% 0 - 1 /dev/vg01/lvol28
reserve - 5632 -5632
memory 19407 18070 1337 93%
total 25039 23702 1337 95% - 0 -

Also what does the Reserve Line Tell us ..I am Unable to understand this.
Please suggest

Regards

Sagar
13 REPLIES 13
Pete Randall
Outstanding Contributor

Re: swapinfo output

Before HP-UX spawns a process, it reserves suffient swap space for that process - that is what the reserve line is showing you. The reason you're seeing 93% memory utilization and no swap activity is because you've turned on pseudo-swap with your swapmem_on=1. This means that HP-UX will use memory instead of swap space when possible. This is quite common in today's large memory systems.


Pete

Pete
Sagar Sirdesai
Trusted Contributor

Re: swapinfo output

Hi Pete,

Please correct me if I am wrong.
What I understand is Whenever HP-UX spwans a process it does not reserve swap space but checks whether it has ecnough space to swap this process in case it is required .
This check done using a counter ..
And it decrements this swap counter by the amount of size of process to be started .So if we have 5 Gb of swap defined on the disk .and if swapmem_on is not enabled Then I can run only 5Gb of processes in the RAM even though I have more RAM installed on the system

Correct me if I am sounding confused
Biswajit Tripathy
Honored Contributor

Re: swapinfo output

Swapinfo fully explained:
ftp://eh:spear9@hprc.external.hp.com/memory.htm

- Biswajit
:-)
Sagar Sirdesai
Trusted Contributor

Re: swapinfo output

Hi Guys,
After Reading the comments.

I have a few queries
For the swapinfo output whihc i have posted this tells us that ..My entire swap space from the disk is reserved but it is not used till now i.e no process have swaped to it.

Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 4096 0 4096 0% 0 - 1 /dev/vg00/lvol2
dev 1536 0 1536 0% 0 - 1 /dev/vg01/lvol28
reserve - 5632 -5632
memory 19407 18070 1337 93%
total 25039 23702 1337 95% - 0 -

Then when will the processes be swapped ???

Regards

Sagar
Cem Tugrul
Esteemed Contributor
Solution

Re: swapinfo output

Sagar;

Please have a look of my attachment.

good luck,
Our greatest duty in this life is to help others. And please, if you can't
Patrick Wallek
Honored Contributor

Re: swapinfo output

Processes are paged out to disk when you run out of RAM.

You currently have about 5.5GB of device swap space, none of which is being actively used.

You have about 19GB of pseudo-swap space due to swapmem_on being set to 1. Of that 19GB, about 18GB has been reserved by processes.

This looks like a pretty good configuration to me.
Kent Ostby
Honored Contributor

Re: swapinfo output

Essentially, ALL of your disk swap space has been reserved and is unusable.

I would question whether or not you have enough disk swap space for this configuration.

In general, you should have 2 x RAM in swap space for most system configurations.

However, if your system is running fine under it's current configuration then you, obviously, are set for the current time. The only issue would be if you anticipate a load increase of any type. If so, you may wish to increase your disk swap space.
"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"
D Block 2
Respected Contributor

Re: swapinfo output

Sagar,

might I suggest further Readings on this difficult-subject in book: HP-UX 11i Internals, by Chris Cooper & Chris Moore. Prentice Hall ISBN 0-13-032861-8.

Goes into examples of why hp-ux is configured with Pseudo-Swap turned-on, and performance gains.

Tom
Golf is a Good Walk Spoiled, Mark Twain.
Sagar Sirdesai
Trusted Contributor

Re: swapinfo output

Hi All.
CEM: After Reading your Document it says for 3/4th of the memory there will be noswap reservation..
But actually for a system it can only use 3/4th of the memory since rest is used by Kernel for its purpose.......

Also consider I have 4GB of disk swap and 4GB of RAM ...Then as per the document 3/4th of RAM(4GB) is 3GB there will be no swap reservation. SO this means only 1 GB of my swdisk swap will be used .....

GUYS : Below is output swapifo -tam in one my rpp3440 .
Here as you see my swap disk not being entirely used even though the memory is completely used. I was expecting the system to swap processes to swap device and used it entirely ..But here even though disk swap is free space. my memory is 100 % utilised..

Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 4096 495 3601 12% 0 - 1 /dev/vg00/lvol2
reserve - 3601 -3601
memory 2480 2477 3 100%
total 6576 6573 3 100% - 0 -

Please suggest ..
Regards

Sagar
Sagar Sirdesai
Trusted Contributor

Re: swapinfo output

Hi Guys
Sorry for asking so many queries.
But I cant Help it as I have so many HP-UX Servers. Every MAchine is giving me this errors..

If I refer the document sent by CEM..
Which says for 3/4ths of my memory there will be no swap reservation..

Then a process should never fail with the error "out of swap".Since the process will never be reserved with swap space..

Also Adding to my previous posted message wherein I showed the swapinfo -tam command output ..

Even though my swap space i reserved completely It is only used 10 % ..

So when memory is apporaching 100 % usage. Why is the process with reserved swap space not paged out to the swap device where it has reserved space allocated...

Please help
D Block 2
Respected Contributor

Re: swapinfo output

Sagar, a quote here from the HP-UX 11i internals book (pick a copy):

p. 195 "you have maximized your physical
memory, but your processes simply want more!
It's easy: configure the amount of swap your processes need. In this scenario, we recommend that you leave pseudo-swap DISABLED, as you would really prefer to have device swap fulfill the system's pagain requirements.

also, please start Assigning Points the your responses (high or low). Please !!

Golf is a Good Walk Spoiled, Mark Twain.
Patrick Wallek
Honored Contributor

Re: swapinfo output

I think you misunderstand exactly how swap space is used.

Say you have a machine with 4GB of RAM. You start enough programs to use that 4GB of RAM so you have no room to start new processes. Now you start 1 more process that needs 50MB of RAM. HP-UX will page-out just enough processes to give the new process the amount of RAM it needs (50 MB).

So at this point, if you did a 'swapinfo -tam' you would likely see that you device swap has 50 MB used. That's all.

HP-UX does *NOT* page-out the ENTIRE contents of RAM. You will only ever see the device swap used if HP-UX actually *HAS* to page some processes out to disk.

Hopefully you will never see your device swap 100% used. That would not be good.
Sagar Sirdesai
Trusted Contributor

Re: swapinfo output

Hi Patrick..
So This MEans
Out of Memory and Out Of Swap Error both Occur when main memory (RAM) is completely used..

Regards

Sagar