[注意]rlim_fd_cur, rlim_fd_max的使用说明
发表于:2007-06-09来源:作者:点击数:
标签:
In2.3inearlierthisrequirespokingthekernel.InSolaris2.4+,thiscanbeaccomplishedbyaddingthefollowinglinesto/etc/system: *sethardlimitonfiledescriptors setrlim_fd_max=4096 *setsoftlimitonfiledescriptors setrlim_fd_cur=1024 Raisingthesoftlimitp
In 2.3 in earlier this requires poking the kernel. In Solaris 2.4+, this can be a
clearcase/" target="_blank" >ccomplished by adding the following lines to /etc/system:
* set hard limit on file descriptors
set rlim_fd_max = 4096
* set soft limit on file descriptors
set rlim_fd_cur = 1024
Raising the soft limit past 256 may confuse certain applications, especially BCP applications. Raising the limit past 1024 may confuse applications that use select(). Select() cannot use more than 1024 file descriptors at this time prior to Solaris 7. In Solaris 2.6, the RPC code
was rewritten to use poll(), which does work with many more fds than select(). Prior to 2.6, all RPC servers will likely crash and burn if you increase the fd soft limit past 1024.
Solaris 7 allows upto 65536 fds passed to select; this is the default for 64 bit applications but it requires recompiling with a larger value for FD_SETSIZE for 32 bit apps.
Programs using stdio or even library calls that use stdio may break when they have more than 256 files open as that is the stdio limit. Programs using many filedescriptors should try and reserve a number of low numbered file descriptors for use by stdio.
The stdio limit is removed for 64 bit applications in Solaris 7; if you really need more than 256 FILE * in and you can't use Solaris 7+ or need to run in 32 bits, you can use SFIO from AT&T.
mmmmn 回复于:2002-12-17 17:09:42
|
你的哪个问题是不是和设置这个为1024无关啊?
|
daemonix 回复于:2002-12-17 17:37:20
|
[quote][b]下面引用由[u]mmmmn[/u]在 [i]2002/12/17 05:09pm[/i] 发表的内容:[/b] 你的哪个问题是不是和设置这个为1024无关啊? [/quote]
有关,关系大了,害的我折腾了几个小时,开始还以为是硬盘的问题。对flexlm,我应该还是比较熟悉的,结果lmgrd和对应的daemon就是起不来,后来想起刚改过system文件,把它改小一点(512/1024)就可以了。
我今天专门找到了这篇文章,想告诉大家,将这2个值改大,对有些应用(特别是IPC相关的)是有影响的,希望引起大家的注意。
|
mmmmn 回复于:2002-12-17 17:39:40
|
倒,不明白,麻烦你具体解释一下:)
|
daemonix 回复于:2002-12-17 17:43:50
|
“Raising the soft limit past 256 may confuse certain applications, especially BCP applications. Raising the limit past 1024 may confuse applications that use select()”
我的应用程序肯定用到了select()函数。 rlim_fd_cur超过1024,导致应用不能正常启动了。
|
mmmmn 回复于:2002-12-17 17:47:06
|
谢谢,又学到了
|
race 回复于:2002-12-17 19:21:35
|
缺省是多少?
|
daemonix 回复于:2002-12-17 22:11:38
|
忘记了,用 adb -k 可以看,好像是0x40
# adb -k rlim_fd_cur/X rlim_fd_max/X
|
laoxia 回复于:2002-12-18 00:53:43
|
daemonix 是好人啊。。。
|
原文转自:http://www.ltesting.net