Bug 30358

Summary: xorg maxclients too restrictive -- please raise
Product: Mageia Reporter: Pierre Fortin <pfortin>
Component: RPM PackagesAssignee: Mageia Bug Squad <bugsquad>
Status: RESOLVED INVALID QA Contact:
Severity: enhancement    
Priority: Normal CC: fri, lewyssmith
Version: Cauldron   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Source RPM: CVE:
Status comment:

Description Pierre Fortin 2022-05-01 17:07:58 CEST
Description of problem: Within a few days of a reboot, I start bumping my head against Xorg MAXCLIENTS:
Maximum number of clients reachedError: Can't open display: :0

Version-Release number of selected component (if applicable):


How reproducible: too often.  I'm working on processing many terabytes of data (4 new 16TB drives on order).  
Using a new machine which has plenty of horsepower/memory: 
Operating System: Mageia 9
KDE Plasma Version: 5.24.4
KDE Frameworks Version: 5.93.0
Qt Version: 5.15.2
Kernel Version: 5.17.4-server-2.mga9 (64-bit)
Graphics Platform: X11
Processors: 20 × 12th Gen Intel® Core™ i7-12700K
Memory: 62.5 GiB of RAM
Graphics Processor: AMD Radeon RX 6600 XT


Steps to Reproduce:
1. make heavy use of the system (LOTS of apps/windows)
2. reach max
3. workflow is seriously impeded

Doubling MAXCLIENTS should be sufficient -- for now... :)
Comment 1 sturmvogel 2022-05-01 17:58:20 CEST
As this seems a corner case (not many users will reach maxclients), did you already try to raise the limit yourself? There are plenty of informations available (google search) and the recommended method is to use the ServerFlag section in /etc/X11/xorg.conf.d/99-maxclients.conf. You have to create this file before.
Lewis Smith 2022-05-01 21:27:48 CEST

CC: (none) => lewyssmith

Comment 2 Pierre Fortin 2022-05-01 22:02:22 CEST
(In reply to sturmvogel from comment #1)
> recommended method is to use the
> ServerFlag section in /etc/X11/xorg.conf.d/99-maxclients.conf. 

Didn't see this in my searches; thought it was a compile time setting.

For anyone else hitting this, determine what's possible:
Ctrl+Alt+F2 & login
$ /usr/bin/Xorg -maxclients 1000000000
(EE) 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

I decided to go to 1024 since I expect to be pushing this system much harder next week when my new drives come in...

THANKS!

Status: NEW => RESOLVED
Resolution: (none) => FIXED

Comment 3 Morgan Leijström 2022-05-04 09:49:55 CEST
Great we could help :)

We did not change anything in Mageia.

Choosing "invalid" as this is something we will not change (for now).

Please reopen if there is a valid reason to increase our default, and it do not hurt when running on low end hardware. (i.e low memory)

Resolution: FIXED => INVALID
CC: (none) => fri

Comment 4 Pierre Fortin 2022-05-04 15:22:07 CEST
(In reply to Morgan Leijström from comment #3)
 
> Please reopen if there is a valid reason to increase our default, and it do
> not hurt when running on low end hardware. (i.e low memory)

An idea: rather than use a default that prioritizes low end machines, it's possible to select settings such as MaxClients based on various clues in dmesg: 

[    0.000000] tsc: Detected 3600.000 MHz processor

[    0.202027] smpboot: Total of 20 processors activated (144384.00 BogoMIPS)

[    0.157474] Memory: 65388580K/66826680K available (...

There may be other/better sources of processor/memory; but this is from a quick check.

Not re-opening; but if this sounds like a reasonable idea, feel free to change this to enhancement...
Comment 5 sturmvogel 2022-05-04 15:51:03 CEST
You would need to file this request upstream (at Xorg?). This functionality would need a dynamic recognition of machine parameters. This is nothing which should be implemented at Mageia side. This is better placed overall over all distributions as already mentioned: upstream directly at the source.