8/11/2019 Show Engine in No Db Status
1/36
Innodb status variables
The Pythian Group
www.pythian.com
8/11/2019 Show Engine in No Db Status
2/36
Overview
SHOW ENGINE INNO! ST"T#SInternal Innodb status variables
Need to $now how Inno! wor$s
8/11/2019 Show Engine in No Db Status
3/36
Header
mysql> SHOW ENGINE INNODB STATUS\G
*************************** 1. row ***************************
Status:
!"!"!# ":$%:!" INNODB &ONITO' OUT(UT
()r s)o+, a-)ra)s alulat), /rom t0) last 1 s)o+,s
8/11/2019 Show Engine in No Db Status
4/36
Semaphores
%rom wi$ipedia& 'a semaphore is a protected variable or abstract data typewhich constitutes the classic method for restricting access to shared
resourcessuch as shared memory in a parallel pro(rammin( environment.
http&))en.wi$ipedia.or()wi$i)Semaphore*+pro(rammin(,
!asically& loc$in(.
8/11/2019 Show Engine in No Db Status
5/36
Semaphores
2222222222
SE&A(HO'ES
2222222222OS WAIT A''A3 IN4O: r)s)r-at5o+ ou+t $16117$8 s5+al ou+t $1!1177
&ut)9 s5+ wa5ts !8 rou+,s !!67%7%1#8 OS wa5ts 1;67"%
'W2s0ar), s5+s 17!6#7"8 OS wa5ts 1!7$67< 'W2)9l s5+s "76#1%68 OSwa5ts #;7%7#
innodb*sync*spin*loops
innodb*thread*concurrency
8/11/2019 Show Engine in No Db Status
6/36
Semaphore E-amples22T0r)a, 1176%7;"## 0as wa5t), at =tr=tr!ur. l5+) $;# /or #.!! s)o+,s t0) s)ma0or):
S2lo? o+ 'W2lat0 at !9aaa=11a/,$; r)at), 5+ /5l) ,5t,5t!,5t. l5+) 1$7%
a wr5t)r @t0r)a, 5, 11!7!"%%# 0as r)s)r-), 5t 5+ mo,) )9lus5-)
+um=)r o/ r)a,)rs !8 wa5t)rs /la 1
22T0r)a, ;11$ 0as wa5t), at 5=u/!5=u/. l5+) $%% /or 1.!! s)o+,s t0) s)ma0or):
S2lo? o+ 'W2lat0 at %6)7;,! r)at), 5+ /5l) ,5t!,5t. l5+) $6!%
+um=)r o/ r)a,)rs !8 wa5t)rs /la !
ast t5m) r)a, lo?), 5+ /5l) 5=u/!5=u/. l5+) $%%
ast t5m) wr5t) lo?), 5+ /5l) 5=u/!5=u/. l5+) $7"
22T0r)a, ;1; 0as wa5t), at sr-!sr-. l5+) 1#"1 /or !.!! s)o+,s t0) s)ma0or):
&ut)9 at 7!=a%; r)at), /5l) sr-!sr-. l5+) ;68 lo? -ar 1
btr0pcur.c B-tree / persistent cursor 16,720 index tree persistent cursoribuf0ibuf.c Insert Buffer / 91,397 Insert buffer
srv0srv.c Server / Server 75,633 Server !in pro"r!
#ttp$//for"e.%s&'.co/(i)i/*%S+Intern!'si'esInInnoBSources
lo?!lo?. tr9!tr9. row!-)rs.
8/11/2019 Show Engine in No Db Status
7/36
"TEST %O/EIGN 0E1 E//O/222222222222222222222222
ATEST 4O'EIGN CE3 E''O'
222222222222222222222222
!"!;1; 1!:!6:7 Tra+sat5o+:T'ANSATION ;!!4%A8 ATIE ! s)8 ro)ss +o %1$8 OS t0r)a, 5,
1!66%!%6! u,at5+ or ,)l)t5+
mysql ta=l)s 5+ us) 18 lo?), 1
# lo? strut@s8 0)a s5F) 11%8 row lo?@s8 u+,o lo )+tr5)s 1
&yS t0r)a, 5, 1!$1#%8 qu)ry 5, $$#;!"!;6 w)=! loal0ost t)st u,at5+
DEETE 4'O& ,=.ta=l)1 WHE'E 5, 1#!;$
4or)5+ ?)y o+stra5+t /a5ls /or ta=l) ,=.ta=l)1:
ONST'AINT 5=/?J1 4O'EIGN CE3 @5, 'E4E'ENES ta=l) @tJ5,
Try5+ to ,)l)t) or u,at) 5+ ar)+t ta=l)8 5+ 5+,)9 ('I&A'3 tul):
DATA TU(E: 1 /5)l,s: written==8 +pa(es that were read)written to dis$,
/# least recently used
Clush list hold the pa(es that have to be Clushed by
chec$point process
sin(le pa(e writes writes that will not be batched withother writes when written to dis$
8/11/2019 Show Engine in No Db Status
35/36
17
/OW OPE/"TIONS
22222222222222
'OW O(E'ATIONS22222222222222
! qu)r5)s 5+s5,) I++oDB8 ! qu)r5)s 5+ qu)u)
1 r)a, -5)ws o)+ 5+s5,) I++oDB
&a5+ t0r)a, ro)ss +o. $7"8 5, #6!#"##%#"%7"8 stat): /lus05+ lo
Num=)r o/ rows 5+s)rt), $1#6$#!78 u,at), $%!!#%$8 ,)l)t), 11%"7%8r)a, #77"%;$$6
!.$$ 5+s)rtss8 !.!! u,at)ss8 !.$$ ,)l)t)ss8 !.$$ r)a,ss
/ead view is a consistent ?;22 snapshot oC the db asoC point transaction started
8/11/2019 Show Engine in No Db Status
36/36
18
%eedbac$
@uestionsJ
2ommentsJ
Su((estionsJ
2overed the inCormation Crom SHOW ENGINE INNO! ST"T#S: and how to tune&
innodb*thread*concurrency
innodb*adaptive*hash*inde-
innodb*sync*spin*loops
innodb*thread*sleep*delay innodb*commit*concurrency
innodb*concurrency*tic$ets