Score:2

How increase the "loaded units" systemd

de flag

we use chrome remote desktop to perform remote access to ubuntu, but I am not able to enable more than 32 users (each user is a systemctl unit and after reaching 32 unit loaed, I cannot start others).

to list the loaded units use the command:

sudo systemctl reset-failed && sudo systemctl list-units 'chrome-remote*'

to activate the unit I use the command

sudo systemctl stop chrome-remote-desktop@<user>.service

  • sudo systemctl status chrome-remote-desktop@user.service

● chrome-remote-desktop@user.service - Chrome Remote Desktop instance for user
     Loaded: loaded (/etc/systemd/system/chrome-remote-desktop@.service; enabled; vendor preset: enabled)
     Active: inactive (dead) since Fri 2023-03-10 04:48:04 -03; 4min 5s ago
    Process: 58249 ExecStart=/opt/google/chrome-remote-desktop/chrome-remote-desktop --start --new-session (code=exited, status=1/FAILURE)
   Main PID: 58249 (code=exited, status=1/FAILURE)

sudo journalctl -u chrome-remote-desktop@<user>.service

mar 10 04:28:35 <host_name> chrome-remote-desktop[8639]: Invalid MIT-MAGIC-COOKIE-1 keyxdpyinfo: unable to open display ":25".
mar 10 04:28:36 <host_name> chrome-remote-desktop[8671]: Invalid MIT-MAGIC-COOKIE-1 keyxdpyinfo: unable to open display ":25".
mar 10 04:34:10 <host_name> chrome-remote-desktop[46517]: Killing process 31788
mar 10 04:35:23 <host_name> chrome-remote-desktop[49840]: Invalid MIT-MAGIC-COOKIE-1 keyxdpyinfo: unable to open display ":50".
mar 10 04:35:24 <host_name> chrome-remote-desktop[49841]: Invalid MIT-MAGIC-COOKIE-1 keyxdpyinfo: unable to open display ":50".
mar 10 04:35:24 <host_name> chrome-remote-desktop[49847]: Invalid MIT-MAGIC-COOKIE-1 keyxdpyinfo: unable to open display ":50".

How could I increase "units loaded" by leaving all services "active" and 'running'?

best

Score:0
iq flag

Yes systemd has a default limit of 32 units that can be loaded at once, you can fix that by modifying the DefaultTasksMax setting in the systemd configuration file.

go to /etc/systemd/system.conf

search DefaultTasksMax and put it to infinity like that DefaultTasksMax=infinity

then reload systemctl sudo systemctl daemon-reload it should work

hr flag
I'm curious how you established the value of 32 units here? How exactly is that related to the DefaultTasksMax value (which appears to be `DefaultTasksMax=15%` in the default /etc/systemd/system.conf file). The documentation suggests it's expressed as a percentage of the /proc/sys/kernel/pid_max value, giving a "default default" of 0.15 x 32768 = 4915 even on a 32-bit system. Is this really the max number of units, or is it the max number of tasks that an individual unit may create?
Saxtheowl avatar
iq flag
It just was the value on the VM I was on
Rafael avatar
de flag
I made the suggested adjustment. All users appear as loaded, but after 32 loaded units, the rest are inactive and dead
Rafael avatar
de flag
I put in the initial question the status of the user which would be "33 loaded units". I started 32 users. One of these was my user. so I stopped him, started another one. After that my user had the status indicated above
Saxtheowl avatar
iq flag
what does sudo journalctl -u <your service> give you ?
Rafael avatar
de flag
I put the journalctl return at the end of the question above
Saxtheowl avatar
iq flag
I think your problem is a ressources limit like memory or CPU running out of availability or a dependencies one which will force the system to mark your units as inactive or dead, maybe chrome need a ressources that can be opened more than 32 times ? you should check dmesg too
Rafael avatar
de flag
CPU and memory I believe are not a problem due to the hardware of the machine (RAM 32GB and AMD Ryzen 9 5950X 16-Core Processor)
Rafael avatar
de flag
what should i look for in dmesg? systemd services won't show up there correct?
Saxtheowl avatar
iq flag
We can try something new, go to /etc/systemd/system.conf with sudo search a line #DefaultInstancesMax and remove the leading # or add the variable it at the end of the file so that you have DefaultInstancesMax=64 then reload sudo systemctl daemon-reload
Rafael avatar
de flag
I still haven't been successful in having more than 32 active users. any suggestion is welcome!
Saxtheowl avatar
iq flag
Lets try the file /etc/sysctl.conf , modify it by adding this line fs.file-max = 65536 then apply it sudo sysctl -p
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.