Subject: Re: Speeding up "pstat -T"
To: Jonathan Stone <jonathan@DSG.Stanford.EDU>
From: David Laight <david@l8s.co.uk>
List: tech-kern
Date: 10/03/2003 18:15:36
On Fri, Oct 03, 2003 at 09:42:37AM -0700, Jonathan Stone wrote:
> 
> >  | 
> >  | The "fixed" is the unacceptable part. (Myself, I would support increasing
> >  | the current default limit, but that is *not* what you said.)
> >
> >I suspect the "fixed" in the original was not meant as you have interpreted
> >it, but in contrast to "whatever max vnodes happens to be".
> 
> If so, then someone needs a short sharp shock^H^H^H^H^H reminder that
> sockets count as open fds, too.  The apps I mentioned opening 6,000 to
> 10,000 fds in a single process were opening thousands of network sockets.

Yes, and you can arrange for that process to run with a higher limit.
The problem at the moment is that it is possible for any user to write
a program that uses all the files.  This just shouldn't be allowed.
Also the default default limit ought to be a netbsd constant, not depend
on MAXUSERS.

If it isn't a silly question, is this process using poll().
poll() is O(n) (or is it o(n)) on the highest fd [1] so you'll get better
performance by using more processes.

	David

[1] On a different OS, finding the file structure was O(n), making poll
O(n^2), so the cost of getting n connections open was O(n^3). Getting
many 1000 open connectios wasn't possible (we redesigned that daemon).

-- 
David Laight: david@l8s.co.uk