1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
|
--source include/have_innodb.inc
SET @saved_page_cleaners = @@GLOBAL.innodb_page_cleaners;
create table t1 (a int not null primary key auto_increment,
b bigint,
c varchar(200),
d int,
key b (b),
key d (d)) engine=INNODB;
let $rows = 15000;
--disable_query_log
begin;
while ($rows)
{
eval insert into t1 values(NULL, $rows, 'testing...', $rows+1000);
dec $rows;
}
commit;
--enable_query_log
#
# We want 4 connections: (1) - (3) to create dirty pages
# and default to modify the number of page cleaner threads
#
set GLOBAL innodb_page_cleaners = 4;
connect (con1,localhost,root,,);
connection con1;
send update t1 set b = b + 5, d = d + 1 where a between 1 and 2000;
connect (con2,localhost,root,,);
connection con2;
send update t1 set b = b + 5, d = d + 1 where a between 3000 and 5000;
connect (con3,localhost,root,,);
connection con3;
send update t1 set b = b + 5, d = d + 1 where a between 8000 and 12000;
#
# Page cleaners are increased
#
connection default;
set GLOBAL innodb_page_cleaners = 2;
set GLOBAL innodb_page_cleaners = 4;
set GLOBAL innodb_page_cleaners = 6;
connection con1;
reap;
connection con2;
reap;
connection con3;
reap;
connection default;
set GLOBAL innodb_page_cleaners = 4;
#
# Page cleaners are decreased
#
connection con1;
send update t1 set b = b + 5, d = d + 1 where a between 1 and 2000;
connection con2;
send update t1 set b = b + 5, d = d + 1 where a between 3000 and 5000;
connection con3;
send update t1 set b = b + 5, d = d + 1 where a between 8000 and 12000;
connection default;
set GLOBAL innodb_page_cleaners = 3;
set GLOBAL innodb_page_cleaners = 2;
set GLOBAL innodb_page_cleaners = 1;
connection con1;
reap;
connection con2;
reap;
connection con3;
reap;
connection default;
disconnect con1;
disconnect con2;
disconnect con3;
DROP TABLE t1;
SET GLOBAL innodb_page_cleaners=@saved_page_cleaners;
|