We set a value of -1 for the open_files_limit in galera.conf
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
tripleo |
Expired
|
Undecided
|
Unassigned |
Bug Description
The tripleo-
For example you can check on a controller node:
[root@overcloud
/etc/my.
I don't think this is a serious bug, but was reported to me and is very cheap to fix, at least making it 0 by default. Fixup incoming
thanks, marios
[1] https:/
[2] https:/
[3] https:/
Changed in tripleo: | |
assignee: | nobody → Marios Andreou (marios-b) |
importance: | Undecided → Low |
Changed in tripleo: | |
status: | Triaged → In Progress |
Marios Andreou (marios-b) wrote : | #2 |
Marian Krcmarik (mkrcmari) wrote : | #3 |
I've seen mysql_safe log to complain about open_file_limits to be set to -1. So I was poking around and the situation is a little bit confusing.
Afaik open file limit is set for mysqld daemon as value calculated in following way:
max(max(
In the case of openstack deployed by tripleo the max value is "max_connections*5" (we set max_connections in galera.cnf to 4096 + 1 extra connection) which is 20485 and this number is set as open file limit of mysqld. Even though open_files_limit is incorrectly set to -1, It's overridden by setting --open_
The question is how was it possible I saw mysqld_safe complaining about open_file_limits being set to -1. The reason is that when a failover in HA based Openstack happens and resource agent tries to handle recover of galera node, It starts mysqld_safe to find last commit in detect_
The quick solution would be to set open_files_limit in galera.cnf to something high enough or fix the galera resource agent to use --open_files_limit option when starting mysqld_safe to find last commit after failover. But I do not like the fact that open_files_limit option can be set at two different places, either in galera.cnf or as galera resource attribute while resource attribute overrides open_files_limit set in galera.cnf and the other options set in galera.cnf (max_conenctions, table_cache_size) have influence at final value set as the limit. The best would be to set it at one place - galera.cnf and remove the resource attribute "additional_
max_connections = 4096
open_files_limit = 20485
If and admin want to increase the value of open file limit, They can increase the number of connections or open_files_limit option in galera.cnf and does not need to keep in mind that galera resource could override open_files_limit value when starting mysefld_safe.
[1] https:/
[2] https:/
[3] https:/
Tim Rozet (trozet) wrote : | #4 |
I think this bug goes a little farther than just the setting in galera.cnf. The default ulimit setting is 1024, so no matter what mariadb calculates the value to be, it will always be set to 1024. At least that is what I see on noHA deployments. We see noHA deployments eventually stop working because we see:
DBAPIError exception wrapped from (pymysql.
I think this bug priority should be changed to high more because of the low limit set for the system. There are a couple of ways to do this:
/etc/security/
mysql soft nofile 65535
mysql hard nofile 65535
or add to the systemd unit file /usr/lib/
LimitNOFILE=65535
LimitNPROC=65535
Tim Rozet (trozet) wrote : | #5 |
Another setting to also consider for keeping file limit low:
http://
Damien Ciabrini (dciabrin) wrote : | #6 |
I stumbled upon the same issue a while ago when troubleshooting galera startups, so I've blogged in [1] on how mysqld* is impacted by open_files_limit=-1 and in which situation that can prevents it to set proper limits as expected.
Bottom line: we should set open_files_limit=0 as it allows mysql to use its own determined limit based on the database content. Plus, it still allows pacemaker to override the limit in the galera resource agent, when enabling HA scenarios.
[1] http://
Tim Rozet (trozet) wrote : | #7 |
Damien, I don't think just setting it to 0 fixes the problem. The security limits also need to change. See output below of setting to 0 does not raise above 1024 ulimit:
[root@overcloud
/etc/my.
[root@overcloud
[root@overcloud
+------
| Variable_name | Value |
+------
| open_files_limit | 1024 |
+------
[root@overcloud
[root@overcloud
[root@overcloud
Limit Soft Limit Hard Limit Units
Max open files 1024 4096 files
Damien Ciabrini (dciabrin) wrote : | #8 |
Hi Tim, sorry for the late answer,
My comment was a bit misleading, what I do mean is that open_files_limit=-1 doesn't raise in any way the file descriptor limit. In the HA case, that's rather the opposite, in that it precludes mysql (ran as root) to set the limit according the the configured max_connection parameter, for the reason explained in comment #6. consequently this return unecessary logs and confuses people.
For the non-HA case, mysql is ran by systemd as user mysql, so it cannot raise the file descriptor limit higher than the limit configured by the system. So as you pointed out in comment #4, the file descriptor limit should be raised via a systemd drop-in file.
For this specific non-HA case, I believe that drop-in file is generated automatically by puppet when run with instack-undercloud, so I think we're good already:
# cat /etc/systemd/
[Service]
LimitNOFILE=16384
When this setting is used, mysql doesn't try to raise the file descriptor limit because it's above what's necessary to run max_connection=4096 as configured. However we still see some unecessary warning in the logs, due to open_files_limit=-1 being an invalid value.
161129 10:46:47 [Warning] option 'open_files_limit': unsigned value 184467440737095
161129 10:46:47 [Warning] option 'open_files_limit': unsigned value 184467440737095
If we set open_files_limit=0 in non-HA deploy (e.g. the undercloud), _with_ the use of the drop-in systemd limit config of 16384 file descriptor, all unwanted log disappear; mysql would check if it needs to set the limits according to its needs (max_connection
# grep files /proc/`pidof /usr/libexec/
Max open files 16384 16384 files
# mysql -e "show variables like 'max_connections';"
+------
| Variable_name | Value |
+------
| max_connections | 4096 |
+------
# mysql -e "show variables like 'open_files_
+------
| Variable_name | Value |
+------
| open_files_limit | 16384 |
+------
So bottom line: open_files_limit=0 is important to let mysql set its limits when run as root (e.g. HA deployments), and is still helpful to avoid misleading warnings when used in conjunction with a systemd drop-in limit file (e.g. non-HA deployments).
Tim Rozet (trozet) wrote : | #9 |
Damien,
For noha deployments, I do not see the LimitNOFILE set in the systemd service. I don't have this file either on my overcloud node:
[root@overcloud
stat: cannot stat ‘/etc/systemd/
This is on stable/newton deployment. That file DOES exist on the *undercloud*, however the problem remains unsolved on the overcloud. We need to set LimitNOFILE on the overcloud node as well.
Damien Ciabrini (dciabrin) wrote : | #10 |
Oh right, I see... we also need such drop-in file in non-ha *overcloud*, you're completely right.
open_files_limit=-1 on the non-ha overcloud doesn't help to raise limit though, so my point for setting it to 0 remains valid (although incomplete as you highlighted :D)
OpenStack Infra (hudson-openstack) wrote : Change abandoned on tripleo-heat-templates (master) | #11 |
Change abandoned by Brent Eagles (<email address hidden>) on branch: master
Review: https:/
Reason: Abandoned due to lack of activity in the past 6 months.
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to puppet-tripleo (master) | #12 |
Related fix proposed to branch: master
Review: https:/
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to tripleo-heat-templates (master) | #13 |
Related fix proposed to branch: master
Review: https:/
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to tripleo-puppet-elements (master) | #14 |
Related fix proposed to branch: master
Review: https:/
OpenStack Infra (hudson-openstack) wrote : Related fix merged to tripleo-puppet-elements (master) | #15 |
Reviewed: https:/
Committed: https:/
Submitter: Jenkins
Branch: master
commit 910a88f1ef16b63
Author: Tim Rozet <email address hidden>
Date: Mon Feb 27 11:23:43 2017 -0500
Adds puppet-systemd
This puppet module is needed to manipulate systemd unit files and set
limits needed for MariaDB.
Partial-Bug: #1648181
Related-Bug: #1524809
Change-Id: I7ca7b5f7614971
Signed-off-by: Tim Rozet <email address hidden>
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to tripleo-puppet-elements (stable/ocata) | #16 |
Related fix proposed to branch: stable/ocata
Review: https:/
OpenStack Infra (hudson-openstack) wrote : Related fix merged to tripleo-puppet-elements (stable/ocata) | #17 |
Reviewed: https:/
Committed: https:/
Submitter: Jenkins
Branch: stable/ocata
commit bb18776dae74406
Author: Tim Rozet <email address hidden>
Date: Mon Feb 27 11:23:43 2017 -0500
Adds puppet-systemd
This puppet module is needed to manipulate systemd unit files and set
limits needed for MariaDB.
Partial-Bug: #1648181
Related-Bug: #1524809
Change-Id: I7ca7b5f7614971
Signed-off-by: Tim Rozet <email address hidden>
(cherry picked from commit 910a88f1ef16b63
tags: | added: in-stable-ocata |
OpenStack Infra (hudson-openstack) wrote : Related fix merged to puppet-tripleo (master) | #18 |
Reviewed: https:/
Committed: https:/
Submitter: Jenkins
Branch: master
commit 09665170f6d0f45
Author: Damien Ciabrini <email address hidden>
Date: Wed Dec 7 19:09:06 2016 +0100
mariadb: Move generation of systemd drop-in to puppet-tripleo
Systemd starts mariadb as user mysql, so in order to allow a large
number of connections (e.g. max_connections
raise the file descriptor limit via a system drop-in file.
When installing an undercloud, such drop-in file is currently
generated by instack-undercloud (in file puppet-
non-HA overcloud also need such drop-in to be generated.
In order to avoid duplicating code, the drop-in creation code should
be provided by puppet-tripleo. By default, no drop-in is generated;
it has to be enabled by instack-undercloud or tripleo-
once they will use it (resp. to create undercloud or non-HA overcloud).
This patch does not aim at generating a dynamic file limit based on
the number of connections, this should land in another dedicated
patch. Instead, it just reuses the limit currently set for undercloud
and HA-overclouds.
Also, the generation of the drop-in does not force a mysql restart
like it currently does in instack-undercloud, to avoid unexpected
service disruption on a non-HA overcloud after a minor update.
Co-Authored-By: Tim Rozet <email address hidden>
Depends-On: I7ca7b5f7614971
Change-Id: Ia0907b2ab6062a
Partial-Bug: #1648181
Related-Bug: #1524809
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to puppet-tripleo (stable/ocata) | #19 |
Related fix proposed to branch: stable/ocata
Review: https:/
OpenStack Infra (hudson-openstack) wrote : Related fix merged to puppet-tripleo (stable/ocata) | #20 |
Reviewed: https:/
Committed: https:/
Submitter: Jenkins
Branch: stable/ocata
commit 5d9d1c606ca9c0d
Author: Damien Ciabrini <email address hidden>
Date: Wed Dec 7 19:09:06 2016 +0100
mariadb: Move generation of systemd drop-in to puppet-tripleo
Systemd starts mariadb as user mysql, so in order to allow a large
number of connections (e.g. max_connections
raise the file descriptor limit via a system drop-in file.
When installing an undercloud, such drop-in file is currently
generated by instack-undercloud (in file puppet-
non-HA overcloud also need such drop-in to be generated.
In order to avoid duplicating code, the drop-in creation code should
be provided by puppet-tripleo. By default, no drop-in is generated;
it has to be enabled by instack-undercloud or tripleo-
once they will use it (resp. to create undercloud or non-HA overcloud).
This patch does not aim at generating a dynamic file limit based on
the number of connections, this should land in another dedicated
patch. Instead, it just reuses the limit currently set for undercloud
and HA-overclouds.
Also, the generation of the drop-in does not force a mysql restart
like it currently does in instack-undercloud, to avoid unexpected
service disruption on a non-HA overcloud after a minor update.
Co-Authored-By: Tim Rozet <email address hidden>
Depends-On: I7ca7b5f7614971
Change-Id: Ia0907b2ab6062a
Partial-Bug: #1648181
Related-Bug: #1524809
(cherry picked from commit 09665170f6d0f45
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to tripleo-puppet-elements (stable/newton) | #21 |
Related fix proposed to branch: stable/newton
Review: https:/
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to puppet-tripleo (stable/newton) | #22 |
Related fix proposed to branch: stable/newton
Review: https:/
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to puppet-tripleo (master) | #23 |
Related fix proposed to branch: master
Review: https:/
OpenStack Infra (hudson-openstack) wrote : Related fix merged to puppet-tripleo (master) | #24 |
Reviewed: https:/
Committed: https:/
Submitter: Jenkins
Branch: master
commit c9acf8a687ea646
Author: Tim Rozet <email address hidden>
Date: Thu Mar 9 12:04:10 2017 -0500
Fixes issues with raising mysql file limit
Changes Include:
- Adds spec testing
- Only raise limits if nonha. puppet-systemd will restart the mariadb
service which breaks ha deployments. Hence we only want to do this
in noha.
- Minor fix to hiera value refrenced not as parameter to mysql.pp
Partial-Bug: #1648181
Related-Bug: #1524809
Co-Authored By: Feng Pan <email address hidden>
Change-Id: Id063bf4b4ac229
Signed-off-by: Tim Rozet <email address hidden>
Signed-off-by: Feng Pan <email address hidden>
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to puppet-tripleo (stable/ocata) | #25 |
Related fix proposed to branch: stable/ocata
Review: https:/
OpenStack Infra (hudson-openstack) wrote : Related fix merged to tripleo-puppet-elements (stable/newton) | #26 |
Reviewed: https:/
Committed: https:/
Submitter: Jenkins
Branch: stable/newton
commit 47d59f4660928e0
Author: Tim Rozet <email address hidden>
Date: Mon Feb 27 11:23:43 2017 -0500
Adds puppet-systemd
This puppet module is needed to manipulate systemd unit files and set
limits needed for MariaDB.
Partial-Bug: #1648181
Related-Bug: #1524809
Change-Id: I7ca7b5f7614971
Signed-off-by: Tim Rozet <email address hidden>
(cherry picked from commit 910a88f1ef16b63
tags: | added: in-stable-newton |
OpenStack Infra (hudson-openstack) wrote : Related fix merged to puppet-tripleo (stable/ocata) | #27 |
Reviewed: https:/
Committed: https:/
Submitter: Jenkins
Branch: stable/ocata
commit 5508557a8a7a2d1
Author: Tim Rozet <email address hidden>
Date: Thu Mar 9 12:04:10 2017 -0500
Fixes issues with raising mysql file limit
Changes Include:
- Adds spec testing
- Only raise limits if nonha. puppet-systemd will restart the mariadb
service which breaks ha deployments. Hence we only want to do this
in noha.
- Minor fix to hiera value refrenced not as parameter to mysql.pp
Partial-Bug: #1648181
Related-Bug: #1524809
Co-Authored By: Feng Pan <email address hidden>
Change-Id: Id063bf4b4ac229
Signed-off-by: Tim Rozet <email address hidden>
Signed-off-by: Feng Pan <email address hidden>
(cherry picked from commit c9acf8a687ea646
OpenStack Infra (hudson-openstack) wrote : Related fix merged to puppet-tripleo (stable/newton) | #28 |
Reviewed: https:/
Committed: https:/
Submitter: Jenkins
Branch: stable/newton
commit 094ddde297707f6
Author: Damien Ciabrini <email address hidden>
Date: Wed Dec 7 19:09:06 2016 +0100
mariadb: Move generation of systemd drop-in to puppet-tripleo
Systemd starts mariadb as user mysql, so in order to allow a large
number of connections (e.g. max_connections
raise the file descriptor limit via a system drop-in file.
When installing an undercloud, such drop-in file is currently
generated by instack-undercloud (in file puppet-
non-HA overcloud also need such drop-in to be generated.
In order to avoid duplicating code, the drop-in creation code should
be provided by puppet-tripleo. By default, no drop-in is generated;
it has to be enabled by instack-undercloud or tripleo-
once they will use it (resp. to create undercloud or non-HA overcloud).
This patch does not aim at generating a dynamic file limit based on
the number of connections, this should land in another dedicated
patch. Instead, it just reuses the limit currently set for undercloud
and HA-overclouds.
Also, the generation of the drop-in does not force a mysql restart
like it currently does in instack-undercloud, to avoid unexpected
service disruption on a non-HA overcloud after a minor update.
Co-Authored-By: Tim Rozet <email address hidden>
Depends-On: I7ca7b5f7614971
Change-Id: Ia0907b2ab6062a
Partial-Bug: #1648181
Related-Bug: #1524809
(cherry picked from commit 09665170f6d0f45
OpenStack Infra (hudson-openstack) wrote : Related fix merged to tripleo-heat-templates (master) | #29 |
Reviewed: https:/
Committed: https:/
Submitter: Jenkins
Branch: master
commit 900ddfb27f0dd2a
Author: Tim Rozet <email address hidden>
Date: Thu Feb 16 14:21:32 2017 -0500
Enables increasing mariadb open files for noha deployments
There is currently an issue where the max open files limit is hit with
MariaDB in noha deployments, because it is defaulted to 1024 by system
limits. In HA deployments the limit is bumped to 16384. This patch
introduces a flag to be able to increase the limit to 16384 for noHA
deployments.
In the future we should change this to be an integer, and let the
operator decide the setting. Since this setting is set in a different
path for HA, we would need to implement a change that allows setting
both (ha and nonha) via the same integer param.
Depends-On: Ia0907b2ab6062a
Closes-Bug: #1648181
Related-Bug: #1524809
Change-Id: I95393fc798b833
Signed-off-by: Tim Rozet <email address hidden>
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to tripleo-heat-templates (stable/ocata) | #30 |
Related fix proposed to branch: stable/ocata
Review: https:/
OpenStack Infra (hudson-openstack) wrote : Related fix merged to tripleo-heat-templates (stable/ocata) | #31 |
Reviewed: https:/
Committed: https:/
Submitter: Jenkins
Branch: stable/ocata
commit 6b33a77f3c0bd28
Author: Tim Rozet <email address hidden>
Date: Thu Feb 16 14:21:32 2017 -0500
Enables increasing mariadb open files for noha deployments
There is currently an issue where the max open files limit is hit with
MariaDB in noha deployments, because it is defaulted to 1024 by system
limits. In HA deployments the limit is bumped to 16384. This patch
introduces a flag to be able to increase the limit to 16384 for noHA
deployments.
In the future we should change this to be an integer, and let the
operator decide the setting. Since this setting is set in a different
path for HA, we would need to implement a change that allows setting
both (ha and nonha) via the same integer param.
Depends-On: Ia0907b2ab6062a
Closes-Bug: #1648181
Related-Bug: #1524809
Change-Id: I95393fc798b833
Signed-off-by: Tim Rozet <email address hidden>
(cherry picked from commit 900ddfb27f0dd2a
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to puppet-tripleo (stable/newton) | #32 |
Related fix proposed to branch: stable/newton
Review: https:/
OpenStack Infra (hudson-openstack) wrote : Related fix merged to puppet-tripleo (stable/newton) | #33 |
Reviewed: https:/
Committed: https:/
Submitter: Jenkins
Branch: stable/newton
commit 88a65c9676acf2e
Author: Tim Rozet <email address hidden>
Date: Thu Mar 9 12:04:10 2017 -0500
Fixes issues with raising mysql file limit
Changes Include:
- Adds spec testing
- Only raise limits if nonha. puppet-systemd will restart the mariadb
service which breaks ha deployments. Hence we only want to do this
in noha.
- Minor fix to hiera value refrenced not as parameter to mysql.pp
Partial-Bug: #1648181
Related-Bug: #1524809
Co-Authored By: Feng Pan <email address hidden>
Change-Id: Id063bf4b4ac229
Signed-off-by: Tim Rozet <email address hidden>
Signed-off-by: Feng Pan <email address hidden>
(cherry picked from commit c9acf8a687ea646
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to tripleo-heat-templates (stable/newton) | #34 |
Related fix proposed to branch: stable/newton
Review: https:/
OpenStack Infra (hudson-openstack) wrote : Related fix merged to tripleo-heat-templates (stable/newton) | #35 |
Reviewed: https:/
Committed: https:/
Submitter: Jenkins
Branch: stable/newton
commit 0303c8379212663
Author: Tim Rozet <email address hidden>
Date: Thu Feb 16 14:21:32 2017 -0500
Enables increasing mariadb open files for noha deployments
There is currently an issue where the max open files limit is hit with
MariaDB in noha deployments, because it is defaulted to 1024 by system
limits. In HA deployments the limit is bumped to 16384. This patch
introduces a flag to be able to increase the limit to 16384 for noHA
deployments.
In the future we should change this to be an integer, and let the
operator decide the setting. Since this setting is set in a different
path for HA, we would need to implement a change that allows setting
both (ha and nonha) via the same integer param.
Depends-On: Ia0907b2ab6062a
Closes-Bug: #1648181
Related-Bug: #1524809
Change-Id: I95393fc798b833
Signed-off-by: Tim Rozet <email address hidden>
(cherry picked from commit 900ddfb27f0dd2a
Emilien Macchi (emilienm) wrote : | #36 |
There are no currently open reviews on this bug, changing the status back to the previous state and unassigning. If there are active reviews related to this bug, please include links in comments.
Changed in tripleo: | |
status: | In Progress → Triaged |
assignee: | Marios Andreou (marios-b) → nobody |
Emilien Macchi (emilienm) wrote : Cleanup EOL bug report | #37 |
This is an automated cleanup. This bug report has been closed because it
is older than 18 months and there is no open code change to fix this.
After this time it is unlikely that the circumstances which lead to
the observed issue can be reproduced.
If you can reproduce the bug, please:
* reopen the bug report (set to status "New")
* AND add the detailed steps to reproduce the issue (if applicable)
* AND leave a comment "CONFIRMED FOR: <RELEASE_NAME>"
Only still supported release names are valid (FUTURE, NEWTON, OCATA, PIKE, QUEENS, QUEENS).
Valid example: CONFIRMED FOR: FUTURE
Changed in tripleo: | |
importance: | Low → Undecided |
status: | Triaged → Expired |
many thanks to martin andre for bringing the issue to my attention