Академический Документы
Профессиональный Документы
Культура Документы
&gen'a
( ( ( ( &pproach to getting great MySQL Configuration )ypes of Configuration Options )oo*s to Configure MySQL Loo+ing at Most ,mportant Options
$$$%percona%com
$$$%percona%com
&*so
( .o$ usefu* 'o you thin+ MySQL Defau*t Configuration 0
$$$%percona%com
$$$%percona%com
$$$%percona%com
$$$%percona%com
$$$%percona%com
$$$%percona%com
$$$%percona%com
$$$%percona%com
$$$%percona%com
mysDtuner
-------- General Statistics -------------------------------------------------[--] Skipped version check for MySQLTuner script [OK] Currently runnin supported MySQL version !"#"!$-rel#%"&-lo [OK] Operatin on '(-)it architecture -------- Stora e *n ine Statistics ------------------------------------------[--] Status+ ,-rchive -./. -0ederated ,1nno/. -1S-M -2/.Cluster [--] /ata in My1S-M ta)les+ $3G 4Ta)les+ #%&%5 [--] /ata in 1nno/. ta)les+ #G 4Ta)les+ 33&5 [--] /ata in M*MO67 ta)les+ 8. 4Ta)les+ %5 [99] Total fra :ented ta)les+ ##8 -------- Security 6eco::endations ------------------------------------------[99] ;ser <=< has no pass>ord set"
$$$%percona%com
MysD*tuner H"I
( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( JJJJJJJJ Performance Metrics JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ FJJG 1p forK 7L' #h #m "Ms H7MMM D FM6%" 6 DpsG, NM conn, )OK "#"-, ;OK <B-I FJJG ;ea's 4 WritesK 6L8 4 M8 FJJG )ota* 5uffersK <%M3 g*o5a* P "%LM per threa' H"## ma= threa'sI FO?G Ma=imum possi5*e memory usageK <%N3 H<#8 of insta**e' ;&MI FCCG S*o$ DueriesK L8 H< M47MMMI FO?G .ighest usage of avai*a5*e connectionsK 7<8 H #64"##I FO?G ?ey 5uffer size 4 tota* My,S&M in'e=esK <%#34 %M3 FO?G ?ey 5uffer hit rateK ##%#8 H<7- cache' 4 BM rea'sI FCCG Query cache is 'isa5*e' FO?G Sorts reDuiring temporary ta5*esK #8 H<<? temp sorts 4 B#M sortsI FCCG !oins performe' $ithout in'e=esK "77BN7 FCCG )emporary ta5*es create' on 'is+K < 8 H"7M on 'is+ 4 B M tota*I FO?G )hrea' cache hit rateK 6 8 HL6 ? create' 4 NM connectionsI FCCG )a5*e cache hit rateK "8 H ? open 4 76? opene'I FO?G Open fi*e *imit use'K M"8 H"?4N?I FO?G )a5*e *oc+s acDuire' imme'iate*yK 668 H<MBM imme'iate 4 <MBM *oc+sI FCCG ,nnoD- 'ata size 4 5uffer poo*K % 34"7B%#M
$$$%percona%com
mysD*tunerHMI
( ( ( ( ( ( ( ( ( ( ( ( ( JJJJJJJJ ;ecommen'ations JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ 3enera* recommen'ationsK ;un OP),M,ZE )&-LE to 'efragment ta5*es for 5etter performance &'>ust your >oin Dueries to a*$ays uti*ize in'e=es When ma+ing a'>ustments, ma+e tmp@ta5*e@size4ma=@heap@ta5*e@size eDua* ;e'uce your SELEC) D,S),EC) Dueries $ithout L,M,) c*auses ,ncrease ta5*e@cache gra'ua**y to avoi' fi*e 'escriptor *imits Qaria5*es to a'>ustK Duery@cache@size HRA NMI >oin@5uffer@size HR "N%#?, or a*$ays use in'e=es $ith >oinsI tmp@ta5*e@size HR BMI ma=@heap@ta5*e@size HR BMI ta5*e@cache HR <#6BI inno'5@5uffer@poo*@size HRA 3I
$$$%percona%com
ptJvaria5*eJa'visor
( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( S W&;E inno'5@f*ush@*og@at@tr=@commitJ K ,nnoD- is not configure' in strict*y &C,D mo'e% S EO)E inno'5@ma=@'irty@pages@pctK )he inno'5@ma=@'irty@pages@pct is *o$er than the 'efau*t% S EO)E *og@$arningsJ"K Log@$arnings must 5e set greater than a5orte' connections% to *og unusua* events such as
S EO)E ma=@connect@errorsK ma=@connect@errors shou*' pro5a5*y 5e set as *arge as your p*atform a**o$s% S W&;E o*'@pass$or'sK O*'Jsty*e pass$or's are insecure% S W&;E s*ave@net@timeoutK )his varia5*e is set too high% S EO)E inno'5@'ata@fi*e@pathK &utoJe=ten'ing ,nnoD- fi*es can consume a *ot of 'is+ space that is very 'ifficu*t to rec*aim *ater% S W&;E myisam@recover@optionsK myisam@recover@options shou*' 5e set to some va*ue such as -&C?1P,/O;CE to ensure that ta5*e corruption is notice'% S W&;E sync@5in*ogK -inary *ogging is ena5*e', 5ut sync@5in*og isn2t configure' so that every transaction is f*ushe' to the 5inary *og for 'ura5i*ity%
$$$%percona%com
too*s%percona%com
$$$%percona%com
)oo*s%percona%com
$$$%percona%com
$$$%percona%com
$$$%percona%com
3enera* Options
( max_connections .o$ many connections to a**o$ 0 Watch max_#sed_connections status va*ue ( threa'@cache Cache to prevent e=cessive threa' creation 7#J ## is goo' va*ue% Watch threads_created ( table_cache$table_open_cache Cache of opene' ta5*e instances Sing*e ta5*e may have mu*tip*e entries Watch opene'@ta5*es status va*ue Start $ith <#6B MySQL $i** on*y use as nee'e' any$ay%
$$$%percona%com
3enera* Options
( open_%iles_limit My,S&M ta5*es reDuire up to " fi*e han'*ers Each connection is fi*e han'*er too Safe to set to B77M7 in most systems ( table_de%inition_cache Cache ta5*e 'efinitions HC;E&)E )&-LEI On*y one entry per ta5*e Watch Opened_table_de%initions Set to cover a** ta5*es un*ess 7#?P ta5*es
$$$%percona%com
3enera* Options
( bac&_lo' Eee' a'>ustment if many connections4sec "#<N is reasona5*e va*ue ( max_allo(ed_pac&et Limits ma=imum size of Duery Limits interna* string varia5*e size BM- is a goo' va*ue ( max_connect_errors Prevent pass$or' 5rute force attac+ Can cause 9.ost -*oc+e': error messages Qa*ue aroun' ###### is goo'
$$$%percona%com
3enera* Options
( s&ip_name_resol)e &voi' DES *oo+up on connection% /aster an' Safer Do not use host names in G*A+Ts ( old_pass(ords Shou*' EO) 5e ena5*e'% Wi** cause insecure pass$or' hash to 5e use'%
$$$%percona%com
3enera* Options
( lo'_bin Ena5*e for rep*ication an' point in time recovery Set to 9mysD*J5in: to avoi' 'efau*t naming ( sync_binlo' Ma+e -in*og 'ura5*e% Set to if have ;&,D $ith --1 or /*ash Can 5e rea**y performance +i**er $ith s*o$ 'rives% ( expire_lo'_days Purge o*' 5inary *ogs < H" $ee+sI is a goo' va*ue $ith $ee+*y 5ac+ups%
$$$%percona%com
3enera* Options
( tmp_table_si,e ( max_heap_table_si,e )ypica**y set to same va*ue H$or+*oa' 5ase'I -reated_tmp_dis&_tables status varia5*e -evare -LO-4)EO) fie*'s cause on 'is+ ta5*e $ith any size% ( q#ery_cache_si,e Ena5*e Duery cache on*y if it is teste' to provi'e significant gains Often causes sta**s an' contention Do not set over 7 "M$$$%percona%com
3enera* Options
( sort_b#%%er_si,e ,n memory 5uffer use' for sorting Watch sort@merge@passes Consi'er setting for session for *arge Dueries Qa*ues up to M- are goo' 'efau*t Large va*ues hurt performance of sma** Dueries ( .oin_b#%%er_si,e .e*ps performance of !oins $ith no in'e=es -etter get ri' of such !oins C NM- can 5e reasona5*e va*ue ( de%a#lt_stora'e_en'ine 1se this engine for ta5*es if not specifie'
$$$%percona%com
3enera* Options
( read_rnd_b#%%er_si,e -uffer for rea'ing ro$s in sorte' offer Specifies Ma=imum Qa*ue Qa*ues aroun' BM- often ma+e sense Do not mi= $ith read_b#%%er_si,e ( Tmpdir Specify *ocation of temporary 'irectory )mpfs often goo' choice un*ess very *arge temporary space is nee'e'%
$$$%percona%com
My,S&M options
( &ey_b#%%er_si,e Cache My,S&M ,n'e=es% Does Eot cache 'ata% 1p to M#8 of memory if using My,S&M on*y ( myisam@recover &utomatica**y repair corrupte' My,S&M ta5*es after crash% BA-/U012O*-3 is a goo' va*ue% ( myisam_sort_b#%%er_si,e -uffer use' for 5ui*'ing My,S&M in'e=es 5y Sort% NM-J"7BM- are goo' va*ues%
$$$%percona%com
My,S&M Options
( lo(_priority_#pdates &**o$ higher concurrency for SELEC)s May starve up'ate Dueries ( b#l&_insert_b#%%er_si,e -uffer to optimize -u*+ ,nserts Qa*ues of T of &ey_b#%%er_si,e ma+e sense Eote it is per connection va*ue (
$$$%percona%com
,nno'5 ,O Options
( innodb_%l#sh_lo'_at_trx_commit Contro* Dura5i*ity Af*ush an' syncW "Af*ushW #Aneither ( ,nno'5@f*ush@metho' Contro*s ho$ ,nno'5 Performs ,O O_45*3-T goo' va*ue for most servers ( innodb_a#to_lr#_d#mp Percona Server /eature to $armup Duic+*y M## Hsecon'sI is a goo' va*ue ( innodb_io_capacity Contro*s ,nno'5 &ssumption a5out Dis+ Performance% ,ncrease for faster 'rives%
$$$%percona%com
,nno'5 ,O Options
( innodb_read_io_threads ( innodb_(rite_io_threads Contro* num5er of threa's 'oing rea's an' $rites MySQL 7%7 has async ,O so very high va*ues might not 5e nee'e' < is goo' 'efau*t% .igher for *arge ,O systems% ( innodb_%l#sh_nei'hbor_pa'es Percona Server feature to contro* ho$ f*ushing $or+s Disa5*e Hset to #I for SSD
$$$%percona%com
$$$%percona%com
Qisi5i*ity Options
( per%ormance_schema Ena5*e Performance Schema in MySQL 7%7P Watch potentia* overhea'% ( lo'_slo(_q#eries Ena5*e S*o$ Query Log% O*' 5ut very he*pfu*% ( lon'_q#ery_time Especia**y $ith *ong@Duery@time set to # perio'ica**y to get samp*e of the *oa' ( lo'_slo(_)erbosity6%#ll 3et a *ot more 'ata a5out Dueries in Percona Server
$$$%percona%com
Qisi5i*ity Options
( lo(_(arnin's69 3et $arnings a5out 'isconnects an' other minor issues in error *og% More information 5ut it can get spammy ( #serstat_r#nnin'6 3et a'vance' )a5*e an' ,n'e= usage statistics in Percona Server an' MariaD-
$$$%percona%com
Summary
( ( ( ( Many Options to chose from C &n' these are se*ecte' 9fe$: C*ose to <## varia5*es avai*a5*e ,n *atest versions ;emem5er in most cases you 'o not nee' to tune more than a fe$ ( Consi'er starting $ith config fi*e generate' 5y httpK44too*s%percona%com &t *east it $i** sho$ you $hich options to pay attention to first%
$$$%percona%com
$$$%percona%com
&pri* #thJ "th, "# " )utoria*s X ,nitia* -rea+out Sessions &nnounce'
httpK44$$$%percona%com4a5outJus4pressre*eases4perconaJ*iveJmysD*JconferenceJ an'Je=poJhea'sJtoJsantaJc*araJca*iforniaJapri*J #J "J"# "4
/eature' Spea+ers
Mar+ Ca**aghan H/ace5oo+I, !eremy Za$o'ny HCraigs*istI, Marten Mic+os HEuca*yptus SystemsI Sarah Eovotny H-*ue 3ec+oI, Peter Zaitsev HPerconaI, -aron Sch$artz HPerconaI
$$$%percona%com
$$$%percona%com
$$$%percona%com4*ive