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
burikaigi2021 Rails製ECサイトの決済速度を上げろ!〜決済処理チューニングの記録〜
Search
orekyuu
January 30, 2021
3
1.6k
burikaigi2021 Rails製ECサイトの決済速度を上げろ!〜決済処理チューニングの記録〜
orekyuu
January 30, 2021
Tweet
Share
More Decks by orekyuu
See All by orekyuu
[JJUG CCC 2022 fall] Fargate上のJVMからCPUを認識するまで 〜正しく認識されないCPUの謎を追え〜
orekyuu
1
2k
OpenJDKアンカンファレンス 2022-09
orekyuu
0
140
至極の難問言語仕様クイズ 〜最強のマルチリンガル決定戦〜
orekyuu
2
2k
実際困る!クロスドメイン間のセッション管理を考えよう
orekyuu
1
790
pixiv PAYで運用している フレンズパターン
orekyuu
1
3.3k
日本初のキャッシュレス即売会を支えた決済アプリ pixiv PAYの技術
orekyuu
1
1.4k
Featured
See All Featured
What's in a price? How to price your products and services
michaelherold
243
12k
Done Done
chrislema
181
16k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
The Cost Of JavaScript in 2023
addyosmani
45
6.8k
A Tale of Four Properties
chriscoyier
156
23k
Intergalactic Javascript Robots from Outer Space
tanoku
269
27k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
720
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.2k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
Transcript
!PSFLZVV 3BJMT&$αΠτͷܾࡁ Λ্͛Ζʂ dܾࡁॲཧνϡʔχϯάͷهd
ࠓɺͨ͠Γ͞ͳ͔ͬͨΓ͢Δਓʹ͍ͭͯ ͓Ε͖Ύʔɹ!PSFLZVV ϐΫγϒגࣜձࣾॴଐ ͖+BWB ࣄ3VCZ ΤϯδχΞྺ 23ίʔυܾࡁΞϓϦͷ্ཱͪ͛ͬͨΓ ೝূೝՄαʔόʔͬͨΓ &$αΠτ࡞ͬͨΓ 5XJUUFSͷ͕ͨ͢
εϥΠυʹޱڬΉ
࣍ w ରͷΞϓϦέʔγϣϯʹ͍ͭͯ w ๊͍͑ͯͨʹ͍ͭͯ w ঢ় w ݪҼ w
ղܾ w ·ͱΊ
͋Δɺಥવ4MBDLʹΞϥʔτ͕ྲྀΕ࢝ΊΔ -PDLBXBJUUJNFPVUFYFFEFE
ʮ999ͷจ͕ࡴ౸ͯ͠·͢Ͷʯ
#005)ʹ͍ͭͯ w ϐΫγϒ͕ӡӦ͍ͯ͠Δ&$αΠτ w ݸਓͰ࡞ͬͨάοζɺΠϥετຊɺԻָͳͲͷ࡞͕ू·͍ͬͯΔ w ߪೖͨ͠ʹߪೖऀֹ͕ۚΛ্ͤͰ͖Δʮ#0045ػೳʯͳͲ͕͋Δ ͬͱ͓ۚΘͤͯͷؾ࣋ͪͰ্ͤͨ͠Γ͢Δ
γεςϜͷ w Α͋͘ΔϞϊϦγοΫͳ3BJMTΞϓϦ w "1αʔόʔ͕ w %#.Z42- w ͋ͱΩϟογϡTJEFLJRͷͨΊʹ3FEJT w
ݕࡧͷͨΊʹ&MBTUJDTFBSDI w ࢹʹڈลΓ͔Β%BUBEPH͕ೖͬͨ ฐࣾجຊΦϯϓϨͰ͢ɻσʔλݘ͕ೖͬͯศརʹͳΓ·ͨ͠ɻ
ͲΜͳͱ͖ʹจ͕ࡴ౸͢Δ͔ w ظؒݶఆൢചͷൢച։࢝࣌ͱ͔ ྫϑΝϯͷଟ͍ΫϦΤΠλʔ͕4/4Ͱ63-Λ֦ࢄͨ͠ͱ͔ w :PVUVCFͳͲͷ৴αʔϏε͔Β ྫ৴αʔϏεͰ999ͬͯάοζ͕ࠓ͔Βങ͑·͢ʂͱ͔ ͷ߹ɺಉਓೋͱखʹೖΒͳ͍͔͔ͩΒ༨ܭʹ͕ೖΔ
จ͕ࡴ౸ͨ͠ͱ͖ɺԿ͕ى͍ͬͯͨ͜ͷ͔ʁ
োͷ༰ͱݪҼ w ܾࡁ࣌ʹඵ͔͔Δ͍൵؍తϩοΫΛͱ͍ͬͯΔ w ࡏݿΛݮࢉ͢ΔͨΊɺͰϩοΫΛऔΔ ಉ͡ʹจ͕ࡴ౸͢Δͱ%#Ͱ٧·Δ ϩοΫ͕ͳ͚Εɺݸ͔͠ചΕͳ͍ͷʹݸจ͕͋Δͱ͔ʹ
ॲཧΠϝʔδ def checkout! ActiveRecord::Base.transaction do ͷ൵؍తϩοΫ # ࡏݿΛಉ࣌ʹฤू͠ͳ͍Α͏ʹϩοΫΛऔΔ ͷࡏݿͷݮࢉॲཧ จΛ֬ఆࡁΈʹ͢Δ
ܾࡁͷٻAPIΛୟ͘ end end ܾࡁͷٻ"1*ʹࣦഊ͢Δͱࡏݿ͕ϩʔϧόοΫ͞Εͯखܰ
ରࡦҊ w ࡏݿݸຖʹϨίʔυΛ༻ҙͯ͠ɺͦΕͰϩοΫΛऔΔ w ܾࡁ͞ΕΔ͝ͱʹTJEFLJRʹ+PCΛੵΜͰඇಉظͰঃʑʹফԽ͢Δ w τϥϯβΫγϣϯΛׂ͢Δ
❌ࡏݿݸຕʹϨίʔυΛ༻ҙ͢Δ w ख࢝ΊʹଞͷਓͲ͏͍ͯ͠ΔΜͩΖ͏ͳʔͱʮࡏݿॲཧɹϩοΫʯ͋ͨΓ Ͱݕࡧ͢Δͱग़͖ͯͨ w ࡏݿ͝ͱʹϨίʔυΛ࡞ͬͯϩοΫΛͱͬͯɺ͋͛ΕΑ͍ΑͶ w ࡏݿͷTVNΛͱͬͯΈΔͱԯʹͳΔ w ݱ࣮త͡Όͳ͍
͜ΕͬͯΔਓຊʹ͓ΔΜ͔ʁ
❌ܾࡁ͞ΕͨΒ+PCΛੵΜͰඇಉظͰ w ܾࡁ͞ΕͨΒ+PCΛੵΜͰඇಉظॲཧͰܾࡁΛߦ͏ w ͰϩοΫΛͱͬͯɺࡏݿݮࢉͱܾࡁॲཧΛτϥϯβΫγϣϯͰғΉ w ܾࡁ͕ऴΘͬͨΒԿΒ͔ͷํ๏ͰϢʔβʔʹ௨ w ܾࡁ͔ͯ͠Β݁Ռ͕ฦͬͯ͘Δ·ͰϢʔβʔʹͱͬͯෆ໌ͳঢ়ଶʹ w
ମݧ͕͕ͬͭΓ͔ΘΔ w Ծʹඵ ܾࡁͰۙͨ͘͞ΕΔܭࢉ ѱ͘ͳ͍͔͚ͩͲɺମݧม͑Δͷେมͦ͏
⭕τϥϯβΫγϣϯׂ w ࡏݿͷݮࢉͱܾࡁͷͭͷτϥϯβΫγϣϯʹׂ͢Δ w ϩοΫΛͱͬͯࡏݿΛ֬อ͢ΔτϥϯβΫγϣϯ w ֬อͨ͠ࡏݿΛ֬ఆܾͤͯ͞ࡁΛߦ͏τϥϯβΫγϣϯ w ࣌ؒͷ͔͔ΔܾࡁΛߦ͏τϥϯβΫγϣϯͰϩοΫΛऔΒͳ͍ w
ܾࡁ͕ฒྻ࣮ߦՄೳ w ϢʔβʔͷମݧมΘΒͳ͍ ମݧ͔͑ͣʹεϧʔϓοτΛ্͛Δ͜ͱ͕Ͱ͖Δ
ͪΐͬͱҰݺٵ
ਖ਼ৗܥͷྲྀΕ ҟৗܥͷྲྀΕ ࡏݿ֬อ 5SBO ࡏݿ ࡏݿ༧ ܾࡁ5SBO ༧Ϩίʔυ࡞ ࡏݿݮࢉ ࡏݿՃࢉ
༧Ϩίʔυআ ࡏݿ༧ ༧Ϩίʔυআ 3%#ϩʔϧόοΫ ܾࡁޭ ͜͜Ͱ൵؍ϩοΫ ͬͪ͜ϩοΫͳ͠
ਖ਼ৗܥͷྲྀΕ ҟৗܥͷྲྀΕ ࡏݿ֬อ 5SBO ࡏݿ ࡏݿ༧ ܾࡁ5SBO ༧Ϩίʔυ࡞ ࡏݿݮࢉ ࡏݿՃࢉ
༧Ϩίʔυআ ࡏݿ༧ ༧Ϩίʔυআ 3%#ϩʔϧόοΫ ܾࡁޭ ❌ োൃੜ
ਖ਼ৗܥͷྲྀΕ ҟৗܥͷྲྀΕ ࡏݿ֬อ 5SBO ࡏݿ ࡏݿ༧ ܾࡁ5SBO ༧Ϩίʔυ࡞ ࡏݿݮࢉ ࡏݿՃࢉ
༧Ϩίʔυআ ࡏݿ༧ ༧Ϩίʔυআ 3%#ϩʔϧόοΫ ܾࡁޭ ❌ োൃੜ
ਖ਼ৗܥͷྲྀΕ ҟৗܥͷྲྀΕ ࡏݿ֬อ 5SBO ࡏݿ ࡏݿ༧ ܾࡁ5SBO ༧Ϩίʔυ࡞ ࡏݿݮࢉ ࡏݿՃࢉ
༧Ϩίʔυআ ࡏݿ༧ ༧Ϩίʔυআ 3%#ϩʔϧόοΫ ܾࡁޭ ❌ োൃੜ ❌ %#ଓෆՄ
ਖ਼ৗܥͷྲྀΕ ҟৗܥͷྲྀΕ ࡏݿ֬อ 5SBO ࡏݿ ࡏݿ༧ ܾࡁ5SBO ༧Ϩίʔυ࡞ ࡏݿݮࢉ ࡏݿՃࢉ
༧Ϩίʔυআ ࡏݿ༧ ༧Ϩίʔυআ 3%#ϩʔϧόοΫ ܾࡁޭ ❌ োൃੜ ❌ %#ଓෆՄ :"#"*
ΤϥʔॲཧͷΤϥʔ w ิঈτϥϯβΫγϣϯͰΤϥʔʹͳͬͨΒʁʁʁ w ͢ରࡏݿ༧ͷςʔϒϧʹใ͕͍ͬͯΔ w ͭ·Γɺ͢ରͷࡏݿ༧Ϩίʔυ͕Θ͔ΕࡏݿΛͤΔ w ఆظ࣮ߦͰࡏݿ༧ϨίʔυΛࢹͯ͠ɺ͍࣌ؒͬͯΔͷΛରʹͤ ྑ͍
Կͤͳ͔ͬͨΒΞϥʔτΛ͋͛·͢
࣮ࡍͦ͏͏·͍͔͘ͳ͍ɾɾɾ
"DUJWF3FDPSE$BMMCBDL
"DUJWF3FDPSE$BMMCBDL w BGUFS@DPNNJUBGUFS@DSFBUFͳͲͷz3%#ʹର͢Δૢ࡞zͷΠϕϯτͰϝιο υΛ࣮ߦ͢Δػೳ w ίʔϧόοΫΛଟ༻͢Δ࡞Γʹͳ͍ͬͯͯɺจ࡞࣌ʹϐλΰϥεΠονత ʹ͍ΖΜͳίʔϧόοΫ͕ൃՐ͢Δ w Ͳ͜·Ͱࡏݿ֬อτϥϯβΫγϣϯʹ͢Δඞཁ͕͋Δ͔ɺิঈτϥϯβΫ γϣϯͰͲ͏ॲཧ͢Δ͔શମ૾͕͍ʹ͍͘
w HSFQ͕Ή͍ͣ OFX@SFDPSE ͳͱ͖͚ͩBGUFS@DPNNJU͕ݺΕΔΈ͍ͨͳͷ
"DUJWF3FDPSE$BMMCBDLͷ͠ํ w ରͱͳΔॲཧʹରͯ͠ͷTQFDΛॻ͖·͢ w ࣮ߦ͠·͢ w ൃߦ͞Εͨ42-Λݟ·͢ w ൃߦ͞Εͨ42-͔ΒͦΕͬΆ͍ͷΛΤεύʔ w
ίʔϧόοΫΛࡴͯ͠খ͍͞ूʹ͍ͯ͘͠ ฐࣾͰTQFDΛͪΌΜͱॻ͍͍ͯΔͷͰɺָͦ͜Ͱͨ͠
ಘΒΕͨڭ܇ w ͔͔࣌ؒΔτϥϯβΫγϣϯͰͷ൵؍తϩοΫ৻ॏʹ w ՄೳͰ͋Εආ͚Δ w ͕ࣗѱ͍͜ͱΛ͢ΔͳΒɺͲ͜ͰͳΜͷোى͜͢ͱ͜·Γͦ͏ʁ w ॾઆ͋Δ͚ΕͲ "DUJWF3FDPSE$BMMCBDLΛආ͚Δ
w ࣋Ͱ͕͢ɺ3%#ͷΠϕϯτΛىʹϏδωεϩδοΫΛݺͼग़͢ͷ ͓͔͘͠ͳ͍ʁ ͕ࣗѱ͍͜ͱ͢ΔͳΒʙΛʮΘΔ͖Ύʔ͞ΜͳΒ999ʯΈ͍ͨʹݴͬͯΔ
͜ͷվળޙ͔Β ൵؍ϩοΫͰ٧·ͬͯ·ͤΜ
ɺ͔ͬͨʂʁ
͋ΔɺಥવϨεϙϯεΛฦ͞ͳ͘ͳΔ ݫີʹݴ͏ͱΊͬͪΌ͍
ʮ999ͷจ͕ࡴ౸ͯ͠·͢Ͷʯ ͜͜স͏ͱ͜ΖͰ͢Α
࣍ͷϘτϧωοΫʜ w ਓؾͷΛങ͓͏ͱΞΫηε͕ࡴ౸ w ͨͿΜͯ͢ͷϖʔδͷԠ͕͘ͳͬͨ w "1ͷ$16͕ʹுΓ͍ͨ w %#ͷΞϥʔτ্͕ͬͯͳ͍ w
%BUBEPHͷ5SBDFΛݟΔͱશମతʹۃʹ͍ %BUBEPHೖͬͯͯΑ͔ͬͨʙ
࣍ͷϘτϧωοΫʜ w 3VCZ͕͍ w ͱ͍͏͔TMJN ςϯϓϨʔτΤϯδϯ ͷ࣮ߦ͕͍ w %0.ͷΈཱͯͬͯେมͳΜͩͳʙ w
࣍ଟ%0.ͷΈཱͯΛ7VFʹ͍࣋ͬͯ͘͜ͱʹͳΓͦ͏ 4MJNૣ͘Ͱ͖ͳ͍͔GPSL͚ͨ͠Ͳɺߟ͑ΒΕΔ࠷దԽͯ͋ͬͨ͠
Զୡͷઓ͍ ͜Ε͔Βଓ͍͍ͯ͘ʜ