Search This Blog

2015-06-12

MariaDB Open Connections

Show total max allowed connections:

MariaDB [(none)]> select @@global.max_connections;
+--------------------------+
| @@global.max_connections |
+--------------------------+
| 151 |
+--------------------------+
1 row in set (0.00 sec)


Show current connections:

MariaDB [(none)]> show status like '%onn%';
+--------------------------+-------+
| Variable_name | Value |
+--------------------------+-------+
| Aborted_connects | 469 |
| Connections | 17533 |
| Max_used_connections | 152 |
| Ssl_client_connects | 0 |
| Ssl_connect_renegotiates | 0 |
| Ssl_finished_connects | 0 |
| Threads_connected | 151 |
+--------------------------+-------+
7 rows in set (0.00 sec)


Show processes using the connections

MariaDB [(none)]> show processlist;

OR

MariaDB [(none)]> SHOW FULL PROCESSLIST;


You can set max_connections higher than the default value in the configuration file: /etc/mysql/my.cnf

The variable you would set would be:

max_connections = 200


Resources:
http://alvinalexander.com/blog/post/mysql/how-show-open-database-connections-mysql
http://lists.openstack.org/pipermail/openstack-dev/2014-September/047376.html
https://major.io/2008/06/24/mysql-error-1040-too-many-connections/

No comments:

Post a Comment