Comments - Cannot increase open-files-limit

8 years, 11 months ago Raquel James

I created /lib/systemd/system/mysqld.service with the referenced settings - no change.

 
5 years, 4 months ago Wagner Bianchi

It's for sure really annoying, but, after attempting some additional steps as per the MariaDB docs, one can get it like below. The message is the one like below:

[Warning] InnoDB: innodb_open_files 65500 should not be greater than the open_files_limit 16364

I started the MariaDB Server 10.3.11 with the below configs:

mariadb@db-d01:$ my_print_defaults mysqld | grep files --innodb_open_files=65533 --open_files_limit=65533

I suspected something was blocking the limits of open_files_limit while innodb_open_files were going over and giving me that message. Looking for additional documents pointed by Ian Gilfillan, I found the below that the open_files_limit is limited by default at 16k (16364); a number which appears everywhere.

So, to increase that number, as we need to take it to `65533` to give it a full room, we need to change the `LimitNOFILE=16364` to `LimitNOFILE=65533` in the mariadb.service unit and enter the below command:

mariadb-dba@mortality-db-d01:$ sudo systemctl daemon-reload

It’s going to reload units located under the systemD subsystem which is going to make it possible to start the `mariadb.service` with that new definition. The ulimit is not an option anymore to tune open files, so, we check the new limit out of prlimit, as below:

mariadb@db-d01:$ sudo prlimit --pid=$(pidof mysqld) | grep NOFILE NOFILE max number of open files 65533 65533

Why prlimit? https://lzone.de/cheat-sheet/ulimit

And then, we can add to the current configuration file the below: --innodb_open_files=65533 --open_files_limit=65533

No warnings on the error log enymore: `2018-12-13 10:40:59 0 [Note] InnoDB: Using Linux native AIO 2018-12-13 10:40:59 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 2018-12-13 10:40:59 0 [Note] InnoDB: Uses event mutexes 2018-12-13 10:40:59 0 [Note] InnoDB: Compressed tables use zlib 1.2.8 2018-12-13 10:40:59 0 [Note] InnoDB: Number of pools: 1 2018-12-13 10:40:59 0 [Note] InnoDB: Using SSE2 crc32 instructions 2018-12-13 10:40:59 0 [Note] InnoDB: Initializing buffer pool, total size = 7G, instances = 8, chunk size = 128M 2018-12-13 10:40:59 0 [Note] InnoDB: Completed initialization of buffer pool 2018-12-13 10:40:59 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority(). 2018-12-13 10:41:00 0 [Note] InnoDB: 128 out of 128 rollback segments are active. 2018-12-13 10:41:00 0 [Note] InnoDB: Creating shared tablespace for temporary tables 2018-12-13 10:41:00 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ... 2018-12-13 10:41:00 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB. 2018-12-13 10:41:00 0 [Note] InnoDB: 10.3.11 started; log sequence number 105534396886311; transaction id 929353557 2018-12-13 10:41:00 0 [Note] InnoDB: Loading buffer pool(s) from /Database/prod/ib_buffer_pool 2018-12-13 10:41:00 0 [Note] Plugin 'FEEDBACK' is disabled. 2018-12-13 10:41:00 0 [Note] Server socket created on IP: '0.0.0.0'. 2018-12-13 10:41:00 0 [Note] Server socket created on IP: '0.0.0.0'. 2018-12-13 10:41:00 0 [Warning] 'proxies_priv' entry '@% root@db07' ignored in --skip-name-resolve mode. 2018-12-13 10:41:00 0 [Note] Reading of all Master_info entries succeded 2018-12-13 10:41:00 0 [Note] Added new Master_info '' to hash table 2018-12-13 10:41:00 0 [Note] /usr/sbin/mysqld: ready for connections. Version: '10.3.11-MariaDB-1:10.3.11+mariaxenial-log' socket: '/var/run/mysqld/mysqld.sock' port: 3306 mariadb.org binary distribution 2018-12-13 10:41:52 0 [Note] InnoDB: Buffer pool(s) load completed at 181213 10:41:52

So, that way, you can raise the files limite.

 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.