Increasing the maximum number of files open

Hi there!

In order to play a game with Lutris, it seems I need to be able to " increasing the maximum number of files open".

The wiki of Lutris states the familiar ways to achieve this; Editing /etc/systemd/system.conf and /etc/systemd/user.confDefaultLimitNOFILE=524288.

This edit however, seems to have now effect on my machine:

Output of ulimit -Hn after reboot: 4096

The limit is most likely specific here: /usr/lib/systemd/system.conf.d/40-core-ulimit.conf

Am I missing something obvious? Are these kinds of settings (in /etc/...) not the way to configure Clear Linux?

Best regards,
Oliver

1 Like

I had to specify it in /etc/security/limits.conf as described here: How to: Esync · lutris/lutris Wiki · GitHub for it to take affect. . See @pmccarty’s response below for the proper way.

The default limit in CL is supposed to be high but might not working as intended. @pmccarty we were discussing this.

I had to specify it in /etc/security/limits.conf as described here: How to: Esync · lutris/lutris Wiki · GitHub for it to take affect.

Thanks. I dismissed that because the wiki said “On Linux distributions not using Systemd …”, but obviously it is more nuanced than that.

The default value seems to have been 4096.
That is too low because of 3 use cases:

  • syncing files (syncthing)
  • compiling code and filesystem watchers (inotify)
  • games (apparently)

Just to be curious

your files were like

[Manager]                                                                       
DefaultLimitNOFILE=524288

for the systemd, user and system??

Still are :slight_smile:

> cat /etc/systemd/system.conf /etc/systemd/user.conf
[Manager]
DefaultLimitNOFILE=524288
[Manager]
DefaultLimitNOFILE=524288

Hi @bugabinga,

I ran into this exact issue the other day.

Because the configuration snippet /usr/lib/systemd/system.conf.d/50-nfiles.conf is installed, which sets DefaultLimitNOFILE=4096, you have to override the value with a configuration snippet in /etc/systemd/system.conf.d/ instead. Overriding DefaultLimitNOFILE in /etc/systemd/system.conf has no effect due to systemd’s config precedence order.

3 Likes

I am a Syncthing user
whenever I boot and start Syncthing I get an inotify error
from the Syncthing docs (FAQ — Syncthing documentation) I am told to run:
echo “fs.inotify.max_user_watches=204800” | sudo tee -a /etc/sysctl.conf
and further it says
This only takes effect after a reboot. To adjust the limit immediately, run:
sudo sh -c ‘echo 204800 > /proc/sys/fs/inotify/max_user_watches’

It does work, but I need to repeat on every login.

Using Debian for several years, this is different, I do it once and never have to repeat later.

Is there some way to retain that first command?
Thanks, Peter

forgive me if this is obvious, but I am a GUI Guy and have only been using ClearOS for about a week

sudo mkdir -p /etc/sysctl.d
echo "fs.inotify.max_user_watches = 524288" > sudo tee /etc/sysctl.d/max_user_watches.conf

reboot

| !
:wink:

======================