1844445 Members
2906 Online
110233 Solutions
New Discussion

Reduce Primary Swap

 
Mukul_Upadhyaya
Advisor

Reduce Primary Swap

Hi,
I want to know is there a way to reduce the Primary Swap size [/dev/vg00/lvol2] in HPUX 11i. The documentation talks about it but no clear steps are there.

Thanks
Mukul
7 REPLIES 7
James R. Ferguson
Acclaimed Contributor

Re: Reduce Primary Swap

Hi:

Why bother? Disk is cheap and your vg00 should only be the standard HP-UX logical volumes --- no application filesystems.

If you really want to downsize your primary swap, create an Ignite make_recovery_tape image and re-Ignite. Specify an Advanced Installation and size your filesystems (logical volumes) according to your needs.

Regards

...JRF...
Mukul_Upadhyaya
Advisor

Re: Reduce Primary Swap

Hi James,
Thanks for your replay. I understand the logic of disk and memory being cheap. I also understand that re-igniting the system would take care of this issue. However the requirement is to configure the pimary swap/RAM at various sizes to see the impact on performance of application and re-igniting using make_net_recovery or make_tape_recovery seems to be overkill [may be it is the only was :)]. Since this is a vpar instance so managing RAM is not a problem but swap have me puzzled.

Regards
Mukul
James R. Ferguson
Acclaimed Contributor

Re: Reduce Primary Swap

Hi (again) Mukul:

> However the requirement is to configure the pimary swap/RAM at various sizes to see the impact on performance of application

Give this, why not configure additional secondary device swap that can easily be removed after your emperical study?

As for performance, you simply want enough swap space for process reservation purposes. You never want to actually swap since as soon as you do performance begins to suffer! Using 'vmstat', if you begin to see page-outs in double-digits, you are significantly beginning to swap and need to add more memory or reduce the number of processes that you are attempting to run concurrently.

Regards!

...JRF...
Geoff Wild
Honored Contributor

Re: Reduce Primary Swap

In HP-UX, there is no way to reduce swap - live. Primary nor secondary...

You need to either ignite or boot in the lvm maintenance mode, hpux -lm

then, remove the primary swap, and then create a new one of the size you want...

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Don Morris_1
Honored Contributor

Re: Reduce Primary Swap

Well, it still takes a reboot -- but if this is 11i v1 you could get cute with maxswapchunks and swchunk -- the total amount of swap allowed on the system is (maxswapchunks * swchunk * 1Kb) [since disk blocks are 1Kb on every system for some time]. Just do the division to get the total amount of supported swap you want -- the primary will be capped to that value (you don't get the disk space back.. but the system will be limited).

This is harder to do on 11iv2 and later since maxswapchunks is gone and swchunk is held to 2048 as a minimum... so there's really no way to constrict swap below 32Gb.

Personally, though -- I'm in the camp of "What does this really test, anyway?" Limiting swap space will cause your processes to start getting ENOMEM earlier on new virtual object creation/growth. I suppose if you're testing throughput performance and want to see what happens when you can create fewer concurrent processes, throttling this would work... but it seems rather arbitrary.

The simplest solution (as stated by Mr. Ferguson) would be to configure your vPar with the smallest amount of swap you want to test as primary and then use FileSystem swap as Secondary swap as you iterate up to your largest configuration... i.e. X Gb Primary + M * N Gb of Secondary where M is your testing step value and N is whatever's appropriate for how you want to step between configurations. If you're on 11iv3 you could even do the testing without reboots this way (OLA in the new memory, swapon() the increased Secondary Swap). 11iv2 or v1 would need a reboot for the memory, obviously.
Tim Nelson
Honored Contributor

Re: Reduce Primary Swap

Mukul,

As mentioned performance with regards to swapspace only comes into play if you are actually paging out to swap because you ran out of physical memory. If swapping occurs then generically your performance will be poor. If you are looking for a level of poor I guess it would be a legitimate question. My experience is that poor is poor and completely unacceptable in most environments.

You should at a minium have at least as much primary+secondary swap = physicall memeory. You can plan games with considering psuedo swap but eventually you will be back in the same place.



A. Clay Stephenson
Acclaimed Contributor

Re: Reduce Primary Swap

The ONLY thing that distinguishes primary swap from any other swap is the priority --- which is hard set to 1 for primary swap.

You can assign secondary swap at priority 0 and primary swap won't be used at all as long as there is enough priority 0 swap. You can assign additional priority 1 swap and it will be interleaved at equal priority with all other priority 1 swap including primary swap. In short, all of your tests can be done using secondary swap if you set the appropriate priorities.

The bottom line is that you really shouldn't be doing this at all especially if performance is your goal for the simple reason that if you are swapping to any significant degree to any type of swap (with the possible exception of a solid-state disk) then you are taking about a 100x performance hit. All of your tweaking with choosing swap layouts and priorities might change that 100x to 98x or 102x. It's still very bad. The real goal is to not to swap at all. I always say that worrying about swap layout on modern UNIX boxes is akin to rearranging the deck chairs on the Titanic.
If it ain't broke, I can fix that.