Bug #92647 Unable to natively increase default number of open file descriptors.
Submitted: 3 Oct 2018 3:46 Modified: 4 Oct 2018 5:06
Reporter: IT Services Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Router Severity:S2 (Serious)
Version:8.0.12-1 OS:CentOS (6)
Assigned to: CPU Architecture:x86

[3 Oct 2018 3:46] IT Services
Description:
By default only 1024 file descriptors are available to mysqlrouter process.
There is no way this can be increased either by setting new nofile limits in /etc/security/limits.conf nor by means of some options file.

Have devised two, not very elegant work-arounds:

1. Modify service startup script /etc/init.d/mysqlrouter to include ulimit command
2. Adjust nofile limit by writing to running router's process "limits" pseudo-file in /proc.

First method is prone to removal by version updates or package integrity verifications.
Second method is reactive and would require a script to run periodically to find and update limits of router's process, whenever it is restarted.

Without this limit being raised, having mysqlrouter serving more that 500 connections is not possible.

How to repeat:
Start mysqlrouter service.
Find PID of router process.
Read "Max open files" line from /proc/<PID>/limits file.
[3 Oct 2018 9:45] MySQL Verification Team
Thanks for your report!

all best
Bogdan
[4 Oct 2018 5:06] IT Services
Oh, there is one rather nasty consequence of mysqlrouter process running out of file descriptors. Even with logger level set to ERROR, mysqlrouter.log accumulates between 2 and 3 million lines per minute. In a test scenario it took about 7 minutes to generate ~2.2GB file.
In real-life situations, free space on root FS was exhausted on two separate occasions.