• 软件测试技术
  • 软件测试博客
  • 软件测试视频
  • 开源软件测试技术
  • 软件测试论坛
  • 软件测试沙龙
  • 软件测试资料下载
  • 软件测试杂志
  • 软件测试人才招聘
    暂时没有公告

字号: | 推荐给好友 上一篇 | 下一篇

如何/etc/system中的descriptors参数

发布: 2007-6-08 22:43 | 作者: seanhe | 来源: | 查看: 24次 | 进入软件测试论坛讨论

领测软件测试网
如何/etc/system中的descriptors参数,我需要的是永久的实现,需要设置成1024,我在csh中,使用limit descriptors 1024后,一退出该会话后,再重新登陆,有变成默认的了! ( 版本7) 现在有没有好的办法,只实现一个用户下的环境,最好不要重起机器!

 race 回复于:2003-12-12 23:57:05
可以参考Solaris Tunable Parameters Reference Manual 
docs.sun.com可以下载

 dw1234 回复于:2003-12-16 11:35:43
文档我已经看过了,写得不是很细,能不能给出个例子? 
另外,如果要limit descriptors 4096 是否需要重新起机器? 
如果我从该会话结束后,是否limit就失效了? 
能不能给个正面的答复? 谢谢!

 race 回复于:2003-12-16 11:40:07
没做过这些修改,l单独使用应该立即生效,修改etc/system必须启动

 laoxia 回复于:2003-12-16 11:55:58
两种方式:

1。把 ulimit -n 1024 在那个进程的起动脚本中(在/etc/rc#.d下)。如此只改动一
个某一具体进程的fd限制。

2。在/etc/system里设set rlim_fd_cur=1024 然后重起机器。这样改变整个系统的
fd限制。

 laoxia 回复于:2003-12-16 11:59:40
[size=18:e3d03aafe8][b:e3d03aafe8]Solaris Kernel Tuning[/b:e3d03aafe8][/size:e3d03aafe8]

sysdef -i reports on several system resource limits. Other parameters can be checked on a running system using adb -k :


[color=red:e3d03aafe8]adb -k /dev/ksyms /dev/mem
parameter-name/D
^D (to exit) [/color:e3d03aafe8]More information on kernel tuning is available in Sun's online documentation. 


[color=red:e3d03aafe8]maxusers[/color:e3d03aafe8]
The maxusers kernel parameter is the one most often tuned. By default, it is set to the number of Mb of physical memory or 1024, whichever is lower. It cannot be set higher than 2048. 

Several kernel parameters are set when maxusers is set unless otherwise overridden by the /etc/system file. Some of these formulas differ between different versions of Solaris: 

[color=red:e3d03aafe8]max_nprocs[/color:e3d03aafe8]: Number of processes = 10 + (16 x maxusers) 
[color=red:e3d03aafe8]ufs_ninode[/color:e3d03aafe8]: Inode cache size = (17xmaxusers)+90 (Solaris 2.5.1) or 4x(maxusers + max_nprocs)+320 (Solaris 2.6-8). See the Disk I/O page for more information. 
[color=red:e3d03aafe8]ncsize[/color:e3d03aafe8]: Name lookup cache size = (17xmaxusers)+90 (Solaris 2.5.1) or 4x(maxusers + max_nprocs)+320 (Solaris 2.6-8). See the Disk I/O page for more information. 
[color=red:e3d03aafe8]ndquot[/color:e3d03aafe8]: Quota table size = (maxusers x 10) + max_nprocs 
[color=red:e3d03aafe8]maxuproc[/color:e3d03aafe8]: User process limit = max_nprocs - 5 


[color=red:e3d03aafe8]ptys[/color:e3d03aafe8]
Solaris 8 dynamically sizes the number of ptys available to a system, so you are less likely to run into pty starvation than was the case under Solaris 2.5.1-7. There are still hard system limits that are set based upon hardware configuration, and it may be necessary to increase the number of ptys manually as in Solaris 2.5.1-7. 

If the system is suffering from pty starvation, the number of ptys available can be increased by increasing pt_cnt above the default of 48. Solaris 2.5.1 and 2.6 systems should not have pt_cnt set higher than 3844 due to limitations with the te.net and rlogin daemons. Solaris 7 does not have this restriction, but there may be other system issues that prevent setting pt_cnt arbitrarily high. Once pt_cnt is increased, a reconfiguration boot (boot -r) is required to build the ptys. 

If pt_cnt is increased, some sources recommend that other variables be set at the same time. Other sources (such as the Solaris2 FAQ) suggest that this advice is spurious and results in a needless consumption of resources. See the notes below before making any of these changes; setting the values too high may result in wasted memory. In any case, one form of these recommendations is:


[color=red:e3d03aafe8]npty[/color:e3d03aafe8]: Set to pt_cnt (see the note below) 
[color=red:e3d03aafe8][color=red]nautopush[/color:e3d03aafe8][/color]: Set to twice the value of pt_cnt 
[color=red:e3d03aafe8]sadcnt[/color:e3d03aafe8]: Set to same value as pt_cnt 

npty limits the number of BSD ptys. These are not usually used by applications, but may need to be increased on a system running a special service. In addition to setting npty in the /etc/system file, the /etc/iu.ap file will need to be edited to substitute the value npty-1 in the third field of the ptsl line. After both changes are made, a boot -r is required for the changes to take effect. Note that Solaris does not support any more than 176 BSD ptys in any case. 

sadcnt sets the number of STREAMS addressable devices and nautopush sets the number of STREAMS autopush entries. nautopush should be set to twice sadcnt. Whether or not these values need to be increased as above depends on the types of activity on the system. 


RAM Tuneables
See the Memory/Swapping page for a discussion of parameters related to RAM and paging. 


Disk I/O Tuneables
See the Disk I/O page for a full discussion of disk I/O-related tuneables. 


IPC Tuneables
Check the IPC Tuning page for InterProcess Communication-related resource parameters. 


File Descriptors
See the File Descriptors page for more discussion regarding tuning issues. 

File descriptors are retired when the file is closed or the process terminates. Opens always choose the lowest-numbered file descriptor available. Available file descriptors are allocated as follows: 


[color=red:e3d03aafe8]rlim_fd_cur[/color:e3d03aafe8]: It is dangerous to set this value higher than 256 due to limitations with the stdio library. If programs require more file descriptors, they should use setrlimit directly. 
[color=red:e3d03aafe8]rlim_fd_max[/color:e3d03aafe8]: It is dangerous to set this value higher than 1024 due to limitations with select. If programs require more file descriptors, they should use setrlimit directly. 


Misc Tuneables
[color=red:e3d03aafe8]dump_cnt[/color:e3d03aafe8]: Size of dumps. 
[color=red:e3d03aafe8]rstchown[/color:e3d03aafe8]: Posix/restricted chown enabled (default=1) 
[color=red:e3d03aafe8]ngroups_max[/color:e3d03aafe8]: Maximum number of supplementary groups per user (default=32).

延伸阅读

文章来源于领测软件测试网 https://www.ltesting.net/


关于领测软件测试网 | 领测软件测试网合作伙伴 | 广告服务 | 投稿指南 | 联系我们 | 网站地图 | 友情链接
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备2023014753号-2
技术支持和业务联系:info@testage.com.cn 电话:010-51297073

软件测试 | 领测国际ISTQBISTQB官网TMMiTMMi认证国际软件测试工程师认证领测软件测试网