Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

SWAP - how to determine its size?

Posted on 2006-07-05
4
12,510 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

856 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