-
Notifications
You must be signed in to change notification settings - Fork 3
/
run5.sh
85 lines (57 loc) · 1.89 KB
/
run5.sh
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
#!/bin/sh
set -u
#set -x
set -e
DR="/data/mysql/3306/data"
BD="/data/tpcc/data"
WT=10
RT=3600
# restore from backup
#rm -fr $DR/*
#cp -r $BD/* $DR
chown mysql.mysql -R $DR
function waitm {
while [ true ]
do
mysql -e "set global innodb_max_dirty_pages_pct=0" mysql
wt=`mysql -e "SHOW ENGINE INNODB STATUS\G" | grep "Modified db pages" | sort -u | head -n 1 | awk '{print $4}'`
if [[ "$wt" -lt 100 ]] ;
then
mysql -e "set global innodb_max_dirty_pages_pct=90" mysql
break
fi
echo "mysql pages $wt"
sleep 10
done
}
wlist="10 50 100 200 500"
#wlist="1 2"
for bp in $wlist
do
#/usr/local/mysql/bin/mysqld --defaults-file=/etc/my.552.cnf --basedir=/usr/local/mysql --datadir=$DR --innodb_data_home_dir=$log2 --innodb_log_group_home_dir=$log2 --innodb_thread_concurrency=0 --innodb_buffer_pool_size=${bp}GB --innodb_buffer_pool_instances=16 &
/usr/bin/mysqld_safe --defaults-file=/data/mysql/3306/my.cnf &
#/usr/bin/mysqld_safe --defaults-file=/data/mysql/3306/my.cnf
sleep 6
sh show_variables.sh > mysql_variables.${bp}.txt
#./tpcc_start -h localhost -d tpcc$bp -u root -p "" -w $bp -c 16 -r 10 -l 100 -f tpcc.w${bp}.log > tpcc.w${bp}.out
#./tpcc_start -h localhost -d tpcc$bp -u root -p "" -w $bp -c 16 -r 10 -l 100 > tpcc.w${bp}.out
#并发128 热身10分钟 跑30分钟
./tpcc_start -h localhost -d tpcc$bp -u root -p "" -w $bp -c 128 -r 600 -l 1800 > tpcc.w${bp}.out
#./tpcc_start localhost tpcc root "" 200 16 10 2000 | tee -a tpcc.bp${bp}.second_run.out
waitm
mysqladmin shutdown
#将脏数据刷新到磁盘
sync
#清除OS Cache
echo 3 > /proc/sys/vm/drop_caches
swapoff -a && swapon -a
done
wfiles=""
for bp in $wlist
do
./tpcc-output-analyze.sh tpcc.w${bp}.out > w${bp}.log
wfiles="$wfiles w${bp}.log"
done
paste $wfiles > w.log
./tpcc-graph-build.sh w.log w.jpg
exit 0