I'm running a headless VNC server (TigerVNC with Xfce). I need to increase the maximum allowed number of X clients because I'm hitting the 256 limit (yes I've got that many) and I get the "Maximum number of clients reached" error.
I read here that you can increase it either with the -maxclients option on the xserver or with the appropriate configuration in /etc/X11/xorg.conf.d/99-maxclients.conf. I don't think that applies to VNC though and I couldn't find any similar option for the vncserver command.
I tried to pass the -maxclients 512 option to startxfce4 in ~/.vnc/xstartup but it is ignored.