2000-11-17 16:31:16

by Doug Alcorn

[permalink] [raw]
Subject: FAQ followup: changes in open fd/proc in 2.4.x?

I am working on a project to port a commercial app to Linux. Our app
is essentially a dataserver with approximately two files per database
table. I did a search of this mailing lists archive on the subject
and found a discussion back in the 2.0.x days when the limit was 256.
Basically the discussion went like this:

guy who wanted more: I really need more fds
list: redesign your app
guy who wanted more: But my app is really mature
list: no response

I couldn't find any of the discussion from when the limit was
increased.

With the 2.2.x kernel, our choices are basically to live with the
limitation or redesign. We certainly don't like the limitation and
are talking about a redesign.

Now we get to the reason for this post. Has anything changed for
2.4.x? With release eminent, we don't really want to go through the
redesign and implementation if the architecture is different for
2.4.x. I don't closely follow linux-kernel (except through periodic
catch-ups on the kernel cousin). It seems like the VFS changes might
affect this, I don't know.

So basically, before we begin the arduous task of redesign is there
anything in the 2.4.x kernel that will affect our decisions?

PS, please CC: me on replies.
--
(__) Doug Alcorn (mailto:[email protected] http://www.lathi.net)
oo /
|_/


2000-11-17 16:44:28

by Richard B. Johnson

[permalink] [raw]
Subject: Re: FAQ followup: changes in open fd/proc in 2.4.x?

On 17 Nov 2000, Doug Alcorn wrote:

> I am working on a project to port a commercial app to Linux. Our app
> is essentially a dataserver with approximately two files per database
> table. I did a search of this mailing lists archive on the subject
> and found a discussion back in the 2.0.x days when the limit was 256.
> Basically the discussion went like this:
>

The default is now 1024 fds (try it):

main()
{
int fd;
for(;;)
{
fd = open("/dev/null", 0);
printf("%d\n", fd);
if(fd < 0) exit(0);

}
}

Something in /proc/sys/fs is supposed to increase it even more, but
I don't know how.

Cheers,
Dick Johnson

Penguin : Linux version 2.4.0 on an i686 machine (799.54 BogoMips).

"Memory is like gasoline. You use it up when you are running. Of
course you get it all back when you reboot..."; Actual explanation
obtained from the Micro$oft help desk.


2000-11-17 16:51:28

by Vasil Kolev

[permalink] [raw]
Subject: Re: FAQ followup: changes in open fd/proc in 2.4.x?



On 17 Nov 2000, Doug Alcorn wrote:

> I am working on a project to port a commercial app to Linux. Our app
> is essentially a dataserver with approximately two files per database
> table. I did a search of this mailing lists archive on the subject
> and found a discussion back in the 2.0.x days when the limit was 256.
> Basically the discussion went like this:
<--cut->
> With the 2.2.x kernel, our choices are basically to live with the
> limitation or redesign. We certainly don't like the limitation and
> are talking about a redesign.
>
I have some similar problems on 2.2.xx , and i do the following:
echo 65535 >/proc/sys/fs/file-max
and then in the scripts that start the programs:
ulimit -n 65535
And everyting is fine... Even better, you can use setrlimit() to set this
in your program...( and even do the echo ... > ... there :))) )


2000-11-17 16:52:18

by Andi Kleen

[permalink] [raw]
Subject: Re: FAQ followup: changes in open fd/proc in 2.4.x?

On Fri, Nov 17, 2000 at 10:58:12AM -0500, Doug Alcorn wrote:
> With the 2.2.x kernel, our choices are basically to live with the
> limitation or redesign. We certainly don't like the limitation and
> are talking about a redesign.

Later 2.2.x (x>=11 or so) has no limitations on fds/procs, other than what you set
with ulimit and the global limit (/proc/sys/fs/{file,inode}-max)
2.2.x before that need to be recompiled for more than 1024 fds/proc and they
will also waste a lot of memory for high settings.

Some older library functions may cause problems though when they use select()
and you pass a fd>=1024 to them.

-Andi