configuration - How to increase the max_connections value for MySQL on Ubuntu Server? -
i use mysql 5.6
on ubuntu server 14.04
, want increase maximal allowed number of simultaneous connections (currently set default 151
).
responsible setting max_connections
in /etc/mysql/my.cnf
. set 200
, restarted mysql server. now, has value 200
:
$ cat /etc/mysql/my.cnf | grep "connections" max_connections = 200 $ /etc/init.d/mysql restart * stopping mysql database server mysqld [ ok ] * starting mysql database server mysqld [ ok ] * checking tables need upgrade, corrupt or not closed cleanly.
but nothing has changed:
show variables "max_connections"; +-----------------+-------+ ¦ variable_name ¦ value ¦ +-----------------+-------+ ¦ max_connections ¦ 151 ¦ +-----------------+-------+
how custom configuration of max_connections
working?
$ ulimit -a | grep "open" open files (-n) 1024 $ ulimit -n 4096 $ ulimit -a | grep "open" open files (-n) 4096
added /etc/security/limits.conf
:
* soft nofile 1024000 * hard nofile 1024000 * soft nproc 10240 * hard nproc 10240 root soft nproc unlimited
added /etc/mysql/my.cnf
:
[mysqld_safe] open_files_limit = 1024000 [mysqld] open_files_limit = 1024000
but seems ignored:
show status 'open%'; +--------------------------+-------+ ¦ variable_name ¦ value ¦ +--------------------------+-------+ ¦ open_files ¦ 52 ¦ +--------------------------+-------+ ¦ open_streams ¦ 0 ¦ +--------------------------+-------+ ¦ open_table_definitions ¦ 434 ¦ +--------------------------+-------+ ¦ open_tables ¦ 417 ¦ +--------------------------+-------+ ¦ opened_files ¦ 847 ¦ +--------------------------+-------+ ¦ opened_table_definitions ¦ 0 ¦ +--------------------------+-------+ ¦ opened_tables ¦ 0 ¦ +--------------------------+-------+
to avoid case of setting correct configs in wrong files set option in these files (some of them not there, created them):
$ mysqld --help --verbose | grep -b 1 cnf default options read following files in given order: /etc/my.cnf /etc/mysql/my.cnf /usr/etc/my.cnf ~/.my.cnf
no effect.
you have increase open files limit on os, , afterwards, can put higher max_connections value.
Comments
Post a Comment