由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Unix版 - file descriptor
相关主题
help, how to mount a network cdrom ?请问Intel平台的Solaris比Linux/BSD的优势在哪里?
which shell is the best among csh, ksh, bsh? how to log in after delete /etc/passwd
How to install gcc under Solaris 2.5?怎么样打开那 '嘀' 的一声?
how to set up printer???[转载] 有没有sun workstation高手
About networking printerThree simple questions for solaris
傻傻的:打印机文件放在哪?Solaris 8 Companion CD 安装问题
问题: Solaris里的小程序出毛病, 这正常吗?Solaris 8系统求助
问个土问题,solaris workstation怎么启动Solaris FAQ
相关话题的讨论汇总
话题: limit话题: descriptor话题: file话题: determine话题: know
进入Unix版参与讨论
1 (共1页)
d*o
发帖数: 108
1
How can I determine what the limit for file descriptor for a workstation?
(I can use 'limit' to find for individual users but I want to know the limit
for the whole machine). And is there a way to increase the limit for the
system (assuming 'root' privilege)?
thanks.
w****d
发帖数: 12
2
为什么要取得fd对整个机器的限制呢? 我不明白. 在我看来, 这个限制肯定受系统资源所
限, 但我也没有找到有关这方面的资料.
一些系统标准, 如posix定义的都是每个进程可以打开的fd数. 如 posix 定义
系统每个进程打开的文件数的最大值至少应当是16, 很多系统都定义为64. 如果你是 root
这个值应该是可以扩充的, 但不会太大(大约200?). 所以, 如果你要用到这个值, 如果
没有定义的话. 你自己可以定义一个 256 就足够了.
如果你非要一个准确的值, 可以用
long sysconf( int name); /* name 为OPEN_MAX */
在程序中取得. 不能保证一定能得到. 而且这个只是一个进程, 而不是整个系统中的限制.
也许有的系统会自己定义整个系统同时被打开的文件数, 比如说 500, 可这个肯定跟具体的
系统有关啦, 怎么改变要看它自己提供的机制了.

【在 d*o 的大作中提到】
: How can I determine what the limit for file descriptor for a workstation?
: (I can use 'limit' to find for individual users but I want to know the limit
: for the whole machine). And is there a way to increase the limit for the
: system (assuming 'root' privilege)?
: thanks.

d*o
发帖数: 108
3
This is the reason why I want to know:
I have an application which runs on solaris. Sometimes it got errors. It was
determined that the error is due to the limit of file descriptors. So I
increases the limit for it. Then it runs fine. Now if I let 10 people to run
it simultaneously, sometimes the error comes back. I still suspect it is
due to the total limit of the system. So I'd like to know how to find
the limit, whether I can increase the limit. If I can determine this is the
reason, then I'l

【在 w****d 的大作中提到】
: 为什么要取得fd对整个机器的限制呢? 我不明白. 在我看来, 这个限制肯定受系统资源所
: 限, 但我也没有找到有关这方面的资料.
: 一些系统标准, 如posix定义的都是每个进程可以打开的fd数. 如 posix 定义
: 系统每个进程打开的文件数的最大值至少应当是16, 很多系统都定义为64. 如果你是 root
: 这个值应该是可以扩充的, 但不会太大(大约200?). 所以, 如果你要用到这个值, 如果
: 没有定义的话. 你自己可以定义一个 256 就足够了.
: 如果你非要一个准确的值, 可以用
: long sysconf( int name); /* name 为OPEN_MAX */
: 在程序中取得. 不能保证一定能得到. 而且这个只是一个进程, 而不是整个系统中的限制.
: 也许有的系统会自己定义整个系统同时被打开的文件数, 比如说 500, 可这个肯定跟具体的

w****d
发帖数: 12
4
solaris下改系统参数好像要在一个文件里(/etc/下吧?)写一些然后重新启动吧?
你查一下系统管理手册或是faqs吧, 应该有. 不过注意别改太大, 否则不起作用.
如果你的应用需要越大越好, 我想你需要改程序来自己限制资源的使用, 对出错
进行处理或是阻塞进一步的请求等. 你总不能希望你的应用占用几乎所有的系统
资源吧? 这样你自己的程序也要受很大影响的.
fd这个东西说起来花费也不大, 但系统肯定要对它作限制的.

【在 d*o 的大作中提到】
: This is the reason why I want to know:
: I have an application which runs on solaris. Sometimes it got errors. It was
: determined that the error is due to the limit of file descriptors. So I
: increases the limit for it. Then it runs fine. Now if I let 10 people to run
: it simultaneously, sometimes the error comes back. I still suspect it is
: due to the total limit of the system. So I'd like to know how to find
: the limit, whether I can increase the limit. If I can determine this is the
: reason, then I'l

1 (共1页)
进入Unix版参与讨论
相关主题
Solaris FAQAbout networking printer
How to tell XFree86's version?傻傻的:打印机文件放在哪?
SOSSSS! Passwd file broken问题: Solaris里的小程序出毛病, 这正常吗?
simple simple question问个土问题,solaris workstation怎么启动
help, how to mount a network cdrom ?请问Intel平台的Solaris比Linux/BSD的优势在哪里?
which shell is the best among csh, ksh, bsh? how to log in after delete /etc/passwd
How to install gcc under Solaris 2.5?怎么样打开那 '嘀' 的一声?
how to set up printer???[转载] 有没有sun workstation高手
相关话题的讨论汇总
话题: limit话题: descriptor话题: file话题: determine话题: know