Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
MariaDB, too many files open
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Letharion
Veteran
Veteran


Joined: 13 Jun 2005
Posts: 1344
Location: Sweden

PostPosted: Thu Aug 09, 2018 2:49 pm    Post subject: MariaDB, too many files open Reply with quote

Example
Code:
> SELECT * FROM users;
ERROR 1030 (HY000): Got error 24 "Too many open files" from storage engine TokuDB


Ok, presumably this is because I recently imported a new DB, and now the number of files the server keeps open exceeds 1024, (one file per table).
Lets drop some old stuff I don't need:

Code:
> drop database [db_name];
ERROR 1030 (HY000): Got error 24 "Too many open files" from storage engine MyISAM


Well that's annoying. So lets try to raise the limit:
Code:
$ grep "^user" /etc/mysql/my.cnf
user                                            = mysql
$ grep mysql /etc/security/limits.conf
mysql soft      nofile  2048
$ sudo /etc/init.d/mysql restart
$ cat /proc/1339/limits  | grep open
Max open files            1024                 4096                 files


No dice. Some googling suggests this might be PAM related, but I haven't been able to figure out just how yet.
Back to top
View user's profile Send private message
ct85711
Veteran
Veteran


Joined: 27 Sep 2005
Posts: 1791

PostPosted: Thu Aug 09, 2018 3:22 pm    Post subject: Reply with quote

Just doing a quick search, I found this: https://mariadb.com/kb/en/library/cannot-increase-open-files-limit/

One thing it mentioned, is even if you are not using systemd ; some systemd config files are overwriting the service's configs (the joys of having systemd using their own configs instead of the standard config locations).
Back to top
View user's profile Send private message
Letharion
Veteran
Veteran


Joined: 13 Jun 2005
Posts: 1344
Location: Sweden

PostPosted: Fri Aug 10, 2018 9:28 am    Post subject: Reply with quote

Thanks, I couldn't get any where with either of those answers, or similar searches I made myself. I ended up doing a temporary solution.
Code:
sudo su
ulimit -n 9999
/etc/init.d/mysql restart

This way mysql inherited the shells new limit, and I could delete from of the old DBs I didn't need. It's not a great solution as the next time it restart it'll have it's old settings back, but it allowed me to do what I needed for now.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum