mirror of
https://github.com/MariaDB/server.git
synced 2025-05-05 16:59:35 +03:00
Delay spawning parallel replication worker threads until a slave SQL thread is running, and de-spawn them when the last SQL thread stops. This is especially useful to avoid needless threads on a master in a setup where same my.cnf is used on masters and slaves.
23 lines
1.1 KiB
Plaintext
23 lines
1.1 KiB
Plaintext
SET @save_slave_parallel_threads= @@GLOBAL.slave_parallel_threads;
|
|
SELECT IF(COUNT(*) < 20, "OK", CONCAT("Found too many system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user";
|
|
IF(COUNT(*) < 20, "OK", CONCAT("Found too many system user processes: ", COUNT(*)))
|
|
OK
|
|
SELECT @@GLOBAL.slave_parallel_threads as 'must be 20 because of .cnf';
|
|
must be 20 because of .cnf
|
|
20
|
|
SELECT @@SESSION.slave_parallel_threads as 'no session var';
|
|
ERROR HY000: Variable 'slave_parallel_threads' is a GLOBAL variable
|
|
SET GLOBAL slave_parallel_threads= 0;
|
|
SET GLOBAL slave_parallel_threads= DEFAULT;
|
|
SELECT @@GLOBAL.slave_parallel_threads as 'must be 0 because of default';
|
|
must be 0 because of default
|
|
0
|
|
SET GLOBAL slave_parallel_threads= 10;
|
|
SELECT @@GLOBAL.slave_parallel_threads;
|
|
@@GLOBAL.slave_parallel_threads
|
|
10
|
|
SELECT IF(COUNT(*) < 10, "OK", CONCAT("Found too many system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user";
|
|
IF(COUNT(*) < 10, "OK", CONCAT("Found too many system user processes: ", COUNT(*)))
|
|
OK
|
|
SET GLOBAL slave_parallel_threads = @save_slave_parallel_threads;
|