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
ソーシャルゲームの 高負荷とかじゃない 地味な方の話
Search
takahiro ogasawara
April 21, 2016
Programming
0
1.9k
ソーシャルゲームの 高負荷とかじゃない 地味な方の話
phpblt#4
takahiro ogasawara
April 21, 2016
Tweet
Share
More Decks by takahiro ogasawara
See All by takahiro ogasawara
新Teamで始めたDesignDoc運用と 定着化のためにやったこと
ogataka50
2
830
Other Decks in Programming
See All in Programming
C++でシェーダを書く
fadis
6
4.1k
[Do iOS '24] Ship your app on a Friday...and enjoy your weekend!
polpielladev
0
110
OnlineTestConf: Test Automation Friend or Foe
maaretp
0
110
Remix on Hono on Cloudflare Workers
yusukebe
1
290
Figma Dev Modeで変わる!Flutterの開発体験
watanave
0
130
AWS IaCの注目アップデート 2024年10月版
konokenj
3
3.3k
CSC509 Lecture 12
javiergs
PRO
0
160
どうして僕の作ったクラスが手続き型と言われなきゃいけないんですか
akikogoto
1
120
Snowflake x dbtで作るセキュアでアジャイルなデータ基盤
tsoshiro
2
520
ECS Service Connectのこれまでのアップデートと今後のRoadmapを見てみる
tkikuc
2
250
『ドメイン駆動設計をはじめよう』のモデリングアプローチ
masuda220
PRO
8
540
Realtime API 入門
riofujimon
0
150
Featured
See All Featured
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
47
2.1k
Code Reviewing Like a Champion
maltzj
520
39k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
It's Worth the Effort
3n
183
27k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
Docker and Python
trallard
40
3.1k
The Cult of Friendly URLs
andyhume
78
6k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
0
96
Transcript
ιʔγϟϧήʔϜͷ ߴෛՙͱ͔͡Όͳ͍ ຯͳํͷ @ogasora50
ࣗݾհ • খּݪ ۭ(@ogasora50) • cygames αʔόʔαΠυΤϯδχΞ • ࠷ۙɺṖʹ؍༿২ʹ·Δ
ࣗݾհ • খּݪ ۭ(@ogasora50) • cygames αʔόʔαΠυΤϯδχΞ • ࠷ۙɺṖʹ؍༿২ʹ·Δ
• ͋ͬ͞Γӽౙࣦഊ • ੜ໋ʹ A/BςετͳΜͯͳ͍
ιʔγϟϧήʔϜͷ ߴෛՙͱ͔͡Όͳ͍ ຯͳํͷ
όονॲཧͱ͔ σʔλཧͷΛͯ͠Έ·͢
όονॲཧ͕ଟΊ • όονͰͰ͖Δ͜ͱόονͰ • Ͱ͖Δ͚ͩϨεϙϯεΛૣ͍ͨ͘͠ • ϢʔβΞΫηε͕ͳͯ͘ॲཧ͍ͨ͠
όονॲཧͰؾΛ͚͍ͭͯΔࣄ • σʔλ͕૿͑ͯmemory_over͠ͳ͍͔ • ઃఆϛεͳͲͷରࡦ • ෆ۩߹/ো࣌ରԠ • ଐਓԽ͠ͳ͍Α͏࠷ݶͷϧʔϧ/υΩϡϝϯτԽ
memory_overରࡦ • ͍ΘΏΔ • ΄ͲΜͲྻ͕Ͱ͔͗͢Δ/ແବͳྻ࡞Γ͗͢ Fatal error: Allowed memory size
of xxx bytes exhausted
memory_overରࡦ • ඞཁͳͷΛඞཁͳ͚ͩɺখ͚ʹ·ͱΊͯॲཧ͢ΔΑ͏ʹ • ֎෦ϑΝΠϧʹग़ྗɺ͔ͦ͜ΒҰఆͣͭॲཧ • BULK INSERT • INSERT
… ON DIPLICATE KEY UPDATE • ඞͣຊ൪/μϛʔσʔλΛͬͯςετ
ઃఆϛεͳͲͷରࡦ • Ϛελʔσʔλʹϛε͕͋ͬͨΒͲ͏͠Α͏ͳ͍ɾɾɾ • σʔλͷෆ߹͕ͳ͍͔νΣοΫπʔϧΛఆظ࣮ߦ • dry_run࣮ͯ͠ࣄલʹ݁Ռ֬ೝ
ෆ۩߹/ো࣌ରԠ • ෆ۩߹/োʹૉૣ͘ؾ͚Δ͔ɺૉૣ͘ରԠͰ͖Δ͔ • ॲཧͷ൱Λࣾsnsʹ௨ • ແବͳ͙Β͍ͷϩάग़ྗ͕ͪΐ͏Ͳ͍͍ • ్தͰམͪͨͱͯ͠ɺΓ͠/࠶࣮ߦͰ͖ΔΑ͏ʹ
ϧʔϧ/υΩϡϝϯτԽ • ඞͣreadme࡞Δ ࠷ݶͷॲཧ/Ҿͷ֓ཁ͙Β͍ • ಓʹෳਓͰ୲ɺ࡞ۀΛճ͢ • όον͓͡͞Μ࡞Βͳ͍Α͏ʹ
ϧʔϧ/υΩϡϝϯτԽ • ӡ༻͕͘ͳΔʹͭΕɺόον࣮ߦαʔόʔ͕૿͑Δɾɾɾ • phpdocͷcron൛ɺcrondoc࡞ͬͨ • markdownܗࣜͷυΩϡϝϯτੜɺgithub͔Βࢀর 4)&--CJOCBTI 1"5)TCJOCJOVTSTCJOVTSCJO ."*-50SPPU
)0.& !UJUMFNPOEBZTI !BVUIPSIPHF !QBSBNFOW<EFWcTUHcQSPE> TUBSUFWFSZNPOEBZ TIIPNFIPHFIBQQZ@NPOEBZTIQSPE
σʔλཧ
σʔλཧ • ͱʹ͔͘σʔλ͕ͲΜͲΜΓΓ૿͑Δ • ඞཁͳͷΈอ࣋͢ΔΑ͏ʹ
σʔλཧ • ඞཁͳ͘ͳͬͨͷͲΜͲΜύʔδ • ύʔςΟγϣϯΛຖdrop & add • Πϕϯτ୯ҐͰςʔϒϧ࡞ɺΠϕϯτऴྃޙdrop
dropͰ͖ͳ͍ • σʔλྔେ͖͗ͯ͢ɺdrop࣌ʹio_waitͰϨεϙϯε͕ྼԽ • σʔλϑΝΠϧΛΏΔ͔ʹআ͢ΔΑ͏ʹͨ͠Βղܾ 1. ςʔϒϧͷσʔλϑΝΠϧʹϋʔυϦϯΫΛషΔ 2. drop table
3. linuxͷํͷ truncateͰঃʑʹαΠζΛΓ٧Ίremove • drop tableࣗಈԽ
·ͱΊ • όονඞཁͳͷΛඞཁͳ͚ͩɺখ͚ʹ·ͱΊͯॲཧ • ෆ۩߹/ো͕ى͖Δ͜ͱΛఆͨ͠ॲཧΛ • σʔλඞཁ࠷খݶอ࣋͢ΔΑ͏ɺ ύʔςΟγϣϯɺςʔϒϧ୯ҐͰύʔδͰ͖ΔΑ͏ʹ • ڊେͳςʔϒϧΛdrop͢Δࡍɺ
io_wait͕ى͖ͳ͍Α͏ʹΏΔ͔ʹσʔλϑΝΠϧΛআ͢Δ
enjoy engineering!