Mysql – pt-online-schema-change — can’t get it to stop quitting w/ “Threads_running=108 exceeds its critical threshold 100”

MySQLpercona-toolkitpercona-toolsschema

I've got an InnoDB table over 50GB with indexes. The query I'm running looks like this:

pt-online-schema-change h=localhost,D=db,t=table --critical-load="Threads_running=100" --check-slave-lag "h=XX.XX.XX.XX" --max-lag 10
--execute --pass PASS 
--alter "REORGANIZE PARTITION max INTO (
PARTITION p19 VALUES LESS THAN ( UNIX_TIMESTAMP('2016-05-01 00:00:00') ),
PARTITION p20 VALUES LESS THAN ( UNIX_TIMESTAMP('2016-06-01 00:00:00') ),
PARTITION max VALUES LESS THAN maxvalue
)"

No matter what settings I use, I get the Threads_running issue. I have also tried:

--chunk-size 100 (also tried 20)

--max-load="Threads_running=20"

Shouldn't it just wait until threads running gets lowered? Why does it keep quitting? I could raise the critical load to allow 200 threads, but I'm afraid of the server crashing.

Any advice?

Best Answer

The problem was that every now and then an unrelated query put a lot of stress on the server and was causing the threads running to nearly max out. It was doing this regularly before the schema change was first run.