[PATCH RFC] configurable maximum number of clients

Olivier Fourdan ofourdan at redhat.com
Fri May 29 00:05:18 PDT 2015


Hi Alan,

----- Original Message -----
> Looking back at the notes from when the Solaris Xsun made similar changes
> long
> ago (on an X11R6.4 code base), they say we had to change:
>   - MAXCLIENTS
>   - MAXSOCKS
>   - OPEN_MAX
>   - TRANS_OPEN_MAX
>   - XFD_SETSIZE
> (If it's useful that Xsun code base is available, but without source history,
> at
>   https://java.net/projects/solaris-x11/downloads/directory/openXsun .)
> 
> I see in the current Xorg code it says
>   * MAXSOCKS is used only for initialising MaxClients when no other method
>   * like sysconf(_SC_OPEN_MAX) is not supported.
> and OPEN_MAX seems to just be used to set MAXSOCKS, and their use in
> InitConnectionLimits() seems to be used as an upper limit on MaxClients
> when other methods fail - should their default values be bumped from 256
> to 512 as well?  Or should they just be eliminated except for Cygwin now?

The idea actually was to bump MAXCLIENTS to 512 as the upper limit, and let the option set a lower value if needed.

But this is a port of an much older patch from 2009 where MAXCLIENTS was 512 by default (iirc) so I may very well have overlooked some other limits that might have been lowered since I wrote the patch initially...
 
> XFD_SETSIZE also still seems to be set to 256 in proto/x11proto/Xpoll.h.in
> which would limit the number of file descriptors you can monitor in the
> select() call in the main WaitForSomething() loop.
> 
> Similarly, I see Cygwin has set CFLAGS="$CFLAGS -DFD_SETSIZE=256" in
> configure.ac which may need to be bumped as well.
> 
> Or have you managed to get 512 clients to be connected and working without
> changing those?

Well, it worked in my simple test case (very basic test, opening 511 xterms at once - I plan on writing a more comprehensive test though ^_~) - I have two tests, one to check the number of resources available for a given connection and another one to check the number of connections that can be opened.

But you have a very good point with the other limits, I'll check those!

Thanks!
Olivier


More information about the xorg-devel mailing list