Bug #74274 Official MySQL distro for Ubuntu not playing nice
Submitted: 8 Oct 2014 14:52 Modified: 2 Dec 2016 9:43
Reporter: Van Stokes Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Packaging Severity:S2 (Serious)
Version:5.6.21 OS:Linux (Ubuntu 14.04.1 x64)
Assigned to: CPU Architecture:Any
Tags: file, handles, limit, nofile, noproc, ubuntu

[8 Oct 2014 14:52] Van Stokes
Description:
The official MySQL distro from the MySQL APT repository doesn't play nice with Ubuntu. Most importantly, the official MySQL distro does not configure it's service with proper limits. The distribution can quickly runs out of file handles if the my.cnf file is modified to permit large number of file handles.

This does not occur when installing Ubuntu's distro of MySQL.

How to repeat:
1) Install MySQL from MySQL APT onto Ubuntu.
2) Update my.cnf:   open-files-limit = 64K
3) Hit server hard and watch for the 'out of file handles' error message.

Suggested fix:
#   You may also need to modify the UPSTART configuration file:
#   /etc/init/mysql.conf to increase the number resources available to MySQL.
#   Here are the suggested entries and these lines need to be BEFORE the
#   PRE-START block:
#
#      limit nofile 72000 72000
#      limit nproc 32000 32000
#

See http://dev.mysql.com/doc/refman/5.5/en/server-options.html#c12634
[2 Dec 2016 9:43] Terje Røsten
Hi!

Default open files is now set to 5000:

https://github.com/mysql/mysql-server/blob/5.7/packaging/deb-in/mysql-packagesource-server...

to increase further, please read:

  https://dev.mysql.com/doc/refman/5.7/en/using-systemd.html

which will explain how to do local configuration changes to mysql service
that will persist after upgrade of packages.