MariaDB slow queries

From wikieduonline
Jump to navigation Jump to search

https://mariadb.com/kb/en/slow-query-log/

/etc/mysql/mariadb.conf.d/50-server.cnf
/var/log/mysql/mariadb-slow.log
systemctl restart mariadb && systemctl status mariadb
/etc/mysql/mariadb.conf.d/50-server.cnf
#Enable the slow query log to see queries with especially long duration
slow_query_log_file	= /var/log/mysql/mariadb-slow.log
long_query_time = 10
log_slow_rate_limit	= 1000
log_slow_verbosity	= query_plan
log-queries-not-using-indexes


/usr/lib/nagios/plugins/check_mysql
Uptime: 1133648  Threads: 14  Questions: 159793336  Slow queries: 1718223  Opens: 191  Flush tables: 1  Open tables: 184  Queries per second avg: 140.954|Connections=2757900c;;; Open_files=57;;; Open_tables=184;;; Qcache_free_memory=2423328;;; Qcache_hits=38449185c;;; Qcache_inserts=106590640c;;; Qcache_lowmem_prunes=105448285c;;; Qcache_not_cached=342783c;;; Qcache_queries_in_cache=3589;;; Queries=159793336c;;; Questions=159793336c;;; Table_locks_waited=0c;;; Threads_connected=1;;; Threads_running=6;;; Uptime=1133648c;;;

Related[edit]

See also[edit]

Advertising: