[MDEV-10238] Even I set max_connection in /etc/my.cnf on CentOS 7, it not work Created: 2016-06-15 Updated: 2016-07-21 Resolved: 2016-06-21 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | OTHER |
| Affects Version/s: | 10.1.12 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Minor |
| Reporter: | xugang | Assignee: | Unassigned |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Environment: |
CentOS 7 VM Mariadb 10.1.12 |
||
| Description |
|
Hi I changed max_connection in /etc/my.cnf on CentOS 7 but it not work Thanks! My OS is Centos 7
|
| Comments |
| Comment by Elena Stepanova [ 2016-06-15 ] | ||||||
|
max_connections, as well as some other variables, are auto-sized in a not-very-obvious-way based on the max number of open files which your server was run with. Try to increase it. You can pass it to mysqld_safe via --open-files-limit=count, but of course the hard limit should allow the value you are trying to set. | ||||||
| Comment by xugang [ 2016-06-21 ] | ||||||
|
Sorry to feedback later I checked my host [root@pmo-cloud01 nova]# ulimit -a Seemed open files number is 1024 Is that too small? | ||||||
| Comment by Elena Stepanova [ 2016-06-21 ] | ||||||
|
Yes, that's too small to have max_connections=500 as you want to. It's adjusted automatically to the maximum number that server can get with this max number of open files (214, as you see). Check the hard limit, it's probably higher, in this case you'll be able to increase the value for the session running mysqld. If the hard limit is equally low, you'll need to have your machine reconfigured. | ||||||
| Comment by xugang [ 2016-06-23 ] | ||||||
|
Thanks your info! I will change my hard limit and try again! | ||||||
| Comment by Elena Stepanova [ 2016-06-23 ] | ||||||
|
To be clear – to make it work for mysqld, you need to increase the soft limit; but you can only do it if your hard limit is high enough. | ||||||
| Comment by xugang [ 2016-06-24 ] | ||||||
|
I checked my hard limit with -H seemed it is 4096 as my soft limit is only 1024, I guess I can try to change it to 2048 first and see if settings worked thanks! | ||||||
| Comment by xugang [ 2016-07-02 ] | ||||||
|
@Elena Stepanova I did not know how to reopen this issue. But just one more question, seemed I changed soft limit to higher one, but still max_connection in /etc/my.cnf did not work ulimt -S -a [root@test11061 ~]# ulimit -S -a Could you guide me how to change it permanent? Thanks! | ||||||
| Comment by Elena Stepanova [ 2016-07-02 ] | ||||||
|
Please run SELECT @@open_files_limit on your MariaDB server, and compare the result with the limit you think you've set in the system. If @@open_files_limit on your running MariaDB server is indeed 16384, but you are not getting the expected value for max_connections, please attach the output of SHOW GLOBAL VARIABLES. | ||||||
| Comment by xugang [ 2016-07-03 ] | ||||||
|
Yeah, your are right Seemed my open file limits did not take effect MariaDB [(none)]> SELECT @@open_files_limit;
--------------------
-------------------- Strange, I did update /etc/security/limits.conf like below I guess MariaDB did not use this way to update system-wide parameters in CentOS 7 as systemd used
Seemed we need create one directory under /etc/systemd/system/mariadb.server with file limits.conf I did so and restart maridb service Magic things happened. MariaDB [(none)]> SELECT @@open_files_limit
--------------------
-------------------- MariaDB [(none)]> SELECT @@max_connections;
-------------------
------------------- It worked. Thanks! |