Max open files....

Andrew Tridgell tridge at samba.anu.edu.au
Sun Apr 19 00:10:08 GMT 1998


> What about determining if the system in question has getrlimit()
> and using the value returned by that?  I quickly checked SunOS 4.1.3,
> 5.5.1, 5.6, and Irix 5.something using the same little test program
> and it worked fine on all of them.

we already use getrlimit()/setrlimit() to move the limit up to
MAX_OPEN_FILES if possible.

> I just thought that if we can determine the maximum number ourselves,
> we shouldn't let the user configure us to crash, since they'll say
> its our fault when they do :)

the crash doesn't occur because the limit is reached. It has nothing
to do with the limit at all. The crash happened when the *total*
number of file descriptors open system wide got too high (around 60k
did it).

My main point is that opening lots of file descriptors slows down the
kernel a lot. In the case of IRIX it slowed it down more than I
expected :)

Cheers, Andrew


More information about the samba-technical mailing list