This discussion is archived
3 Replies Latest reply: Dec 19, 2012 8:29 AM by cindys RSS

How to decrease the swap in /system/volatile - Solaris 11

user345900 Newbie
Currently Being Moderated
Hi Guys,

If you have any suggestion please share with us.

Currently I've installed the Solaris 11.

The Hardware are with 32GB memory. The challenge came when I want to specific the swap space. I've change the value as per below, but still swap /system/volatile show difference with the swap -l output.

admin@cart:~$ df -h | grep swap
swap 46G 1.4M 46G 1% /system/volatile
swap 40G 8K 40G 1% /tmp

admin@cart:~$ swap -lh
swapfile dev swaplo blocks free
/dev/zvol/dsk/rpool/swap 274,2 4K 40G 40G

admin@cart:~$ swap -sh
total: 139M allocated + 19M reserved = 158M used, 46G available

admin@cart:~$ top
load averages: 0.00, 0.00, 0.00; up 0+00:39:27 13:54:35
69 processes: 66 sleeping, 2 stopped, 1 on cpu
CPU states: 99.7% idle, 0.0% user, 0.3% kernel, 0.0% iowait, 0.0% swap
Kernel: 169 ctxsw, 1 trap, 646 intr, 160 syscall, 1 flt
Memory: 8192M phys mem, 6793M free mem, 40G total swap, 40G free swap

Please advise.

Warmest Regards,
Razali
  • 1. Re: How to decrease the swap in /system/volatile - Solaris 11
    bigdelboy Pro
    Currently Being Moderated
    941108 wrote:
    Hi Guys,

    If you have any suggestion please share with us.

    Currently I've installed the Solaris 11.

    The Hardware are with 32GB memory. The challenge came when I want to specific the swap space. I've change the value as per below, but still swap /system/volatile show difference with the swap -l output.

    admin@cart:~$ df -h | grep swap
    swap 46G 1.4M 46G 1% /system/volatile
    swap 40G 8K 40G 1% /tmp

    admin@cart:~$ swap -lh
    swapfile dev swaplo blocks free
    /dev/zvol/dsk/rpool/swap 274,2 4K 40G 40G

    admin@cart:~$ swap -sh
    total: 139M allocated + 19M reserved = 158M used, 46G available

    admin@cart:~$ top
    load averages: 0.00, 0.00, 0.00; up 0+00:39:27 13:54:35
    69 processes: 66 sleeping, 2 stopped, 1 on cpu
    CPU states: 99.7% idle, 0.0% user, 0.3% kernel, 0.0% iowait, 0.0% swap
    Kernel: 169 ctxsw, 1 trap, 646 intr, 160 syscall, 1 flt
    Memory: 8192M phys mem, 6793M free mem, 40G total swap, 40G free swap

    Please advise.

    Warmest Regards,
    Razali
    Hi Razali
    (0) IMHO I HATE the term 'swap'. It can be used ambiguously. In some contexts it means swapfile(s). In other contexts it relates to virtual memory.

    I'm not running Solaris while typing this .... so i'm working from an imperfect memory and Ideally i might like to test my answers ....

    (1)
    The Hardware are with 32GB memory. ....
    Well
    Memory: 8192M phys mem, 6793M free mem, 40G total swap, 40G free swap
    Top seems to think you have only 8GB of physical RAM. I dont always trust top in solaris .... /usr/sbin/prtconf | grep -i mem i would trust a little better.


    (2) The swap -sh indicates you have a 40GB SwapFile.
    admin@cart:~$ swap -lh
    swapfile dev swaplo blocks free
    /dev/zvol/dsk/rpool/swap 274,2 4K 40G 40G
    (3) The swap -s indicates you have 46GB Total virtual memory available.
    admin@cart:~$ swap -sh
    total: 139M allocated + 19M reserved = 158M used, 46G available
    Summary:

    I am minded you have a machine 8GB physical memory with a 40GB swapfile and 48GB of Total virtual memory.

    For a machine with 8GB of memory a swapfile of 40GB (5 times memory) would normally be excessive ( i could provide an exception). Usually excessive paging (and machine performance dropoff) would occur well before that was used up. Probably about 16GB would be a top end start point.

    If your machine has 32GB ram a 16GB swapfile would IMHO normally typically be adequate .... and I would judge a swapfile on that of even 32GB as very conservative .... but again exceptions where more is sensible can be given.


    Authorative documentation on swapfile handling is below: Adding or removing swapfile will increase/decrease total virtual memory available:

    http://docs.oracle.com/cd/E23824_01/html/821-1459/gizfl.html

    Edited by: bigdelboy on 19-Dec-2012 09:37 Corrections:
    I dont always trust swap in solaris -> I dont always trust 'top' in solaris ( Corrected above)
    Looking at Cindys reply below I should be using 'swap device' or 'swap volume' rather than 'swapfle' in points here .... I stand corrected.
  • 2. Re: How to decrease the swap in /system/volatile - Solaris 11
    user345900 Newbie
    Currently Being Moderated
    HI bigdelboy,

    Thank you for the informative help.

    Sorry for my wrong typo, should be 8gb physical memory.

    I've tried the documentation given before, if I'm not add in zfs swap, the swap /system/volatile will show 6gb after doing a fresh installation. If I set using the link provided, the size will change to 46gb after set the volsize=40g.

    Is it something configuration that I've missed? or do you have information to modified the swap in /system/volatile?

    Warmest Regards,
    Razali
  • 3. Re: How to decrease the swap in /system/volatile - Solaris 11
    cindys Pro
    Currently Being Moderated
    A few clarifications:

    1. The default S11 swap configuration in a ZFS root pool is a ZFS volume that you can display
    with the zfs list -r rpool command. The size of swap volume is displayed like this:

    # zfs get volsize rpool/swap
    NAME PROPERTY VALUE SOURCE
    rpool/swap volsize 2G local

    2. You can see the internal volume name with swap -l, like this:

    # swap -l
    swapfile dev swaplo blocks free
    /dev/zvol/dsk/rpool/swap 285,2 16 4194288 4194288

    This is not a swap file. The swapfile column in the above swap output is an
    artifact of a UFS-based swap component. The zvol acts more like a device than
    a file.

    You can't configure a swap file to be used with a ZFS root file system.
    Its not supported.

    3. The system/volatile swap reference in your df -h output is is a special
    TMPFS based file system that should not be reconfigured. From the docs:

    /system/volatile TMPFS A memory-based file system for storing temporary files
    that are not needed after the system is booted.

    This TMPFS file system is not reconfigured by using the swap command or
    resizing the ZFS swap volume.

    Your df -h output means that a total of 46GB of virtual memory is available
    on your system and system/volatile is consuming 1% or 1.4 M.

    $ df -h | grep swap
    swap 46G 1.4M 46G 1% /system/volatile

    4. If your system is tight on physical memory, then a couple of options are
    to add more memory or increase your swap space, but system/volatile is
    not using 46G, its using 1.4 M.

    Thanks, Cindy

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points