summaryrefslogtreecommitdiff
path: root/mysql-test/r
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@mariadb.org>2017-12-12 22:53:38 +0400
committerSergey Vojtovich <svoj@mariadb.org>2017-12-13 12:46:33 +0400
commit159a6c2e608d04732cb678c7691345b9b1dc69b1 (patch)
tree1e3f015f20b5b84e291ad134e3c8dbb16af31dfc /mysql-test/r
parent751e0f6b1ebeddb4faa3437daa399103bb212ac2 (diff)
downloadmariadb-git-159a6c2e608d04732cb678c7691345b9b1dc69b1.tar.gz
MDEV-14505 - Threads_running becomes scalability bottleneck
Instead of updating global counter, calculate Threads_running on the fly. All threads having command != COM_SLEEP are included. Behaviour changes: Previously SHOW STATUS and SHOW GLOBAL STATUS returned the same values representing global status. Now SHOW STATUS always returns 1 indicating that current session has 1 thread running. Previously only threads that were executing dispatch_command() or running events were accounted by Threads_running. Now it is rough equivalent of SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE state!='Sleep'
Diffstat (limited to 'mysql-test/r')
-rw-r--r--mysql-test/r/status.result17
1 files changed, 17 insertions, 0 deletions
diff --git a/mysql-test/r/status.result b/mysql-test/r/status.result
index 9b82c7896cb..18cde57b295 100644
--- a/mysql-test/r/status.result
+++ b/mysql-test/r/status.result
@@ -409,6 +409,23 @@ Table_open_cache_overflows 5
FLUSH TABLES;
FLUSH STATUS;
SET @@global.table_open_cache= @old_table_open_cache;
+#
+# MDEV-14505 - Threads_running becomes scalability bottleneck
+#
+# Session status for Threads_running is currently always 1.
+SHOW STATUS LIKE 'Threads_running';
+Variable_name Value
+Threads_running 1
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME='THREADS_RUNNING';
+VARIABLE_VALUE
+1
+FLUSH STATUS;
+SHOW STATUS LIKE 'Threads_running';
+Variable_name Value
+Threads_running 1
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME='THREADS_RUNNING';
+VARIABLE_VALUE
+1
connection default;
set @@global.concurrent_insert= @old_concurrent_insert;
SET GLOBAL log_output = @old_log_output;