1826490 Members
3630 Online
109692 Solutions
New Discussion

Regarding swap space

 
SOLVED
Go to solution
Kavita Poonia
Regular Advisor

Regarding swap space

If I have a 8 Gb of physical memory then how much should be my swap memory.
23 REPLIES 23
Mridul Shrivastava
Honored Contributor
Solution

Re: Regarding swap space

SWAP thumb rules is 2 times of mem, however in your case I don't think that that much space is really required. You could keep swap space of around 4 GB and that should be enough.

Have a look at the following thread to get more views:

http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=855513
Time has a wonderful way of weeding out the trivial
Kavita Poonia
Regular Advisor

Re: Regarding swap space

Hi Mridul,

Thanks a lot for your reply but I do not why apart from having so much memory, the swap space is 96% utilized and we need to extend it. Is extension of swap space will be the final solution for this ?

Please find the attached text file giving full details of swap space utilization.

Please suggest what needs to be done.

Thanks a lot !
Mridul Shrivastava
Honored Contributor

Re: Regarding swap space

Its not utilizing the swap space properly, rahter it is using physical memory. It seems that pseudo-swap is enabled on ur system.
Have a look at the following thread for more detail explanation on swapinfo output and the kernel parameter for disabling the pseudo swap.

http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1198658
Time has a wonderful way of weeding out the trivial
Patrick Wallek
Honored Contributor

Re: Regarding swap space

Judging from your swapinfo & vmstat output, it appears that you need more RAM.

The fact that your device swap is used fairly extensively and that your single line of vmstat shows some page outs (po column) is indicative of you having too little RAM.

Use vmstat to monitor the 'po' column for a longer period of time rather than just the single line output.

Also, if you have glance take a look at what processes are using RAM and see if some can be stopped or if usage can be scaled back.

If vmstat shows lots of po's, into the double digits in value, then your system performance will suffer greatly since more work is being done for po's than for real work.

Now is the time to start considering more RAM.
Kavita Poonia
Regular Advisor

Re: Regarding swap space

Thanks a lot Mridul but the link provided by you is not opening.


Thanks a lot Patrick !
Then you mean to say that I should increase my physical memory rather than swap memory. Can you please tell me how much total swap memory I have presently configured by looking to my attached text file. I think it is approx. 13 Gb.
Mridul Shrivastava
Honored Contributor

Re: Regarding swap space

You have 7.5 GB of swap space configured and there are 3 lvols configured as the swap space, details are as follows:

Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 4096 1649 2447 40% 0 - 1 /dev/vg00/lvol2
dev 1500 1470 30 98% 0 - 1 /dev/vg00/lvswap1
dev 2000 1614 386 81% 0 - 1 /dev/vg00/lvswap2

I am able to open the link , can you try opening it again ?
Time has a wonderful way of weeding out the trivial
Dennis Handly
Acclaimed Contributor

Re: Regarding swap space

>Mridul: however in your case I don't think that that much space is really required. You could keep swap space of around 4 GB and that should be enough.

It's required because total swap usage is 93%.

>but the link provided by you is not opening.

I have no problems with either of Mridul's links.

>Then you mean to say that I should increase my physical memory rather than swap memory.

As mentioned by Patrick, you want to increase RAM for performance reasons.

>Can you please tell me how much total swap memory I have presently configured by looking to my attached text file. I think it is approx. 13 Gb.

Yes, you have a total of 13 Gb of swap.
And as Mridul says, you have 7.5 GB of device swap.
If you are currently running out of swapspace all of the time, you need more device swap. Then you can measure the performance.
Mridul Shrivastava
Honored Contributor

Re: Regarding swap space

Dennis,

It means that RAM is also used as the swap and 5.5 GB is being used. Don't you think that disabling the pseudo swap and increasing the device swap will help ??

That's what I was trying to say here that disable the pseudo swap and utilise the device swap as much as possible.

Please correct me if I am wrong.

Thanks in Advance.

Regards,
Mridul
Time has a wonderful way of weeding out the trivial
Kavita Poonia
Regular Advisor

Re: Regarding swap space

Thanks Mridul. The links are openning now and I have gone through the threads. What I can make out from them is how much swap space I should configure is all depend on number of processes and all.


Thanks a lot Dennis. Then according to you I should increase RAM and swap space both or should I kill some processes to make some space in memory. Please suggest what can be done.

And why should I disable pseudo space. Can't both pseudo space and device swap utilized parallelly. Like once my device swap is utilized fully then psuedo space will provide necessary memory space.
Mridul Shrivastava
Honored Contributor

Re: Regarding swap space

The only thing I kept in mind while asking to disable pseudo swap is to have free memory as much as we can, it may improve system performace.

Anyways I am not quite sure about that, this is the reason I have asked Dennis to clarify the same.
Time has a wonderful way of weeding out the trivial
Bill Hassell
Honored Contributor

Re: Regarding swap space

> The only thing I kept in mind while asking to disable pseudo swap is to have free memory as much as we can, it may improve system performace.

The explanation of pseudo swap has been very confusing with explanations stating that RAM is used as swap space. This is completely inaccurate and would make no sense. Pseudo swap is a bookeeping technique in the kernel that allows up to 75% of process space to run without a corresponding reserve area in swap. Pseudo swap takes no space in RAM, ever. That's why the option has been removed at 11.31 -- it works quite well and there is no advantage to turning it off.


Bill Hassell, sysadmin
Dennis Handly
Acclaimed Contributor

Re: Regarding swap space

>Mridul: Don't you think that disabling the pseudo swap and increasing the device swap will help??

No, only adding device swap. That's probably why you can't turn off pseudo swap on 11.31 anymore.

>>Mridul: That's what I was trying to say here that disable the pseudo swap and utilise the device swap as much as possible.

The first part wasn't clear at all and I doubt that part will help. swapmem_on(5) says:
http://docs.hp.com/en/B3921-60631/swapmem_on.5.html
... turning this feature off really does not gain the system anything.

>Then according to you I should increase RAM and swap space both or should I kill some processes to make some space in memory.

What are your file cache parms, dbc_max_pct, dbc_min_pct? Having large values here isn't a good idea if you are running oracle with large SGAs.

You increase RAM if you can afford to do it. Especially if adding more swap space slows things down. Obviously not running so many piggy processes will help. But that requires moving the applications elsewhere or scheduling them for off peak times.

>And why should I disable pseudo space? Can't both pseudo space and device swap be utilized. Like once my device swap is utilized fully then pseudo space will provide necessary memory space.

Exactly. Except you want it to use pseudo swap before device swap.
Yogeeraj_1
Honored Contributor

Re: Regarding swap space

hi Kavita,

Until you find more physical memory to upgrade your server, you may look into tuning your database. Just in case you have done an overkill at your SGA level.

I am assuming that you are running an Oracle database. Depending on your version, you can run the OEM database control to look into your database performance and resource utilisation very easily..

just a few thoughts

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Sajjad Sahir
Honored Contributor

Re: Regarding swap space

Dear Kavitha
in simple words
swap should twice than u physical memory
physical memory means total
memory installed in u system.

thanks and regards

Sajjad
Venkatesh BL
Honored Contributor

Re: Regarding swap space

Check this official white paper: http://docs.hp.com/en/1219/tuningwp.html#swapneed
Rasheed Tamton
Honored Contributor

Re: Regarding swap space

The oracle is not taking much memory. Most of the mem is used by your application - I guess it is SAP R 3.

Also, on the vmstat output there is no pageouts, though it is only one iterance. Adding an additonal swap will give you a temporary solution if you cant buy more mem now but are you sure your application is fine tuned well.

Can you post the footer of glance -m output.
What we are interested is to know your
Sys Mem and User Mem usage.

Rgds.
Kavita Poonia
Regular Advisor

Re: Regarding swap space

Thank you all. All replies were really helpful.

Yes Yogeeraj, we are running oracle databases on the server but have not done an overkill at SGA level.


Yes Rasheed, lots of SAP application instances are running on the server but I am not sure whether applications are tuned well

Providing you the Glance -m output in the attached text file.


Thanks a lot !
Dennis Handly
Acclaimed Contributor

Re: Regarding swap space

>Providing you the Glance -m output in the attached text file.

I see no page outs. So it seems you should just add more swap space and then remeasure under the new load.
Kavita Poonia
Regular Advisor

Re: Regarding swap space

Hi Dennis,

We have dbc_max_pct=8 and dbc_min_pct=5 on the server.
Safarali
Valued Contributor

Re: Regarding swap space

Hi Kavita
2.5 times Swap concept is old concept we exprience some SAP R3 process consume more swap space it may be because of improper configuration and tuning

it can be monitored by stoping and restart sap then you can decide whether you need extra swap,
SAP file system in HP is totally different with SUN in SUN you can make file system for each instance but in HP one logical volume is for many dirctory like archive files oracle files etc. it will improve more performance

Regards
Safar
Rasheed Tamton
Honored Contributor

Re: Regarding swap space

Kavita,

Total VM : 5.50gb Sys Mem : 375.1mb User Mem: 7.02gb Phys Mem: 8.00gb
Active VM: 2.15gb Buf Cache: 519.7mb Free Mem: 106.2mb

From your glance output, it is clear that the User processes are consuming almost all your mem (7.02gb out of 8gb). There is not much to do now. Either add more mem (if you feel your SAP is well tuned enough) or add swap as a temporary resolution and consider adding phy mem by looking the metrics on a regular basis.

Your Buf Cache, dbc_max_pct & dbc_min_pct seems to be ok.

Reg. SAP, just consider Safar's suggestion about the difference between Solaris and HP-UX. There is a possibility the folks who configured SAP might have been more familiar with Solaris than HP-UX and they did the configuration as per the Solaris way. Each of your SAP process is taking around 134 MB.

Rgds.
Mridul Shrivastava
Honored Contributor

Re: Regarding swap space

I think you can change these parameters value. Have a look at the following thread and read Fred Ruffet answer, very good explanation:

http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=750342
Time has a wonderful way of weeding out the trivial
Kavita Poonia
Regular Advisor

Re: Regarding swap space

Thanks a lot Safarali, Rasheed and Mridul.

Mridul ur link was really helpful and Rasheed's and Safarali's comment too.