Tuesday, May 14, 2024
 Popular · Latest · Hot · Upcoming
20
rated 0 times [  20] [ 0]  / answers: 1 / hits: 34121  / 1 Year ago, mon, march 13, 2023, 9:22:07

Ubuntu: 12.04 LTS (Linux mysql02 3.2.0-40-generic #64-Ubuntu SMP Mon Mar 25 21:22:10 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux)



MySQL: Ubuntu distro 5.5.31



Apparmor: REMOVED!



Server has been running rock solid for over a year. Then this Monday MySQL began failing. An update has caused the problem and we cannot figure it out what it is. We have even tried to roll back to MySQL 5.5.30 but with no luck. We returned at 5.5.31.



MySQL error log entries:



130430  7:55:46 [ERROR] Error in accept: Too many open files
130430 7:55:46 [ERROR] /usr/sbin/mysqld: Can't open file: './eci_elite_test/fclvod.frm' (errno: 24)
130430 7:55:46 [ERROR] /usr/sbin/mysqld: Can't open file: './eci_elite_test/fcnote.frm' (errno: 24)
130430 7:55:47 [ERROR] /usr/sbin/mysqld: Can't open file: './eci_elite_test/ffcont.frm' (errno: 24)
130430 7:55:47 [ERROR] /usr/sbin/mysqld: Can't open file: './eci_elite_test/ffcontv.frm' (errno: 24)
130430 7:55:47 [ERROR] /usr/sbin/mysqld: Can't open file: './eci_elite_test/ffnote.frm' (errno: 24)
130430 7:55:47 [ERROR] /usr/sbin/mysqld: Can't open file: './eci_elite_test/frcfcl.frm' (errno: 24)


It appears we are running into ulimit problem. We have removed APPARMOR completely. We have increased the /etc/security/limits.conf and still no luck:



# Out of desperation....
* soft nofile 49152
* hard nofile 65536

# No effect!?!!?
#mysql soft nofile 49152
#mysql hard nofile 65536


And to show the limits.conf is working:



root@mysql02:/etc/security# ulimit -Sa | grep "open files"
open files (-n) 49152

root@mysql02:/etc/security# ulimit -Ha | grep "open files"
open files (-n) 65536


And here are the important entries in my.cnf



[mysqld_safe]
open_files_limit = 16384

[mysqld]
open_files_limit = 16384


However:



root@mysql02:/etc/mysql# mysqladmin -u root -pThePassword variables| grep open_files_limit
open_files_limit | 1024


We are totally stumped and down. Any assistance would be greatly appreciated.


More From » 12.04

 Answers
2

OS: Ubuntu (Debian) deployments



MySQL Server Option: open-files-limit



It seems that the Debian upstart doesn't use the parameters defined in /etc/security/limits.conf, so when you launch mysql through the service command (and so, under upstart), it overrides those defined limits and uses the default 1024.



The solution is to modify the mysql.conf file that defines the upstart service, it is located in /etc/init/mysql.conf and add the following lines before the pre-start block:



# NB: Upstart scripts do not respect
# /etc/security/limits.conf, so the open-file limits
# settings need to be applied here.
limit nofile 32000 32000
limit nproc 32000 32000


References:




[#31476] Tuesday, March 14, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tocklftime

Total Points: 110
Total Questions: 109
Total Answers: 100

Location: Mayotte
Member since Mon, Sep 12, 2022
2 Years ago
tocklftime questions
Wed, Feb 1, 23, 21:50, 1 Year ago
Tue, Oct 4, 22, 21:42, 2 Years ago
Sun, Jul 25, 21, 10:43, 3 Years ago
;