Small buffer pool size causes XtraDB buffer flush thread to spin at 100% cpu
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Server moved to https://jira.percona.com/projects/PS |
Fix Released
|
Medium
|
Nickolay Ihalainen | ||
5.1 |
Invalid
|
Undecided
|
Unassigned | ||
5.5 |
Invalid
|
Undecided
|
Unassigned | ||
5.6 |
Fix Released
|
Medium
|
Nickolay Ihalainen |
Bug Description
Small innodb_
Here is how I could repeat:
Start server with:
sql/mysqld --no-defaults --language=
Create some dirty pages to trigger flush thread:
create table t1 (a int primary key auto_increment, b varchar (1000));
insert into t1 (b) values (repeat("a", 999));
insert into t1 (b) select b from t1;
insert into t1 (b) select b from t1;
insert into t1 (b) select b from t1;
insert into t1 (b) select b from t1;
insert into t1 (b) select b from t1;
insert into t1 (b) select b from t1;
insert into t1 (b) select b from t1;
insert into t1 (b) select b from t1;
insert into t1 (b) select b from t1;
insert into t1 (b) select b from t1;
insert into t1 (b) select b from t1;
insert into t1 (b) select b from t1;
insert into t1 (b) select b from t1;
This causes the mysqld process to appear at 100% CPU in `top`.
The problem seems to be related to heuristics with hard-coded constants that
assume a certain minimum pool size. In page_cleaner_
if the number of free pages is less than @@innodb_
works out as 51 by default), it will never sleep between trying to flush
pages. Probably the page flusher has another heuristics that doesn't try to
flush out more than some percentage of total pages or something.
Se with small buffer pool, we end up with two heuristics fighting one another,
and 100% cpu spinning results.
It could take a few more INSERTs to get there, so if it's not reproducible with SQL above, just keep inserting.
Tested with Percona Server 5.6.22-72.0.
https:/ /mariadb. atlassian. net/browse/ MDEV-7758