Aktionen

MySQL - Verbindungsdaten ( Connections ) anzeigen lassen

Aus znilwiki

Die aktiven Verbindungen:

mysqladmin -uadmin -ppassword processlist


Beispielausgabe:

+-----+--------------+-----------+----------+----------------+------+--------------------+------------------+
| Id  | User         | Host      | db       | Command        | Time | State              | Info             |
+-----+--------------+-----------+----------+----------------+------+--------------------+------------------+
| 251 | DELAYED      | localhost | znilwiki | Delayed insert | 3    | Waiting for INSERT |                  |
| 259 | zabbixdbuser | localhost | zabbixdb | Sleep          | 241  |                    |                  |
| 260 | zabbixdbuser | localhost | zabbixdb | Sleep          | 241  |                    |                  |
| 261 | zabbixdbuser | localhost | zabbixdb | Sleep          | 241  |                    |                  |
| 262 | zabbixdbuser | localhost | zabbixdb | Sleep          | 241  |                    |                  |
| 263 | zabbixdbuser | localhost | zabbixdb | Sleep          | 241  |                    |                  |
| 264 | zabbixdbuser | localhost | zabbixdb | Sleep          | 241  |                    |                  |
| 265 | zabbixdbuser | localhost | zabbixdb | Sleep          | 75   |                    |                  |
| 266 | zabbixdbuser | localhost | zabbixdb | Sleep          | 74   |                    |                  |
| 267 | zabbixdbuser | localhost | zabbixdb | Sleep          | 85   |                    |                  |
| 268 | zabbixdbuser | localhost | zabbixdb | Sleep          | 76   |                    |                  |
| 269 | zabbixdbuser | localhost | zabbixdb | Sleep          | 196  |                    |                  |
| 270 | zabbixdbuser | localhost | zabbixdb | Sleep          | 241  |                    |                  |
| 271 | zabbixdbuser | localhost | zabbixdb | Sleep          | 1    |                    |                  |
| 273 | zabbixdbuser | localhost | zabbixdb | Sleep          | 24   |                    |                  |
| 274 | zabbixdbuser | localhost | zabbixdb | Sleep          | 0    |                    |                  |
| 275 | zabbixdbuser | localhost | zabbixdb | Sleep          | 1    |                    |                  |
| 276 | zabbixdbuser | localhost | zabbixdb | Sleep          | 0    |                    |                  |
| 277 | zabbixdbuser | localhost | zabbixdb | Sleep          | 4    |                    |                  |
| 278 | zabbixdbuser | localhost | zabbixdb | Sleep          | 10   |                    |                  |
| 279 | zabbixdbuser | localhost | zabbixdb | Sleep          | 1    |                    |                  |
| 280 | zabbixdbuser | localhost | zabbixdb | Sleep          | 25   |                    |                  |
| 281 | zabbixdbuser | localhost | zabbixdb | Sleep          | 241  |                    |                  |
| 283 | zabbixdbuser | localhost | zabbixdb | Sleep          | 0    |                    |                  |
| 363 | admin        | localhost | psa      | Sleep          | 22   |                    |                  |
| 364 | admin        | localhost | psa      | Sleep          | 22   |                    |                  |
| 373 | admin        | localhost |          | Query          | 0    |                    | show processlist |
+-----+--------------+-----------+----------+----------------+------+--------------------+------------------+


Die konfigurierten Maximalwwerte:

mysqladmin -uadmin -ppassword variables | grep 'max.*connections'


Beispielausgabe:

| max_connections                                   | 200                                                                                                                    |
| max_user_connections                              | 200                                                                                                                    |


Der höchste Wert an Verbindungen:

mysqladmin -uadmin -ppassword extended-status | grep Max_used_connections

Beispielausgabe:

| Max_used_connections                     | 27          |



Konfiguriert werden die Maximalwerte in der my.cnf, in der Regel unter

/etc/mysql/my.cnf



--Bernhard Linz 10:22, 12. Jun. 2013 (CEST)


Loading comments...