- 积分
- 16840
在线时间 小时
最后登录1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?开始注册
x
# sysbench --mysql-host=192.168.10.226 --mysql-port=3306 --mysql-user=root \" F/ N: G$ s4 l8 [: \/ E+ U( b
--mysql-password=Changeme_123 --test=/usr/share/sysbench/tests/include/oltp_legacy/oltp.lua --oltp_tables_count=10 \% Q& F- O" i" ~ E# l/ A* T
--oltp-table-size=10000000 --num-threads=8 --oltp-read-only=off --db-driver=mysql \- P S) q. ~& x* |6 S+ X
--report-interval=10 --rand-type=uniform --max-time=3600 \$ I( V; \& O0 I. q
--max-requests=0 --percentile=99 run >> mysql.log0 j% f& J/ I$ ^8 x0 U
- b% k% v1 J/ U1 Q2 ? V+ Q% J( n
参数说明
& C: x' X$ j- m8 h. {+ K- T0 O–num-threads=8 表示发起 8个并发连接* w5 q: R! N# U1 c
% r- z) e+ C6 s2 y" e. \( w9 a–oltp-read-only=off 表示不要进行只读测试,也就是会采用读写混合模式测试& P k0 j8 z' {# k" a4 O! u5 e8 W
6 [ f& H, p7 u A& J2 y
–report-interval=10 表示每10秒输出一次测试进度报告 d& M/ k F W* v x) r
, |, O0 N% u( i; H Y& w( s
–rand-type=uniform 表示随机类型为固定模式,其他几个可选随机模式:uniform(固定),gaussian(高斯),special(特定的),pareto(帕累托): u$ e L; V: q
1 U( _7 L1 h0 O; L; V–max-time=120 表示最大执行时长为 120秒
8 ?/ q: C P( r2 y! }. ^7 x) q: y8 @& f( m" k2 Z& w
–max-requests=0 表示总请求数为 0,因为上面已经定义了总执行时长,所以总请求数可以设定为 0;也可以只设定总请求数,不设定最大执行时长0 z* g' P& o. k# \
' M; J+ T, J9 }4 R. r7 h
–percentile=99 表示设定采样比例,默认是 95%,即丢弃1%的长请求,在剩余的99%里取最大值
5 l8 L6 `8 D. }+ \
) l3 G0 y. m, H; f1 X3 ?7 m8 _6 m3 x即:模拟 对10个表并发OLTP测试,每个表1000万行记录,持续压测时间为 1小时。
. C; I) y! n5 D; _- Q真实测试场景中,建议持续压测时长不小于30分钟,否则测试数据可能不具参考意义。4 O) A5 [" H3 T4 }; d! }$ B0 s' h
. u) `3 }6 q& Y; C* Gsysbench 0.5: multi-threaded system evaluation benchmark1 z# ^) I; ^4 D6 R; J, {
. N7 G3 _1 w! \" _; ^$ e1 A- b/ x
Running the test with following options:9 t9 w$ c! X9 r( R1 s! @
Number of threads: 8
8 F( ~. R y- S( S0 yReport intermediate results every 10 second(s)
' }6 `2 t. r6 o- w' Y3 I# ERandom number generator seed is 0 and will be ignored2 z, Z* l2 n" L9 n! \$ |% }" t
1 s$ v2 H4 Z- `/ n2 K
6 H) a4 e2 I; ]- s6 }Threads started!: N8 ~+ x8 R5 }
-- 每10秒钟报告一次测试结果,tps、每秒读、每秒写、99%以上的响应时长统计( e0 K& y6 F/ x: X) s- P
[ 10s] threads: 8, tps: 1111.51, reads/s: 15568.42, writes/s: 4446.13, response time: 9.95ms (99%)3 e7 M3 w {/ y0 L6 k
[ 20s] threads: 8, tps: 1121.90, reads/s: 15709.62, writes/s: 4487.80, response time: 9.78ms (99%)8 y' ?7 w/ H+ j% d' K2 M% o3 K
[ 30s] threads: 8, tps: 1120.00, reads/s: 15679.10, writes/s: 4480.20, response time: 9.84ms (99%)
( e. }- G/ B9 A; |[ 40s] threads: 8, tps: 1114.20, reads/s: 15599.39, writes/s: 4456.30, response time: 9.90ms (99%)3 Q2 G/ D+ H8 [: R( k. L
[ 50s] threads: 8, tps: 1114.00, reads/s: 15593.60, writes/s: 4456.70, response time: 9.84ms (99%)
2 D6 e7 h2 d# b" ][ 60s] threads: 8, tps: 1119.30, reads/s: 15671.60, writes/s: 4476.50, response time: 9.99ms (99%)+ J% W5 E# @0 o
OLTP test statistics:( i- n1 N. |' s( {! U2 v% W
queries performed:$ h( v% j# v# g% V( }
read: 938224 -- 读总数; p) ?3 [0 M' n& a4 ?
write: 268064 -- 写总数
' Y( O$ U& g1 h9 n other: 134032 -- 其他操作总数(SELECT、INSERT、UPDATE、DELETE之外的操作,例如COMMIT等)* \3 c1 w- f: `0 I) B
total: 1340320 -- 全部总数; x5 J9 x2 u+ s x
transactions: 67016 (1116.83 per sec.) -- 总事务数(每秒事务数)
# Q2 ? N. `$ e deadlocks: 0 (0.00 per sec.) -- 发生死锁总数( D* A( }# H4 H: T2 c z
read/write requests: 1206288 (20103.01 per sec.) -- 读写总数(每秒读写次数)
, w/ y5 }5 s) q0 n6 Y) ^# s+ s } other operations: 134032 (2233.67 per sec.) -- 其他操作总数(每秒其他操作次数)! L7 S5 a; l) Z0 P4 z2 w
9 U8 Y f0 ^- tGeneral statistics: -- 一些统计结果9 f% d( @. _: {# @' b* m: _. t$ j
total time: 60.0053s -- 总耗时; y X5 g/ x( Y8 p/ J
total number of events: 67016 -- 共发生多少事务数 M: {! m" K2 V. a" a+ _
total time taken by event execution: 479.8171s -- 所有事务耗时相加(不考虑并行因素). j' n' Z7 j& u2 [
response time: -- 响应时长统计
0 }. l7 D; e( C: v1 H Q* Y: b min: 4.27ms -- 最小耗时
- U6 G* }0 ?9 @1 P$ e7 A avg: 7.16ms -- 平均耗时
, K+ N9 G8 O Y% \ g) t* e, M- [ max: 13.80ms -- 最长耗时- I7 j' E- L$ Z. T8 R. U9 L
approx. 99 percentile: 9.88ms -- 超过99%平均耗时" z1 z9 x& @2 \0 @+ e' p! h( C
}0 p9 u: G% R" v- hThreads fairness:1 i* ?3 _: D. L" o3 O W8 q' U
events (avg/stddev): 8377.0000/44.33
1 V2 P( E9 b! \; L% K/ Q execution time (avg/stddev): 59.9771/0.00
- a4 S1 b- c) |; A* ~
! \/ w9 m: E# [- ~* }# B( t) a8 r$ z) g H ^; W$ t4 G8 _
最重要的参数指标:9 y# C: G4 u' e
总的事物数,每秒事务数,时间统计信息(最大、最小、平均、95%以上语句响应时间)
- _' K7 N0 R4 |/ z" m6 X1 Z1 `# c删除数据
0 p( A7 @. [4 s. N% w7 k9 z! |8 A' X I3 ]
sysbench --mysql-host=192.168.10.226 --mysql-port=3306 --mysql-user=root --mysql-password=Changeme_123 --db-driver=mysql \) W; O' i( \1 {# u. u0 L* O* I+ q) r
--test=/usr/share/sysbench/tests/include/oltp_legacy/oltp.lua --oltp_tables_count=10 --oltp-table-size=100000 --rand-init=on cleanup
' M( S5 e d9 a y W2 D5 R- j% i& v1 j
|
|