ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 20160615_HP-UX系统

20160615_HP-UX系统

Linux操作系统 作者:shihfa 时间:2016-06-15 15:22:53 0 删除 编辑
1、nfile,maxfiles_lim,nproc参数说明
nfile:系统所有经常可打开的最大文件数量
maxfiles_lim:单进程可打开的最大文件数量
nproc: 系统可并发运行的进程数量
执行man nfile(maxfiels_lim,nproc)可获取更详细的信息
2、查看当前nfile参数的值,默认值为0,表示不限制
db178.cm2:/home/fengjing/kmif>#kctune -v nfile
Tunable             nfile
Description         Maximum number of file descriptors (system-wide)
Module              fs_filedscrp
Current Value       330800 [(21*nproc+204800)]
Value at Next Boot  330800 [(21*nproc+204800)]
Value at Last Boot  330800
Default Value       0
Constraints         nfile == 0 or nfile >= 2048
                    nfile <= 2147483647
Can Change          Immediately or at Next Boot
补充:执行kctune -v maxfiles_lim和kctune -v nproc可查看想参数的值
3、查看当前nfile的使用情况
3.1 sar -v命令
00:00:01 text-sz  ov  proc-sz  ov  inod-sz  ov  file-sz  ov
00:05:00   N/A   N/A 1263/6000  0  2315/52096 0  208980/330800 0
00:10:00   N/A   N/A 1249/6000  0  2306/52096 0  208839/330800 0
......
11:25:00   N/A   N/A 1445/6000  0  2422/52096 0  287402/330800 0
11:30:01   N/A   N/A 1427/6000  0  2407/52096 0  280057/330800 0
11:35:00   N/A   N/A 1437/6000  0  2411/52096 0  279036/330800 0
其中:file-sz为279036/330800,即表示当前打开的文件数量是279036,nfile参数的值是330800
3.2 glance命令
然后输入“H”,再输入“t”,可得如下界面:
System Table                 Available        Used      Utilization      High(%)
--------------------------------------------------------------------------------
Proc Table (nproc)               4096          352            9            9
File Table (nfile)             661600         4816            1            1
Shared Mem Table (shmmni)        4096           10            0            0
Message Table (msgmni)           4096            2            0            0
Semaphore Table (semmni)         8192           32            0            0
File Locks (nflocks)             8192           39            0            0
Pseudo Terminals (npty)            60            0            0            0
Buffer Headers (nbuf)              na         1978           na           na
4、动态设置nfile参数值,不影响在线业务
执行kctune nfile=xxxx命令,当前生效且重启也生效,下面信息中也提示,该参数建议使用默认值
db178.cm2:/home/fengjing/kmif>#kctune nfile=661600
     ==> Update the automatic 'backup' configuration first? y
       * The automatic 'backup' configuration has been updated.
       * Future operations will update the backup without prompting.
WARNING: The tunable nfile has been deprecated and should not be tuned
         to a non-default value.  See nfile(5) for details on this
         tunable.
       * The requested changes have been applied to the currently
         running configuration.
Tunable             Value  Expression         Changes
nfile    (before)  330800  (21*nproc+204800)  Immed
         (now)     661600  661600            
db178.cm2:/home/fengjing/kmif>#
如果设置nfile=0,则表示对nfile不限制,HP-UX 11.31版本开始建议设置nfile为0,且从该版本开始,nfile的默认值也为0。
nfile设置为0后,其实是表示HP-UX将废弃该内核可调参数,HP-UX系统将会自动的调整系统资源来协调工作。
从man nfile的信息中,也可以看出在将来的版本中会废弃nfile这个参数,如下:
...
 WARNINGS
      This tunable is obsolete and will be removed in a future release of
      HP-UX.

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/26179376/viewspace-2120211/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: 20160616 Linux free
请登录后发表评论 登录
全部评论

注册时间:2013-11-05

  • 博文量
    62
  • 访问量
    65722