[PATCH RFC] configurable maximum number of clients

Alan Coopersmith alan.coopersmith at oracle.com
Thu May 28 14:43:11 PDT 2015


On 05/28/15 08:56 AM, Olivier Fourdan wrote:
> Make the maximum number of client user configurable, either from the command
> line or from xorg.conf
>
> This patch works by keeping the MAXCLIENTS define (of 512) as the maximum
> allowed number of clients, but allowing the actual limit to be set by the
> user (default to 256).
>
> There is a limit size of 29 bits to be used to store both the client ID and
> the X resources ID, so by reducing the number of clients allowed to connect to
> the X server, the user can increase the number of X resources per client.
>
> Parts of this patch are based on a similar patch from Adam Jackson
> <ajax at redhat.com>
>
> Signed-off-by: Adam Jackson <ajax at redhat.com>
> Signed-off-by: Olivier Fourdan <ofourdan at redhat.com>

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?

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?

-- 
	-Alan Coopersmith-              alan.coopersmith at oracle.com
	 Oracle Solaris Engineering - http://blogs.oracle.com/alanc


More information about the xorg-devel mailing list