Chinaunix首页 | 论坛 | 博客
  • 博客访问: 282673
  • 博文数量: 107
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 74
  • 用 户 组: 普通用户
  • 注册时间: 2016-11-18 09:57
文章分类

全部博文(107)

文章存档

2023年(2)

2021年(1)

2017年(1)

2015年(4)

2014年(9)

2013年(4)

2012年(14)

2011年(49)

2010年(23)

分类:

2011-01-06 16:27:17

对HP unix swapinfo -a 中的memory的解释:
 
HP-UX启动每一个进程,都需要在swap区预留一块和内存一样大小的区域,以防内存不够时作数据交换。当预留的swap区用完时,系统就不能再启动新的进程。比如,系统物理内存是4G,而设置的交换区只有1G,那么可以计算得出大概3G的内存会浪费(Buffer Cache除外,可能有2G浪费)。 
swapmen_on的作用,就是让系统创建一个pseudo-swap(伪交换区),大小为系统物理内存的3/4,但是这个伪交换区并不占用任何内存和硬盘资源。只是说,让系统认为,交换区的大小是1+4*3/4=4G,而不是1G,就是说可以启动更多的进程,避免内存的浪费。 
一般系统物理内存不大的时候,设置交换区是物理内存的2-4倍,swapmen_on设置为1或0都没什么影响,但是当系统内存很大如8G时,因为swap一般不设为16G-32G,这时开启swapmen_on就很必要了。

附: swapinfo man:
 
NAME
      swapinfo - system swap space information
 SYNOPSIS
      /etc/swapinfo [-mtadfhqw]
 DESCRIPTION
      swapinfo prints information about device and file system swap space.
      By default, it prints to standard output a two line header as shown
      here, followed by one line per swap area:
                      Kb         Kb      Kb      PCT     START/      Kb
           TYPE    AVAIL   USED    FREE    USED    LIMIT   RESERVE PRI     NAME
      The fields are:
      TYPE        One of:
                  dev     Swap space residing on a mass storage device,
                          either outside the file system or consuming some
                          or all of a raw device.  This swap space is either
                          statically declared in the kernel, or dynamically
                          added using the swapon command (see swapon(1M)),
                          often in /etc/rc during system initialization
                          based on the contents of /etc/checklist.
                  fs      Dynamic swap space available from a file system,
                          as set by swapon, often as listed in
                          /etc/checklist.
                  hold    Swap space on hold.  This is space not allocated
                          on any specific device or file system, but
                          nonetheless held by the kernel for future use ``on
                          demand'' by existing processes that have not yet
                          consumed all the swap space they might need.  It
                          cannot be reallocated until those processes
                          terminate.
      Kb AVAIL    The total available swap space from the device or file
                  system, in blocks of 1024 bytes (rounded to nearest whole
                  block if necessary), including any swap space already in
                  use.  For file system swap areas the value is not
                  necessarily constant.  It is the current blocks used for
                  swapping, plus the free blocks available to ordinary users
                  minus RESERVE (but never less than zero).  AVAIL is never
                  more than LIMIT if LIMIT is non-zero.
      Kb USED     The current number of 1-Kbyte blocks used for swapping
                  from the device or file system.  Device swap areas are
                  consumed in machine-dependent ``chunks'' larger than one
                  block (based on the configurable kernel value swchunk; the
 
 Hewlett-Packard Company            - 1 -     HP-UX Release 9.0: August 1992
 
 

 swapinfo(1M)                                                   swapinfo(1M)
 
 
                  chunk size defaults to 4 Mbytes on Series 700/800 systems
                  and to 2 Mbytes on Series 300/400 systems).  If Kb AVAIL
                  is not a multiple of the number of blocks in a chunk, the
                  left over fraction of a chunk is always shown as used,
                  except on unused swap devices (see below).
      Kb FREE     The difference between Kb AVAIL and Kb USED.
      PCT USED    The percentage of capacity in use, based on Kb USED
                  divided by Kb AVAIL; 100% if Kb AVAIL is zero.
      START/LIMIT For device swap areas, this value is the block address on
                  the mass storage device of the start of the swap area;
                  except on Series 800 systems, where it is always ``-'',
                  because Series 800 only swaps to a complete device or
                  partition.  The value is normally 0 for entire swap
                  devices, or the end of the file system for devices
                  containing both a file system and swap space.
                  For file system swap areas, LIMIT is the maximum number of
                  1-Kbyte blocks available from the file system, the same as
                  the limit value given to swapon.  A file system LIMIT
                  value of none means there is no fixed limit; all space is
                  available except that used for files, less the blocks
                  represented by minfree (see fs(4)) plus RESERVE.
      RESERVE     For device swap areas, this value is always ``-''.  For
                  file system swap areas, this value is the number of 1-
                  Kbyte blocks reserved for file system use by ordinary
                  users, the same as the reserve value given to swapon.
      PRI         The same as the priority value given to swapon.  This
                  value indicates the order in which space is taken from the
                  devices and file systems used for swapping.  Space is
                  taken from lower priority swap areas first.  priority can
                  have a value between 0 and (NSWPRI - 1) (normally 10), and
                  has a default value of 1.
      NAME        For device swap areas, the block special file name whose
                  major and minor numbers match the swap device's ID.  The
                  swapinfo command searches /dev for device names first,
                  then /dev/dsk, then /dev/rdsk.  If no matching block
                  special file is found, swapinfo prints the device ID
                  (major and minor values), for example, 0,0x0e0200.
                  For file system swap areas, NAME is the name of a
                  directory on the file system, as given to swapon.
      Because it needs kernel access, swapinfo normally succeeds only for
      the super-user.  It reports warnings or errors if unable to access
      kernel resources such as /dev/mem or /dev/kmem.
 
 
# swapinfo -atm
                Mb         Mb         Mb   PCT     START/         Mb
TYPE      AVAIL    USED    FREE  USED   LIMIT RESERVE  PRI  NAME
dev        8192       0    8192    0%       0       -    1  /dev/vg00/lvol2
dev        8192       0    8192    0%       0       -    1  /dev/vg00/myswap
reserve       -     118    -118
memory     3894     774    3120   20%
total     20278     892   19386    4%       -       0    -
阅读(3484) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~