Score:1

Systemd maximum number of services

io flag
Lev

Is there is a limit on how many services I can create with systemd? Let's assume I'm installing the service units into ~/.config/systemd/user/ or /etc/systemd/system/. I'm using Ubuntu 20.04 LTS.

anx avatar
fr flag
anx
You are not going to enjoy some O(n) operations in systemd long before you even get to the point where it stops making any sense to spawn more because they will not do work because balancing disk I/O (or network, or inotify watches, or whatever else they wait for..) only works for so many services. Please [describe](https://serverfault.com/posts/1116008/edit) the goal, trying to spawn a huge amount of services smells a lot like [XY problem](https://meta.stackexchange.com/questions/66377/what-is-the-xy-problem).
jm flag
I agree with @anx. I have not confirmed it against source but I think the limit is somewhere around 64k services. You will start having issues reading the directories with that many service files and systemd will have major problems figuring out the dependencies and timings. Running tens of thousands of services is unlikely to be a reasonable solution to whatever problem you're trying to solve.
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.