Operating System - HP-UX
1834055 Members
2366 Online
110063 Solutions
New Discussion

Swap Filesystem Adding Need Reboot?

 
SOLVED
Go to solution
Steven Chen_1
Super Advisor

Swap Filesystem Adding Need Reboot?

Hello,

We have 2G memory and 2G device swap space. Due to shortage of swap space at peak time, we add one filesystem as swap. Though we make it as priority 1 as device swap, I do not see it ever been used.

My question is: are device swaps always used first, or do we have to reboot it after adding a filesystem swap? (we have not reboot it).

The followings are the file status:

-------------------
#glance

Swap Device Type Avail Used Priority
--------------------------------------------------------------------------------
/dev/vg00/lvol2 device 1.0gb 19mb 1
/dev/vg01/lvol1 device 1000mb 19mb 1
/disk5/paging filesys 2.0gb 0mb 1
pseudo-swap memory 1.5gb 369mb na


*********************************************************************


#swapinfo -at

Kb Kb Kb PCT START/ Kb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 1048576 19404 1029172 2% 0 - 1 /dev/vg00/lvol2
dev 1024000 19944 1004056 2% 0 - 1 /dev/vg01/lvol1
localfs 2048000 0 2048000 0% 2048000 0 1 /disk5/paging

reserve - 1517120 -1517120
memory 1607044 367712 1239332 23%
total 5727620 1924180 3803440 34% - 0 -

--------------------

Thanks a lot.

Steven
Steve
9 REPLIES 9
James R. Ferguson
Acclaimed Contributor
Solution

Re: Swap Filesystem Adding Need Reboot?

Hi Steven:

No, no reboot is required. From the man pages for 'swapon (1M)' you can note that "under most
circumstances, space is taken from device paging areas before file system paging areas, regardless of priority."

Regards!

...JRF...
Peter Kloetgen
Esteemed Contributor

Re: Swap Filesystem Adding Need Reboot?

Hi Steven,

you need also a Kernel parameter get changed to get your swap to work:

max_swap_chunks

For your whole swapspace this parameter is set to swapspace in MB / 2. So if you have 1024 MB swapspace the parameter must have the value 512. You have to increase this parameter, simply use SAM for it. Then you need a reboot and it works. ( new kernel is created )

*never* give a file system swap area the same priority then primary/device swap, because it is very slow!!!

Allways stay on the bright side of life!

Peter

I'm learning here as well as helping
Craig Rants
Honored Contributor

Re: Swap Filesystem Adding Need Reboot?

Steven,
You only need to reboot when you remove swap, from the looks of your swapinfo command you should be ok.

GL,
C
"In theory, there is no difference between theory and practice. But, in practice, there is. " Jan L.A. van de Snepscheut
steven Burgess_2
Honored Contributor

Re: Swap Filesystem Adding Need Reboot?

Steven

The highest priority for swap space is 0. If there are more than one swap area in the system, the swap space having the highest priority is used.

Device swap is more efficent than filesystem swap

If 2 or more swap areas have the same priority , these are used in round robin fashion.

If a filesystem swap and a device swap area have the same priority , preference goes to the device swap area.

You do not have to reboot your system for swap space to become immediately available the swapon command takes care of this

HTH

Steve

take your time and think things through
PIYUSH D. PATEL
Honored Contributor

Re: Swap Filesystem Adding Need Reboot?

Hi,

You can issue a swapon command to enable the swap.

You dont have to reboot the system for enabling the swap.

If you want to disable the swap then only you will have to reboot the system so that the changes will take effect.

Piyush
PIYUSH D. PATEL
Honored Contributor

Re: Swap Filesystem Adding Need Reboot?

Hi,

0 priority is higher then priority - 1. But always device swap is used before filesystem swap.

Piyush
Bill Hassell
Honored Contributor

Re: Swap Filesystem Adding Need Reboot?

Are you really running out of device swap at peak times? Use swapinfo -atm to show the results as above. BOTH devices should be in the 80-90% range before you see any filesystem swapping taking place. BTW: when you add the filesystem swap using swapon, it will notify you if you do not have enough maxswapchunks available. It will add what it can but will also leave a recommendation.

Filesystem swap disappears after a reboot unless you add it to /etc/fstab.

So, if yuor swapinfo does not show most of both device swap areas used and you are having memory problems, it is very likely due to 32bit program limits, especially with massive programs like Oracle. Shared memory conflicts is the likely culprit, along with maxdsiz and SHARED/EXEC MAGIC executable status.


Bill Hassell, sysadmin
Steven Chen_1
Super Advisor

Re: Swap Filesystem Adding Need Reboot?

Bill and All,

Thank you and all the other's decent and quick helps!

I would like to consult with all gurus about the maxdsiz:

I upgraded memory from 1G to 2G quite a while ago and the maxdsize has been in the parameter of following with no change since I use 1G memoery:
(I am using hpux 11i 64 bit)

------------
maxdsiz 1073741824 1073741824 Static N/A Max Data Segment Size For 32-bit Processes (Bytes)
maxdsiz_64bit 1073741824 1073741824 Static N/A Max Data Segment Size For 64-bit Processes

------------

Would that have to match 2G memory parameter?

On the second thought, I would like to post my kernel file for comments.

Please help and all assistance will be greatly appreciated.

Steven

Steve
Bill Hassell
Honored Contributor

Re: Swap Filesystem Adding Need Reboot?

maxdsiz (and the others: maxtsiz and maxssiz and their 64-bit versions) are strictly fences. They prevent run away programs from consuming massive amounts of memory. If you do not write and compile your own programs, then the safety feature is of no interest. You make maxdsiz large enough to allow a program to allocate as much memory as it desires. You can make maxdsiz MUCH larger than your actual RAM if you wish.

First, the program(s) you are running have to be told to use more RAM. Extra RAM is not automatically used by programs.

Now things are quite complicated with 32bit programs. The standard program can't address more than 940 megs, regardless of whether you have 1Gb or 10Gb of RAM. This is a 32bit limitation. By reading the docs about SHARED MAGIC, EXEC MAGIC, etc (in /usr/newconfig/doc), you'll see the difficulties.

So you can increase maxdsiz but it won't have any effect until you change your programs.


Bill Hassell, sysadmin