File descriptor limit

Dan Kegel dank at kegel.com
Thu Jul 3 20:43:22 CDT 2003


Mike Hearn wrote:
> I have a problem, in that I'm trying to run an app which opens truly
> astonishing numbers of threads, sockets and because we're on Linux ->
> file descriptors.
> 
> For instance, on a basic run in the default configuration, it runs
> approximately 180 threads. A quick script that did an ls -1 in the
> /proc/$pid/fd directory of each running wine process (for some reason I
> get loads) shows that it opens a truly amazing 18,000 odd file
> descriptors.
> 
> In fact, in some circumstances it opens so many, that I get errors like
> this: 
>  wine client error:9a: pipe: Too many open files ...
> The problem is, that I don't know what limit is being used for this. In
> theory, the OPEN_MAX macro should tell me, but for some reason this is
> defined on my box as 256 (red hat 8), even though sysconf(_SC_OPEN_MAX)
> says "1024".

What does 'ulimit -n' say?  That's the per-process limit.  It's usually
at 1024, but root can raise it for itself, and you can then su to the
user you really want to run the program.  You can also arrange for it
to be higher by editing /etc/profile and logging in again.

18000 is impossible unless the processes' ulimit -n
and /proc/sys/fs/file-max are both that or higher, unless
I'm seriously confused.

I doubt Wine scales well to large numbers of threads or fd's.  Maybe it's
time to start seeing where the bottlenecks are...

- Dan

-- 
Dan Kegel
http://www.kegel.com
http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=78045




More information about the wine-devel mailing list