don't consider binlog dump as active thread in threadpool
Bug #1381848 reported by
zhai weixiang
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Percona Server moved to https://jira.percona.com/projects/PS | Status tracked in 5.7 | |||||
5.5 |
Triaged
|
Medium
|
Unassigned | |||
5.6 |
Triaged
|
Medium
|
Unassigned | |||
5.7 |
Triaged
|
Medium
|
Unassigned |
Bug Description
Suppose we have one master and several slaves, each slave connects to master and starts binlog dump . If thread pool is enabled, a thread is always occupied by one slave and can not be used by other normal workload.
Because we may have more than 10 binlog dump requests, so it's possible that some requests will be assigned to the same thread pool group. For example, suppose we use default thread_
Increasing thread_
tags: | added: threadpool |
To post a comment you must log in.
I found reported behavior. I configured 3 slaves for master server.
mysql> show full processlist\G ******* ******* ****** 1. row ******* ******* ******* ****** ******* ******* ****** 2. row ******* ******* ******* ****** ******* ******* ****** 3. row ******* ******* ******* ****** ******* ******* ****** 4. row ******* ******* ******* ******
*******
User: repl
Host: slave2:45596
db: NULL
Command: Binlog Dump
Time: 81054
State: Master has sent all binlog to slave; waiting for binlog to be updated
*******
User: repl
Host: slave1:58470
db: NULL
Command: Binlog Dump
Time: 81054
State: Master has sent all binlog to slave; waiting for binlog to be updated
*******
User: repl
Host: slave3:59205
db: NULL
Command: Binlog Dump
Time: 81054
State: Master has sent all binlog to slave; waiting for binlog to be updated
*******
User: root
Host: localhost
db: NULL
Command: Query
Time: 0
State: init
I found all four threads occupied by thread pool. idle_threads = 4 threads (1 root user connection thread to MySQL, 3 "Binlog Dump" threads
Threadpool_threads - Threadpool_
mysql> show status like 'Thread%'; ------- ------- -----+- ------+ ------- ------- -----+- ------+ idle_threads | 7 | ------- ------- -----+- ------+
+------
| Variable_name | Value |
+------
| Threadpool_
| Threadpool_threads | 11 |
| Threads_cached | 0 |
| Threads_connected | 4 |
| Threads_created | 201 |
| Threads_running | 4 |
+------
I executed mysqlslap with gradually increasing --concurrency
mysql> show status like 'Thread%'; ------- ------- -----+- ------+ ------- ------- -----+- ------+ idle_threads | 58 | ------- ------- -----+- ------+
+------
| Variable_name | Value |
+------
| Threadpool_
| Threadpool_threads | 62 |
| Threads_cached | 0 |
| Threads_connected | 99 |
| Threads_created | 257 |
| Threads_running | 45 |
+------
mysql> show status like 'Thread%'; ------- ------- -----+- ------+ ------- ------- -----+- ------+ idle_threads | 60 | ------- ------- -----+- ------+
+------
| Variable_name | Value |
+------
| Threadpool_
| Threadpool_threads | 64 |
| Threads_cached | 0 |
| Threads_connected | 45 |
| Threads_created | 261 |
| Threads_running | 22 |
+------
mysql> show global variables like 'Thread_pool%'; ------- ------- ------- ----+-- ------- -----+ ------- ------- ------- ----+-- ------- -----+ pool_high_ prio_mode | transactions | pool_high_ prio_tickets | 4294967295 | pool_idle_ timeout | 60 | pool_max_ threads | 100000 | pool_oversubscr ibe | 5 | pool_stall_ limit | 500 | ------- ------- ------- ----+-- ------- -----+
+------
| Variable_name | Value |
+------
| thread_
| thread_
| thread_
| thread_
| thread_
| thread_pool_size | 8 |
| thread_
+------