<div dir="ltr"><div dir="ltr">Hi Anuj,<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Aug 14, 2023 at 8:27 PM Anuj Phogat <<a href="mailto:anuj.phogat@gmail.com" target="_blank">anuj.phogat@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">- I'm still getting the "_XSERVTransSocketUNIXAccept: accept() failed" error<br>
after launching ~ 256 instances of vkcube. I was able to find the root<br>
cause of error after patching libxtrans based on Adam's suggestion:<br>
"_XSERVTransSocketUNIXAccept: accept() failed (Too many open files)"<br>
- Based on the hint from the error string, I changed the system wide limit to<br>
increase the maximum number of open files allowed from default 1024 to<br>
'ulimit -n' confirmed the new limit. But, this change doesn't change<br>
the error past launching ~ 256 instances of vkcube.<br>
- I hit the same error but at ~330 instances when I try to run glxgears.<br>
<br>
Questions:<br>
What am I missing when changing the open files limit ?<br></blockquote><div><br></div><div>Make sure the X process has inherited that limit, depending on how/where you bumped the limit, the X server process may not have that applied.</div><div><br></div><div>You can check using the /proc filesystem on Linux:</div><div><br></div><div>$ cat /proc/$(pidof Xorg)/limits <br></div><div></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
What else can I try to get past this error ?<br></blockquote><div><br></div><div>If you can get 330 instances of glxgears, it means that you are already past the 256 limit, hence the maxclients worked.</div><div><br></div><div>It is worth noting that the limit applies to all X11 clients, so if you run a window manager, an xterm, etc, everything counts.</div><div><br></div><div>Also if a client opens more than one connection to the X server, that also counts. So you can expect that a limit of 512 might give you a lower actual limit.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Should I reopen xserver issue [1] or create a new issue to track it ?<br></blockquote><div><br></div><div>I doubt that this is an X server issue.</div><div><br></div><div>FWIW, I just tried here with Xwayland rootful and was able to run 474 instances of vkcube on a rootful stanlone Xwayland instance:</div><div><br></div><div>$ Xwayland -maxclients 512 -decorate :12 7</div><div>$ for i in $(seq 1 512); do DISPLAY=:12 vkcube& done</div><div>$ ps aux | grep vkcube | wc -l<br>474</div><div><br></div><div>I have seen some "Maximum number of clients reached" errors while the vkcube instances were spawning en masse, so I suspect maybe the vulkan implementation is opening a connection to the display for some reason temporarily, so having those start all at once may lead to a lower actual limit of clients..</div><div><br></div><div>To confirm that theory, I dedid the same test waiting a bit between each instance of vkcube.</div><div><br></div><div>And nowI can reach the limit of 512:</div><div><br></div><div>$ for i in $(seq 1 512); do DISPLAY=:12 vkcube; sleep .2 & done</div><div>$ ps aux | grep vkcube | wc -l<br>512<br></div><div><br></div><div>So yeah, no bug in the Xserver AFAICS.<br></div><div> </div><div>This is with:</div><div><br></div><div>$ cat /proc/$(pidof Xwayland)/limits <br>Limit Soft Limit Hard Limit Units <br>Max cpu time unlimited unlimited seconds <br>Max file size unlimited unlimited bytes <br>Max data size unlimited unlimited bytes <br>Max stack size 8388608 unlimited bytes <br>Max core file size unlimited unlimited bytes <br>Max resident set unlimited unlimited bytes <br>Max processes 62319 62319 processes <br>Max open files 16777216 16777216 files <br>Max locked memory 8388608 8388608 bytes <br>Max address space unlimited unlimited bytes <br>Max file locks unlimited unlimited locks <br>Max pending signals 62319 62319 signals <br>Max msgqueue size 819200 819200 bytes <br>Max nice priority 0 0 <br>Max realtime priority 0 0 <br>Max realtime timeout unlimited unlimited us <br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
[1] : <a href="https://gitlab.freedesktop.org/xorg/xserver/-/issues/1310" rel="noreferrer" target="_blank">https://gitlab.freedesktop.org/xorg/xserver/-/issues/1310</a><br></blockquote><div><br></div><div>Cheers</div><div>Olivier <br></div><div><br></div><div> </div></div></div>