[Qgis-user] File Descriptor Limits in Linux
Patrick Dunford
enzedrailmaps at gmail.com
Mon Sep 16 06:31:26 PDT 2024
Good day
For many years it has been known that applications such as Qgis running
under the Linux operating system have been subject to configuration of
maximum number of file descriptors for open files. Generally the default
is set to something like 1024 and will affect Qgis projects with more
than 1024 layers.
There are currently two limits in Linux that may affect users of Qgis
with a large number of layers in their project. These can be checked
using the ulimit -n command which will display the maximum number of
open files permitted in the current configuration.
1. PAM session limits are configured in the file /etc/security/limits.conf
2. On some distros, the limits also have to be separately configured for
systemd.
Ubuntu up to and including 22.04 requires only step 1 to be completed.
Debian 12 on the other hand requires step 2 to be completed. It is not
clear if this is a requirement on any other releases of Debian. However
experience suggests this step has not been a requirement on most earlier
Debian releases.
The specifics as far as I can determine for step 2 suggest that a .conf
file is placed in the following path:
/etc/systemd/user.conf.d
This file can be any name chosen by a user (e.g. limits.conf). The file
was copied from the user.conf file placed in /etc/systemd and it is also
the case that editing this user.conf file in its default path would have
the same effect, however the subdirectory usage is recommended.
This file must at a minimum contain the following:
[Manager]
DefaultLimitNOFILE=xxxxxx
This is a per-user limit and it does not apply to the root user. There
is a different procedure for the root user, which I do not have
documentation for. The result of ulimit -n run under a root shell will
display a different result from running it as a non-root user.
More information about the QGIS-User
mailing list