Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
mysql-freeze
Search
ichirin2501
March 10, 2018
Programming
0
340
mysql-freeze
ichirin2501
March 10, 2018
Tweet
Share
More Decks by ichirin2501
See All by ichirin2501
MySQL運用とらぶるすとーり〜^2 / MySQL-Troubleshooting-Story
ichirin2501
7
12k
計算量と僕とWeb開発 / computational complexity and I and Web
ichirin2501
14
10k
Other Decks in Programming
See All in Programming
Less waste, more joy, and a lot more green: How Quarkus makes Java better
hollycummins
0
100
受け取る人から提供する人になるということ
little_rubyist
0
250
Jakarta EE meets AI
ivargrimstad
0
240
Better Code Design in PHP
afilina
PRO
0
130
シェーダーで魅せるMapLibreの動的ラスタータイル
satoshi7190
1
480
Realtime API 入門
riofujimon
0
150
Outline View in SwiftUI
1024jp
1
330
Laravel や Symfony で手っ取り早く OpenAPI のドキュメントを作成する
azuki
2
120
EMになってからチームの成果を最大化するために取り組んだこと/ Maximize team performance as EM
nashiusagi
0
100
[Do iOS '24] Ship your app on a Friday...and enjoy your weekend!
polpielladev
0
110
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
120
Micro Frontends Unmasked Opportunities, Challenges, Alternatives
manfredsteyer
PRO
0
110
Featured
See All Featured
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
47
2.1k
Designing Experiences People Love
moore
138
23k
How to Think Like a Performance Engineer
csswizardry
20
1.1k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
Optimizing for Happiness
mojombo
376
70k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
31
2.7k
Typedesign – Prime Four
hannesfritz
40
2.4k
Navigating Team Friction
lara
183
14k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
Transcript
MySQL freeze ͷר גࣜձࣾͯͳ id: ichirin2501 2017-08-19 Kyoto.ͳΜ͔ #3
ࣗݾհ • ݩߊ ( @ichirin2501 ) • ͯͳͷWebΦϖϨʔγϣϯΤϯδχΞ ڵຯ
ࠓճͷ͓
MySQLͷfreeze!!
࣌ʹ֬ೝग़དྷͨൣғΛྻڍ • ٸʹࢮ͵ • ࢮʹํfreeze, MySQLͷϓϩηεੜ͖ͯΔ • mysqladmin pingͳͲͷԠग़དྷΔ •
Ұ෦σʔλϕʔεͷΫΤϦ͕ฦͬͯ͜ͳ͍ • TCPͷଓཱ֬ग़དྷΔ, TCP keepaliveಈ͍ͯΔ • ΤϥʔϩάʹԿใग़ྗ͞Ε͍ͯͳ͍
͏͚Δ
͏͚ͳ͍
MySQLͷόʔδϣϯͱ͔ • MySQL-5.5.46 • mysql-server-5.5_5.5.46-0+deb7u1_amd64.deb • mysql-server-5.5_5.5.46-0+deb8u1_amd64.deb • OS: Debian
7.10(wheezy) or 8.1(jessie) • Kernel: wheezy=3.10.23, jessie=3.16.0
ڧҾʹ࠶ݱͤ͞Δ
sysbench !! (ҙ:benchmarkπʔϧ)
ߴෛՙΛ͔͚ଓ͚ͨΒ࠶ݱ͠ ͨʂʂ
sysbenchʹΑΔࡶͳݕূ݁Ռ EFCJBO EFCJBO P P Y Y
Y P P P P P x͕freeze
ϚΠφʔόʔδϣϯΛ্͛Δ 5.5.46 -> 5.5.52
ຊ൪ͰFreeze͠ͳ͘ͳͬͨ
ԿΘ͔ΒΜ͕ฏ͕๚Εͨ
࣌ա͗...
։ൃऀɿʮscript࣮ߦͯͨ͠Βfreezeͨ͠ʯ ࢲɿʮ͋ʔ͋ʔɺͳʹฉ͑͜·ͤΜʯ
MySQL-5.6.27͕Freeze
࠶ݕূ1 • աڈͷ؆қͳݕূͰfreeze͠ͳ͔ͬͨ • ಉݕূΛ࠶ߦ͕ͬͨ࠶ݱग़དྷͳ͍ • : sysbenchετϨεςετͰͳ͍
࠶ݕূ2 • ࣮ࡍʹϑϦʔζͨ͠batchεΫϦϓτͰࢼ͢ • 1ճ25࣌ؒͷbatchεΫϦϓτ • ݕূճ͕ॏͶΒΕͳ͍͕ࢼͦ͏ʂ
1ճͰݟࣄʹfreeze ͬͨͶʂʂʂʂʂ
ௐࠪ • Ҏલௐࠪͨ͠ͱ͖ʹεϧʔ͍߲͕ͯͨ͠ؾ ʹͳͬͨ • mysql-5.5.49ͷBugs FixedͷҰ෦ • InnoDB: Running
REPLACE operations on multiple connections resulted in a hang. (Bug #22530768, Bug #79185)
bug report • ʮInnodb freeze running REPLACE statementsʯhttps://bugs.mysql.com/ bug.php?id=79185 •
ಈ࡞ڥͱݱ͕ࠅࣅ͍ͯͨ͠ɻ ͰɺREPLACEΫΤϦࠓճͷfreezeࣄ݅ʹ ͓͍ͯҰൃߦ͞Ε͍ͯͳ͍
ؾʹͳͬͯίʔυΛݟʹߦ͘ • https://github.com/mysql/mysql-server/ search?q=22530768&type=Commits&utf8= %E2%9C%93 • |'o') TASपΓͷमਖ਼͡ΌΜ....REPLACEΫΤϦ ʹݶΒͳ͍ͷͰ....ෆԺ
ϚΠφʔόʔδϣϯΛ্͛Δ • 5.6.27ʹઌ΄ͲͷBugfixؚ·Ε͍ͯͳ ͍ɻͱΓ͋͑ͣ5.6.37·Ͱ্͛ͯscriptΛ࣮ߦ • ಉ༷ͷscriptΛԿ͔࣮ߦ͕ͨ͠freezeͳ͠ ࠓฏʂʂʂ
Α͘Θ͔ΒΜ͕ղܾʂʂ
ฏ͕Ұ൪
·ͱΊ • ϛυϧΣΞͷݕূेʹߦ͍·͠ΐ͏ • ͪΌΜͱετϨεςετΛ࣮ࢪ͠·͠ΐ͏ • ؾʹͳͬͨBugमਖ਼ͷίϛοτΛݟʹߦ͜͏