Sponsored Content
Full Discussion: Interesting swap usage
Operating Systems Solaris Interesting swap usage Post 302811203 by gregsih on Thursday 23rd of May 2013 09:08:03 AM
Old 05-23-2013
Interesting swap usage

From the server showing the issue:
Code:
 
# swap -s
total: 10964072k bytes allocated + 185592k reserved = 11149664k used, 38735512k available
 
# swap -l
swapfile             dev  swaplo blocks   free
/dev/zvol/dsk/rpool/swap 256,1      16 16777200 16777200
 
# vmstat 2 2
 kthr      memory            page            disk          faults      cpu
 r b w   swap  free  re  mf pi po fr de sr s4 s5 s6 s7   in   sy   cs us sy id
 0 0 0 81782944 96140160 21 82 0 0 0  0  3 -0  1 -0  1 1588  664 1387  0  0 100
 0 0 0 38734832 53113984 1 11 0 0  0  0  0  0  0  0  0 1936 1629 2075  0  0 100
 
 # prstat -Z -n 1,10 1 1
   PID USERNAME  SIZE   RSS STATE  PRI NICE      TIME  CPU PROCESS/NLWP
  1822 oracle   6087M 6079M sleep   59    0   0:13:22 0.0% oracle/1
ZONEID    NPROC  SWAP   RSS MEMORY      TIME  CPU ZONE
     0      128   11G   11G   8.4%   0:34:03 0.0% global
 
 
 
 
Total: 128 processes, 3333 lwps, load averages: 0.04, 0.05, 0.04
 
 
# echo "::memstat" | mdb -k
Page Summary                Pages                MB  %Tot
------------     ----------------  ----------------  ----
Kernel                     319203              2493    2%
ZFS File Data             8056420             62940   49%
Anon                      1372651             10723    8%
Exec and libs               26078               203    0%
Page cache                  13682               106    0%
Free (cachelist)             9417                73    0%
Free (freelist)           6627062             51773   40%
Total                    16424513            128316
Physical                 16410049            128203
 
#df -h -n swap
Filesystem             size   used  avail capacity  Mounted on
swap                    37G    40K    37G     1%    /var/run


From the second server
Code:
 
# swap -s
total: 3501648k bytes allocated + 283192k reserved = 3784840k used, 9495632k available
 
# swap -l
swapfile             dev  swaplo blocks   free
/dev/zvol/dsk/rpool/swap 256,1      16 16777200 16777200
 
# vmstat 2 2
 kthr      memory            page            disk          faults      cpu
 r b w   swap  free  re  mf pi po fr de sr s4 s5 s6 s7   in   sy   cs us sy id
 0 0 0 16223304 24564312 17 77 0 0 0  0  0 -2  3 -4  3 2322 1816 2135  0  0 100
 0 0 0 9494752 17840096 99 204 0 0 0  0  0  0  0  0  0 2356 2744 2699  0  0 100
 
# prstat -Z -n 1,10 1 1
   PID USERNAME  SIZE   RSS STATE  PRI NICE      TIME  CPU PROCESS/NLWP
  9613 oracle    891M  876M sleep   59    0   0:50:30 0.2% oracle/1
ZONEID    NPROC  SWAP   RSS MEMORY      TIME  CPU ZONE
     0      148 3652M 3684M   2.8%   7:01:36 0.2% global
 
 
 
 
Total: 148 processes, 3433 lwps, load averages: 0.18, 0.18, 0.18
 
# echo "::memstat" | mdb -k
Page Summary                Pages                MB  %Tot
------------     ----------------  ----------------  ----
Kernel                     743484              5808    5%
ZFS File Data            12976767            101380   79%
Anon                       440277              3439    3%
Exec and libs               22564               176    0%
Page cache                  14489               113    0%
Free (cachelist)            14968               116    0%
Free (freelist)           2211964             17280   13%
Total                    16424513            128316
Physical                 16410051            128203
 
# df -hn swap
Filesystem             size   used  avail capacity  Mounted on
swap                   9.1G    56K   9.1G     1%    /var/run

Both servers were showing the second set of output prior to Sunday last week.

Hope this helps
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

swap space and cpu usage for an application

Hi, How do i get the swap space used and cpu usage for a particular application ? thanks una (2 Replies)
Discussion started by: una
2 Replies

2. UNIX for Advanced & Expert Users

per-process swap usage?

I've been trying to write a monitor program that gets various values on the processes running and makes reports. One of the values that I wanted to monitor was swap usage, so that we can ensure that our swap space doesn't fill up, but I can't seem to get this number (on a per-process basis) from... (7 Replies)
Discussion started by: bukzor
7 Replies

3. HP-UX

how can I find cpu usage memory usage swap usage and logical volume usage

how can I find cpu usage memory usage swap usage and I want to know CPU usage above X% and contiue Y times and memory usage above X % and contiue Y times my final destination is monitor process logical volume usage above X % and number of Logical voluage above can I not to... (3 Replies)
Discussion started by: alert0919
3 Replies

4. AIX

How to monitor the IBM AIX server for I/O usage,memory usage,CPU usage,network..?

How to monitor the IBM AIX server for I/O usage, memory usage, CPU usage, network usage, storage usage? (3 Replies)
Discussion started by: laknar
3 Replies

5. Solaris

Listing processes with swap usage

Is there any way to get list of processes which are taking maximum swap , my system is showing no swap space in /var/adm/messages and i 'm unable to pin down the process which is consuming max swap space. (11 Replies)
Discussion started by: fugitive
11 Replies

6. HP-UX

Swap device file and swap sapce

Hi I have an integrity machine rx7620 and rx8640 running hp-ux 11.31. I'm planning to fine tune the system: - I would like to know when does the memory swap space spill over to the device swap space? - And how much % of memory swap utilization should be specified (swap space device... (6 Replies)
Discussion started by: lamoul
6 Replies

7. Shell Programming and Scripting

calculate swap space usage in Solaris and converts it in Percentage

Hi Folks, I am looking for a way to write a script to calculate swap usage in Solaris so that the current usage will be shown in Percentage value. Thanks!! Based on 'swap -s' command # swap -s total: 1378936k bytes allocated + 1236880k reserved = 2615816k used, 2725104k available (2 Replies)
Discussion started by: jaapar
2 Replies

8. Shell Programming and Scripting

Swap usage by top and free command doesn't match

Its rather confusing, the output of top command is below: The "swap" field of top is described by the manpage as: "The swapped out portion of a task's total virtual memory image." But the output of free command suggests something else and it does tally with the output of swapon... (3 Replies)
Discussion started by: proactiveaditya
3 Replies

9. Red Hat

Swap memory usage is high in Linux

Hi , There is one following alert . Message : cdm:Average (2 samples) swap memory usage is now 91%, which is above the warning threshold (90%) Here is my findings. Output of TOP command in Linux server. top - 14:21:44 up 6 days, 4:48, 1 user, load average: 2.55, 2.06,... (3 Replies)
Discussion started by: Maddy123
3 Replies

10. Red Hat

Swap memory usage keeps increasing.

Hi the version is RedHat 6.2 (Oracle DB server) I don't know why swap memory usage keeps increasing... I used to check swap memory usage Free -m and another way. total used free shared buffers cached Mem: 32183 31861 322 ... (3 Replies)
Discussion started by: tom8254
3 Replies
swap(1M)						  System Administration Commands						  swap(1M)

NAME
swap - swap administrative interface SYNOPSIS
/usr/sbin/swap -a swapname [swaplow] [swaplen] /usr/sbin/swap -d swapname [swaplow] /usr/sbin/swap -l /usr/sbin/swap -s DESCRIPTION
The swap utility provides a method of adding, deleting, and monitoring the system swap areas used by the memory manager. OPTIONS
The following options are supported: -a swapname Add the specified swap area. This option can only be used by the super-user. swapname is the name of the swap file: for example, /dev/dsk/c0t0d0s1 or a regular file. swaplow is the offset in 512-byte blocks into the file where the swap area should begin. swaplen is the desired length of the swap area in 512-byte blocks. The value of swaplen can not be less than 16. For example, if n blocks are specified, then (n-1) blocks would be the actual swap length. swaplen must be at least one page in length. The size of a page of memory can be determined by using the pagesize command. See pagesize(1). Since the first page of a swap file is automatically skipped, and a swap file needs to be at least one page in length, the minimum size should be a multiple of 2 pagesize bytes. The size of a page of memory is machine dependent. swaplow + swaplen must be less than or equal to the size of the swap file. If swaplen is not specified, an area will be added starting at swaplow and extending to the end of the designated file. If neither swaplow nor swaplen are specified, the whole file will be used except for the first page. Swap areas are normally added automatically during system startup by the /sbin/swapadd script. This script adds all swap areas which have been specified in the /etc/vfstab file; for the syntax of these specifications, see vfstab(4). To use an NFS or local file-system swapname, you should first create a file using mkfile(1M). A local file-system swap file can now be added to the running system by just running the swap -a command. For NFS mounted swap files, the server needs to export the file. Do this by performing the following steps: 1. Add the following line to /etc/dfs/dfstab: share -F nfs -o rw=clientname,root=clientname path-to-swap-file 2. Run shareall(1M). 3. Have the client add the following line to /etc/vfstab: server:path-to-swap-file - local-path-to-swap-filenfs --- local-path-to-swap-file -- swap --- 4. Have the client run mount: # mount local-path-to-swap-file 5. The client can then run swap -a to add the swap space: # swap -a local-path-to-swap-file -d swapname Delete the specified swap area. This option can only be used by the super-user. swapname is the name of the swap file: for example, /dev/dsk/c0t0d0s1 or a regular file. swaplow is the offset in 512-byte blocks into the swap area to be deleted. If swaplow is not specified, the area will be deleted starting at the second page. When the command completes, swap blocks can no longer be allocated from this area and all swap blocks previously in use in this swap area have been moved to other swap areas. -l List the status of all the swap areas. The output has five columns: path The path name for the swap area. dev The major/minor device number in decimal if it is a block special device; zeroes otherwise. swaplo The swaplow value for the area in 512-byte blocks. blocks The swaplen value for the area in 512-byte blocks. free The number of 512-byte blocks in this area that are not currently allocated. The list does not include swap space in the form of physical memory because this space is not associated with a particular swap area. If swap -l is run while swapname is in the process of being deleted (by swap -d), the string INDEL will appear in a sixth column of the swap stats. -s Print summary information about total swap space usage and availability: allocated The total amount of swap space in bytes currently allocated for use as backing store. reserved The total amount of swap space in bytes not currently allocated, but claimed by memory mappings for possi- ble future use. used The total amount of swap space in bytes that is either allocated or reserved. available The total swap space in bytes that is currently available for future reservation and allocation. These numbers include swap space from all configured swap areas as listed by the -l option, as well swap space in the form of physical memory. USAGE
On the 32-bit operating system, only the first 2 Gbytes -1 are used for swap devices greater than or equal to 2 Gbytes in size. On the 64-bit operating system, a block device larger than 2 Gbytes can be fully utilized for swap up to 2**63 -1 bytes. ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of swap: LC_CTYPE and LC_MESSAGE. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
pagesize(1), mkfile(1M), shareall(1M), getpagesize(3C), vfstab(4), attributes(5), largefile(5) WARNINGS
No check is done to determine if a swap area being added overlaps with an existing file system. SunOS 5.10 20 Jan 2004 swap(1M)
All times are GMT -4. The time now is 07:51 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy