Commit 164217e4 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

increase the maximum number of open file descriptors before starting mysqld.

so that we can really have max_connections=1000 as written in mariadb.cnf.
parent 6b2cb760
......@@ -34,6 +34,16 @@ def runMysql(args):
print "Starting %r" % mysqld_wrapper_list[0]
sys.stdout.flush()
sys.stderr.flush()
# increase the maximum number of open file descriptors.
# it seems that mysqld requires (max_connections + 810) file descriptors.
try:
import resource
required_nofile = 2048 # XXX hardcoded value more than 1000 + 810
nofile_limit_list = [max(x, required_nofile) for x in resource.getrlimit(resource.RLIMIT_NOFILE)]
resource.setrlimit(resource.RLIMIT_NOFILE, nofile_limit_list)
except ImportError:
# resource library is only available on Unix platform.
pass
os.execl(mysqld_wrapper_list[0], *mysqld_wrapper_list)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment