How to increase Maximum number of clients?

I am lately often having problem with maximum number of clients reached.
How can I increaste this number?

I started getting this problem after I upgraded my PC RAM (from 32GB DDR4 to 64GB DDR4).

Maximum number of clients reachedMaximum number of clients reachedqt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.

When I closed some running applications, then I could start Kcalc.

This also happened some time later when I wanted to start Steam:

Steam logging initialized: directory: /home/user/.local/share/Steam/logs
XRRGetOutputInfo Workaround: initialized with override: 0 real: 0xf485f8f0
XRRGetCrtcInfo Workaround: initialized with override: 0 real: 0xf485e1c0
Maximum number of clients reached
Maximum number of clients reached
crash_20231016090433_5.dmp[146]: Uploading dump (out-of-process)
/tmp/dumps/crash_20231016090433_5.dmp
/home/user/.local/share/Steam/steam.sh: linje 798:   137 Minnesegmentsfeil       (kjerne lagret i fil) "$STEAMROOT/$STEAMEXEPATH" "$@"

Another time when I tried running Steam:

steamwebhelper.sh[143]: Running under Flatpak, disabling sandbox
steamwebhelper.sh[143]: CEF sandbox already disabled
Maximum number of clients reached
CAppInfoCacheReadFromDiskThread took 156 milliseconds to initialize
Maximum number of clients reached
Steam Runtime Launch Service: starting steam-runtime-launcher-service
Steam Runtime Launch Service: steam-runtime-launcher-service is running pid 225
steam-runtime-launcher-service[225]: E: Unable to acquire bus name "com.steampowered.PressureVessel.LaunchAlongsideSteam"
Maximum number of clients reached
Steam Runtime Launch Service: steam-runtime-launcher-service pid 225 exited
Steam Runtime Launch Service: starting steam-runtime-launcher-service
Steam Runtime Launch Service: steam-runtime-launcher-service is running pid 233
steam-runtime-launcher-service[233]: E: Unable to acquire bus name "com.steampowered.PressureVessel.LaunchAlongsideSteam"
Steam Runtime Launch Service: steam-runtime-launcher-service pid 233 exited
Steam Runtime Launch Service: starting steam-runtime-launcher-service
Steam Runtime Launch Service: steam-runtime-launcher-service is running pid 237
steam-runtime-launcher-service[237]: E: Unable to acquire bus name "com.steampowered.PressureVessel.LaunchAlongsideSteam"
Steam Runtime Launch Service: steam-runtime-launcher-service pid 237 exited
Steam Runtime Launch Service: steam-runtime-launcher-service keeps crashing on startup, disabling

I usually have two browsers open, along with Slack, Steam, Dolphin, Kate, Konsole
Vivaldi (80+ tabs)
Chromium (20+ tabs)
Notepadqq (20+ tabs)

mintaka: # lsof -U +c 15 | wc -l
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
      Output information may be incomplete.
lsof: WARNING: can't stat() fuse.portal file system /run/user/1000/doc
      Output information may be incomplete.
2308
mintaka: # lsof -U +c 15 | cut -f1 -d' ' | sort | uniq -c | sort -rn | head -3
    277 Vivaldi-Content
    239 X
    183 kded5

Today I am getting this problem when running only these 7 applications
Vivaldi (browser) - 186 tabs open
Kate - 4 tabs open
Notepadqq - 20 tabs open
Dolphin - 2 tabs open
Konsole - 5 tabs open
Slack
Signal

mintaka: # lsof -U +c 15 | wc -l
2148
mintaka: # lsof -U +c 15 | cut -f1 -d' ' | sort | uniq -c | sort -rn | head -3
    258 X
    199 kded5
    174 dbus-daemon

Maybe I should close some tabs in the browser, but why cannot my system handle it?

x11 - Does X-Window have a maximum number limit on clients? - Unix & Linux Stack Exchange

Not very helpful.
Just some flags for running Xorg manually.
I cannot find any configuration with OpenSUSE to set MaxClients. Not in /etc/X11/xorg.conf, or any other configuration file. Nothing in YaST either for this.

Perhaps I can try creating this file:

cat /etc/X11/xorg.conf.d/99-maxclients.conf
Section "ServerFlags"
        Option "MaxClients" "512"
EndSection

This is the way how it is done for all distributions. There is no fancy GUI to set the limit. You need to create a file and set a limit. Thats it. Plenty informations available for this.

maxclients must be one of 64, 128, 256, 512, 1024 or 2048

Find current max:

$ grep -i "max clients" /var/log/Xorg.0.log
[    34.784] (==) Max clients allowed: 256, resource mask: 0x1fffff

Set a new limit:

# printf 'Section "ServerFlags"\n\tOption "MaxClients" "512"\nEndSection\n' \
        > /etc/X11/xorg.conf.d/99-maxclients.conf

Restart X

@DJViking you could always look at running xrestop to see what application is consuming what resources…

My default client setting is 512 for this system…