summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Black <daniel@mariadb.org>2021-04-27 08:17:37 +1000
committerDaniel Black <daniel@mariadb.org>2021-04-27 08:17:40 +1000
commita35cde8cd8364edc0a23752fc5fde442c8b78a0a (patch)
tree17b97a68dca1a50482bfeefa44d1009086b80a6e
parent2f6912dabcb85382eea004f590ad51815c20e5c5 (diff)
downloadmariadb-git-a35cde8cd8364edc0a23752fc5fde442c8b78a0a.tar.gz
MDEV-25513: raise systemd LimitNOFILE limits to match server defaults
Quoting MDEV reporter Daniel Lewart: Starting MariaDB with default configuration causes the following problems: "[Warning] Could not increase number of max_open_files to more than 16384 (request: 32186)" silently reduces table_open_cache_instances from 8 (default) to 4 Default Server System Variables: extra_max_connections = 1 max_connections = 151 table_open_cache = 2000 table_open_cache_instances = 8 thread_pool_size = 4 LimitNOFILE=16834 is in the following files: support-files/mariadb.service.in support-files/mariadb@.service.in Looking at sql/mysqld.cc lines 3837-3917: wanted_files= (extra_files + max_connections + extra_max_connections + tc_size * 2 * tc_instances); wanted_files+= threadpool_size; Plugging in the default values: wanted_files = (30 + 151 + 1 + 2000 * 2 * 8 + 4) = 32186 However, systemd configuration has LimitNOFILE = 16384, which is far smaller. I suggest increasing LimitNOFILE to 32768.
-rw-r--r--support-files/mariadb.service.in2
-rw-r--r--support-files/mariadb@.service.in2
2 files changed, 2 insertions, 2 deletions
diff --git a/support-files/mariadb.service.in b/support-files/mariadb.service.in
index 245c506c117..7c885b1f6e9 100644
--- a/support-files/mariadb.service.in
+++ b/support-files/mariadb.service.in
@@ -142,7 +142,7 @@ TimeoutStopSec=900
##
# Number of files limit. previously [mysqld_safe] open-files-limit
-LimitNOFILE=16384
+LimitNOFILE=32768
# Maximium core size. previously [mysqld_safe] core-file-size
# LimitCore=
diff --git a/support-files/mariadb@.service.in b/support-files/mariadb@.service.in
index a487e22521b..d625ce67396 100644
--- a/support-files/mariadb@.service.in
+++ b/support-files/mariadb@.service.in
@@ -168,7 +168,7 @@ TimeoutStopSec=900
##
# Number of files limit. previously [mysqld_safe] open-files-limit
-LimitNOFILE=16384
+LimitNOFILE=32768
# Maximium core size. previously [mysqld_safe] core-file-size
# LimitCore=