After upgrading MariaDB to 10.5 Seafile stopped working. journalctl
showed errors like the following for mariadb.service
:
[Warning] Aborted connection 62 to db: 'seafile_ccnet-db' user: 'seafile' host: 'localhost' (Got an error reading communication packets)
Further investigation revealed the open files limit to be the root cause:
root@server:~# mysql -e "SHOW VARIABLES LIKE 'open_files_limit';"
+------------------+-------+
| Variable_name | Value |
+------------------+-------+
| open_files_limit | 32768 |
+------------------+-------+
To increase the limit the corresponding Systemd unit needs to be overriden using systemctl edit mariadb.service
. This creates /etc/systemd/system/mariadb.service.d/override.conf
:
[Service]
LimitNOFILE=65536
Also, MariaDB needs a configuration modification, e.g. in /etc/mysql/mariadb.conf.d/77_tuning.conf
:
[mysqld]
open_files_limit = 65536