File descriptor limit

Mike Hearn m.hearn at signal.qinetiq.com
Thu Jul 3 09:17:37 CDT 2003


Hi,

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

.. and it dies.

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".

So, a few questions, for those in the know (probably wineserver guys):

1) Does Wine try to monitor the number of open file descriptors and do
anything about hitting the limit?

2) Does Wine deliberately split into lots of processes when certain
limits are reached? (this doesn't seem to happen for other apps, except
apache but I know it spawns children deliberately for load balancing
reasons).

3) Why do I have so many? This is an app which makes heavy use of
networking (it uses jxta which is a java p2p thingy), so far I've
considered:

	* Thread server pipes (2 fds for each pipe)
	* Thread wait pipes (2 fds each)
	* Sockets
	* Open files (does java have a separate fd for each class even
	  when in jars?)

4) Does Wine have any known scalability problems with lots of
threads/sockets/files open at once? I noticed the wineserver eats a lot
of CPU time.

4) Is there anything I can do about this?

*Any* advice here would be most appreciated. Even given the ridiculous
thread usage 18k file descriptors sounds way out of line, it feels like
something is a bit broken here.

thanks -mike

-- 
Mike Hearn <m.hearn at signal.qinetiq.com>
QinetiQ - Malvern Technology Center




More information about the wine-devel mailing list