Subject: Re: Xlib: Maximum number of clients reached
To: Geoff Wing <gcw@pobox.com>
From: Jeremy C. Reed <reed@reedmedia.net>
List: netbsd-help
Date: 10/16/2004 08:30:40
On Sat, 16 Oct 2004, Geoff Wing wrote:

> :>: I tried bumping the descriptors allowed
>
> :>You have to have this set before you start X.  It's unlikely to
> :>work setting it (e.g. via sysctl) after it's started.
>
> :if the x server is the piece "at fault", then this ought to help:
> :    # sysctl -w proc.`pgrep X`.rlimit.descriptors.soft=256
> :maybe?
>
> Unfortunately, no, it doesn't.  That's what I presumed Jeremy Reed tried
> and I specified that that approach would be unlikely to work in this case.

Yes, I had tried ahead of time.

rainier:/usr/pkgsrc$ sudo sysctl proc.2171.rlimit
proc.2171.rlimit.cputime.soft = unlimited
proc.2171.rlimit.cputime.hard = unlimited
proc.2171.rlimit.filesize.soft = unlimited
proc.2171.rlimit.filesize.hard = unlimited
proc.2171.rlimit.datasize.soft = 1073741824
proc.2171.rlimit.datasize.hard = 1073741824
proc.2171.rlimit.stacksize.soft = 33554432
proc.2171.rlimit.stacksize.hard = 33554432
proc.2171.rlimit.coredumpsize.soft = unlimited
proc.2171.rlimit.coredumpsize.hard = unlimited
proc.2171.rlimit.memoryuse.soft = 127148032
proc.2171.rlimit.memoryuse.hard = 127148032
proc.2171.rlimit.memorylocked.soft = 127148032
proc.2171.rlimit.memorylocked.hard = 127148032
proc.2171.rlimit.maxproc.soft = 300
proc.2171.rlimit.maxproc.hard = 532
proc.2171.rlimit.descriptors.soft = 1000
proc.2171.rlimit.descriptors.hard = 1772

Is there any tool to quickly count the different current usages of a
process? And of a process and all of its childred/descendents? (Or do I
need to just write scripts to parse ps and fstat output? Anyone already
do that?)

This is the same X server running last time too.
root  2171  0.0 15.1 33508 19756 ??  Ss    11Sep04 1126:53.49
/usr/X11R6/bin/X vt05 -nolisten tcp -auth /usr/X11R6/lib/X11/xdm/auth

> MaxClients for the server is set from getdtablesize() during initialisation.

I wonder why it is pre-set. Would it be inefficient to check this each
time a new X client requests/tells the X server it is there?

 Jeremy C. Reed

 	  	 	 BSD News, BSD tutorials, BSD links
	  	 	 http://www.bsdnewsletter.com/