Solved

SWAP - how to determine its size?

Posted on 2006-07-05
4
12,500 Views
Last Modified: 2013-12-27

I notice some swap size descripancy on my two solaris servers. On V4909, I only have one slice for swap and got 15GB swap space. On V440, I have allocated two slices to swap and only get 7.5 GB. Each meta device is a RAID 1. Each slice has the same size (2GB). See details below.

Questions: 1) why adding more meta device on V440 decrease the swap file size? 2) how to determine how much swap space that I need?

Thanks.

V490:
=====
# swap -l
swapfile             dev  swaplo blocks   free
/dev/md/dsk/d1      85,1      16 4111088 4111088

# df -k
Filesystem            kbytes    used   avail capacity  Mounted on
swap                 15930872    1032 15929840     1%    /etc/svc/volatile
swap                 15930576     736 15929840     1%    /tmp
swap                 15929888      48 15929840     1%    /var/run

# metastat d1
d1: Mirror
    Submirror 0: d11
      State: Okay
    Submirror 1: d21
      State: Okay
    Pass: 1
    Read option: roundrobin (default)
    Write option: parallel (default)
    Size: 4111104 blocks (2.0 GB)

d11: Submirror of d1
    State: Okay
    Size: 4111104 blocks (2.0 GB)
    Stripe 0:
        Device     Start Block  Dbase        State Reloc Hot Spare
        c1t0d0s1          0     No            Okay   Yes


d21: Submirror of d1
    State: Okay
    Size: 4111104 blocks (2.0 GB)
    Stripe 0:
        Device     Start Block  Dbase        State Reloc Hot Spare
        c1t1d0s1          0     No            Okay   Yes


Device Relocation Information:
Device   Reloc  Device ID
c1t0d0   Yes    id1,ssd@n500000e011d3f900
c1t1d0   Yes    id1,ssd@n500000e011d26e10

V440:
=====
# swap -l
swapfile             dev  swaplo blocks   free
/dev/md/dsk/d1      85,1      16 4100912 4100912
/dev/md/dsk/d8      85,8      16 4100912 4100912

# df -k
Filesystem            kbytes    used   avail capacity  Mounted on
swap                 7525808     992 7524816     1%    /etc/svc/volatile
swap                 7524816       0 7524816     0%    /tmp
swap                 7524856      40 7524816     1%    /var/run

# metastat d1
d1: Mirror
    Submirror 0: d11
      State: Okay
    Submirror 1: d21
      State: Okay
    Pass: 1
    Read option: roundrobin (default)
    Write option: parallel (default)
    Size: 4100928 blocks (2.0 GB)

d11: Submirror of d1
    State: Okay
    Size: 4100928 blocks (2.0 GB)
    Stripe 0:
        Device     Start Block  Dbase        State Reloc Hot Spare
        c1t0d0s1          0     No            Okay   Yes


d21: Submirror of d1
    State: Okay
    Size: 4100928 blocks (2.0 GB)
    Stripe 0:
        Device     Start Block  Dbase        State Reloc Hot Spare
        c1t1d0s1          0     No            Okay   Yes


Device Relocation Information:
Device   Reloc  Device ID
c1t0d0   Yes    id1,sd@SFUJITSU_MAW3073NCSUN72G_000616B0D68R____DAN0P640D68R
c1t1d0   Yes    id1,sd@SFUJITSU_MAW3073NCSUN72G_000616B0D5T1____DAN0P640D5T1
# metastat d8
d8: Mirror
    Submirror 0: d81
      State: Okay
    Submirror 1: d82
      State: Okay
    Pass: 1
    Read option: roundrobin (default)
    Write option: parallel (default)
    Size: 4100928 blocks (2.0 GB)

d81: Submirror of d8
    State: Okay
    Size: 4100928 blocks (2.0 GB)
    Stripe 0:
        Device     Start Block  Dbase        State Reloc Hot Spare
        c1t2d0s1          0     No            Okay   Yes


d82: Submirror of d8
    State: Okay
    Size: 4100928 blocks (2.0 GB)
    Stripe 0:
        Device     Start Block  Dbase        State Reloc Hot Spare
        c1t3d0s1          0     No            Okay   Yes


Device Relocation Information:
Device   Reloc  Device ID
c1t2d0   Yes    id1,sd@SFUJITSU_MAW3073NCSUN72G_000616B0D5R9____DAN0P640D5R9
c1t3d0   Yes    id1,sd@SFUJITSU_MAW3073NCSUN72G_000616B0D5UE____DAN0P640D5UE

0
Comment
Question by:geotiger
4 Comments
 
LVL 10

Accepted Solution

by:
Nukfror earned 250 total points
ID: 17043772
You are seeing the joys of Virtual Memory on Solaris .

On both systems you have approximately 2 GB of *PHYSICAL* swap space.  Everything above that is what's known as *virtual* swap.  Technically, Solaris servers don't need physical swap to run.  Course, most folks wouldn't suggest you try that.  Only on larger RAM systems can you really get away with it.  You're seeing an attribute of the virtual memory subsystem on Solaris.  When the box boots, it mounts up everything includinga attaching the swap area below what's called Anonymous Memory.  Swap space is basically the first contributor what this memory area - but more technically swap is considered to the phsyical back store for anonymous memory.  Part of the system boot up includes flagging a certain percentage of physical memory also as Anonymous Memory.  Hence, the anonymous memory pool gets larger.  Anonymous memory is where paging really occurs.

When your system pages a page out or swaps out a process address space, its actually paging it out to anonymous memory.  When the anonymous memory pool gets consumed (e.g. all the pages are flagged as "paged out"), the physical back store, aka swap, for anonymous memory kicks in.  Pages will start getting phsyically written out to swap space and your system performance begins to drop as swap is hit more heavily.  This is what happens when availabile memory hits a threshold called LOTSFREE.

In short, the 15GB vs 7.5GB is a probably example showing that the V490 has probably twice the amount of physical memory then the V440 does.  Since it does, the V490 is showing more *virtual* swap then the V440 does.  If the machines have the same amount of memory, then the memory subsystem on the V440 is being exercised twice as heavily as the V490.
0
 
LVL 38

Assisted Solution

by:yuzh
yuzh earned 250 total points
ID: 17047462
Nukfror has given you very good background information about swap space in Solaris.

The size of the swap space is depands what appliaction software is running on the box (the requirements of the system's software applications) and how much RAM the box has.

But you should allocate at least as the SAME size of the RAM for your system, to enable to save a worst-case crash dump.

In most case you can use 2.5 X RAM when you have a large HD, and 1.5 X RAM for small HD.

Have a look at the following page to learn more about Solaris swap space:
http://www.itworld.com/Comp/2378/swol-0496-perf/
http://www.princeton.edu/~psg/unix/Solaris/troubleshoot/ram.html
http://sunsite.uakom.sk/sunworldonline/swol-03-1998/swol-03-perf.html

http://www.alise.lv/ALISE/technolog.nsf/0/59136f9072dc58d8422569fa0057b095?OpenDocument
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now