[MDEV-18410] Can't set mysqld_safe's open-files-limit to unlimited Created: 2019-01-29 Updated: 2023-04-27 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Scripts & Clients |
| Affects Version/s: | 10.1.37, 10.2.21, 10.3.12 |
| Fix Version/s: | 10.4 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Geoff Montee (Inactive) | Assignee: | Anel Husakovic |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | foundation | ||
| Issue Links: |
|
||||||||
| Description |
|
The value provided for mysqld_safe's open-files-limit option gets passed right to "ulimit" here:
The "ulimit" command accepts the special value of "unlimited" to represent no limit: https://ss64.com/bash/ulimit.html So it would make sense to be able to do the following:
However, this doesn't currently work because mysqld_safe appends its own value of open-files-limit to the list of arguments for mysqld here:
And since mysqld expects a numeric value for this option, it causes an error:
https://mariadb.com/kb/en/library/server-system-variables/#open_files_limit Maybe this should be changed, so that:
|
| Comments |
| Comment by Elena Stepanova [ 2019-01-29 ] | |||||||
|
Does it make sense, realistically? | |||||||
| Comment by Geoff Montee (Inactive) [ 2019-01-29 ] | |||||||
mysqld_safe executes "ulimit -n $open_files". The manual says that this does set both the hard and soft limit.
https://ss64.com/bash/ulimit.html
I think that it's reasonable to assume that MariaDB can manage file descriptors well enough, and that it's reasonable to set the open file limit to unlimited to guarantee that MariaDB can't run out of file descriptors. Anyway, it's probably pointless because it looks like the server itself won't allow an infinite limit right now. It sets the its own limit with setrlimit: https://github.com/MariaDB/server/blob/5abc79dd7ab2fccb4b05ca38a512ec816d2f8e52/mysys/my_file.c#L42 And it sets a maximum limit of OS_FILE_LIMIT on that limit: https://github.com/MariaDB/server/blob/5abc79dd7ab2fccb4b05ca38a512ec816d2f8e52/mysys/my_file.c#L102 And OS_FILE_LIMIT is defined as UINT_MAX (4294967295): Whereas RLIMIT_INFINITY seems to be defined as ULLONG_MAX on my system:
So OS_FILE_LIMIT and the maximum value of the server's open_files_limit variable would probably have to be increased to ULLONG_MAX to really set the limit to infinite: But it probably doesn't matter. open_files_limit=4294967295 might be effectively "unlimited" | |||||||
| Comment by Elena Stepanova [ 2019-01-29 ] | |||||||
Okay, sure, if we are only talking about running mysqld_safe as root, then it can increase the hard limit.
For how MariaDB server handles the issue, cvicentiu just recently was fixing something in the area, maybe he can comment on the latest status. |