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
実践サーバーレスパフォーマンスチューニング ~その実力に迫る~ / Practical ...
Search
shiro seike
PRO
October 12, 2024
Programming
2
350
実践サーバーレスパフォーマンスチューニング ~その実力に迫る~ / Practical Serverless Performance Tuning ~A Close Look at its Power~
JAWS FESTA 2024 in 広島
https://jawsfesta2024.jaws-ug.jp
shiro seike
PRO
October 12, 2024
Tweet
Share
More Decks by shiro seike
See All by shiro seike
AWS Lambdaから始まった Serverlessの「熱」とキャリアパス / It started with AWS Lambda Serverless “fever” and career path
seike460
PRO
1
510
とにかくAWS GameDay!AWSは世界の共通言語! / Anyway, AWS GameDay! AWS is the world's lingua franca!
seike460
PRO
1
1.1k
PHPを書く理由、PHPを書いていて良い理由 / Reasons to write PHP and why it is good to write PHP
seike460
PRO
5
590
AWS CDKを用いたセキュアなCI/CDパイプラインの構築 / Build a secure CI/CD pipeline using AWS CDK
seike460
PRO
3
750
いまあるチームにフィットさせる Serverless そして Platform Engineeringへの挑戦 / Serverless Fits the Team You Have and Platform Engineering
seike460
PRO
2
2.1k
いまあるチームにフィットさせる Serverless / Serverless fits in with the team you have now.
seike460
PRO
2
180
地方こそサーバーレス! チームにフィットさせるサーバーレス / Rural areas are serverless! Serverless to Fit Your Team
seike460
PRO
1
120
AWS X-Rayを利用したサーバーレスのパフォーマンス分析 / Serverless performance analysis using AWS X-Ray
seike460
PRO
2
180
Cloudflare Workers x AWS Lambdaの組み合わせユースケース / Cloudflare Workers x AWS Lambda Combination Use Case
seike460
PRO
2
530
Other Decks in Programming
See All in Programming
ソフトウェアの振る舞いに着目し 複雑な要件の開発に立ち向かう
rickyban
0
890
バグを見つけた?それAppleに直してもらおう!
uetyo
0
170
StarlingMonkeyを触ってみた話 - 2024冬
syumai
3
270
SymfonyCon Vienna 2025: Twig, still relevant in 2025?
fabpot
3
1.2k
create_tableをしただけなのに〜囚われのuuid編〜
daisukeshinoku
0
230
Асинхронность неизбежна: как мы проектировали сервис уведомлений
lamodatech
0
430
rails stats で紐解く ANDPAD のイマを支える技術たち
andpad
1
280
testcontainers のススメ
sgash708
1
120
KubeCon + CloudNativeCon NA 2024 Overviewat Kubernetes Meetup Tokyo #68 / amsy810_k8sjp68
masayaaoyama
0
240
As an Engineers, let's build the CRM system via LINE Official Account 2.0
clonn
1
670
これでLambdaが不要に?!Step FunctionsのJSONata対応について
iwatatomoya
2
3.6k
コンテナをたくさん詰め込んだシステムとランタイムの変化
makihiro
1
120
Featured
See All Featured
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
A designer walks into a library…
pauljervisheath
204
24k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.1k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
Documentation Writing (for coders)
carmenintech
66
4.5k
KATA
mclloyd
29
14k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
32
2.7k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Making the Leap to Tech Lead
cromwellryan
133
9k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
8.3k
Transcript
©Fusic Co., Ltd.  1 ࣮ફαʔ バ ʔϨε パ ϑΥʔϚϯενϡʔχϯ
グ ~ͦͷ࣮ྗʹഭΔ~ 2024.10.12 @seike460 JAWS FESTA 2024 in ౡ
©Fusic Co., Ltd. 2 ਗ਼Ո ࢙ @seike460 AWS Community Builder
Serverless BacklogWorld2024 ࣮ߦҕһ 12/14@ԣ ίϛϡχςΟ JAWS-UG Fukuoka Serverless Meetup Fukuoka Cloudflare Meetup Fukuoka JBUG Fukuoka JP_Stripes Fukuoka Fukuoka.php Fukuoka.go ࣗݾհ ͡Ίʹ גࣜձࣾFusicʢԬʣ ϓϦϯγύϧΤϯδχΞ/ΤόϯδΣϦετ
©Fusic Co., Ltd. 3 CONTENTS ࣍ 1. αʔόʔϨεͱύϑΥʔϚϯε 2. ϘτϧωοΫͷ୳ࡧͱՄࢹԽ
3. ϘτϧωοΫݪҼͷߟ 4. ϘτϧωοΫͷΞϓϩʔν 5. ·ͱΊ
©Fusic Co., Ltd. 4 αʔόʔϨεͱύϑΥʔϚϯε 1
©Fusic Co., Ltd. 5 αʔόʔϨεͱύϑΥʔϚϯε αʔόʔϨεΞʔΩςΫνϟجຊϚωʔδυαʔϏε͕લఏ - Πϯϑϥཧෆཁ - ࣗಈεέʔϦϯά
ͦͷજࡏೳྗͷߴ͔͞ΒʮͳΜͱͳ͘ʯߏஙͯ͠ ߴ͍ύϑΥʔϚϯε͕ग़Δ͜ͱ͕ଟ͍Ͱ͢ ҰํͰԿߟ͑ͳ͍ͱαʔόʔϨεͷ࣮ྗΛൃش͠Δ͜ͱͰ͖·ͤΜ
©Fusic Co., Ltd. 6 αʔόʔϨεͰύϑΥʔϚϯεΛग़͢ҝʹඞཁͳࣄ αʔόʔϨεΞʔΩςΫνϟجຊతʹߴύϑΥʔϚϯε ͔ͩΒͦ͜গ͠ͷϘτϧωοΫݦࡏԽ͍͢͠ͱ͍͏ಛ͕͋Δ ͰԿΛ͢ΕΑ͍ͷ͔ ʮਖ਼͘͠ঢ়گΛѲͯ͠ɺਖ਼͘͠ରॲΛ͠ଓ͚Δʯࣄʹਚ͖·͢ αʔόʔϨεΞʔΩςΫνϟͷίΞίϯϙʔωϯτͰ͋Δ
AWS LambdaΛத৺ʹύϑΥʔϚϯενϡʔχϯάΛߦͬͯΈ·͠ΐ͏
©Fusic Co., Ltd. 7 The Serverless ArchitectureͳΑ͋͘Δߏ - Amazon API
Gateway - RESTful APIͷΤϯυϙΠϯτΛఏڙ - AWS Lambda - ϏδωεϩδοΫΛ࣮ ࠓճPython - Amazon DynamoDB - σʔλετΞͱͯ͠ར༻ - AWS SAM - Serverless༻ͷIaC
©Fusic Co., Ltd. 8 ࠓճ୯ମͷॲཧվળ ࠓճrpsͰͳͯ͘ ͻͨ͢Β୯ମͷॲཬΛվળ͠·͢ ݁Ռrps࣮֬ʹ্͠·͢ AWS LambdaΛத৺ʹ
ϘτϧωοΫΛ୳ͯ͠ վળΛߦ͍͖ͬͯ·͠ΐ͏
©Fusic Co., Ltd. 9 ϘτϧωοΫͷ୳ࡧͱՄࢹԽ 2
©Fusic Co., Ltd. 10 ϘτϧωοΫͷ୳ٻ(※େલఏɺຊདྷHandlerͱॲཧ͚·͠ΐ͏) ͋Δ͕͍ؔͱใࠂ AWS LambdaͷίʔυΛ ݟͯΈΔͱࠨͷίʔυ͕ ࠨͷίʔυΛύοτݟͰ
ਖ਼͘͠վળ͢Δ͜ͱ ग़དྷ·͔͢ʁ -> NOͩ͠ɺYESͱ͑Δਓ͕ ͍ͯ࠶ݱੑͷͳ͍ݸਓೳྗ
©Fusic Co., Ltd. 11 ࠓԿ͕ى͍ͬͯ͜Δ͔Θ͔Βͳ͍ গ͠ҙਂ͘ݟͯ… - Handlerʹ༷ʑͳॲཧ͕ - Ͳ͔͔͜ΒUserͷใऔಘ͕
- ԿΒN+1͕ - Ͳ͔͜ʹAPIΞΫηεͯ͠Δʁ ͍ॲཧͷதʹ৭ʑͳ͕ ೖ͍ͬͯͦ͏
©Fusic Co., Ltd. 12 AWS X-Ray ΞϓϦέʔγϣϯͷύϑΥʔϚϯεΛ͠ՄࢹԽ͢ΔͨΊͷαʔϏε τϨʔεΛͬͯࢄγεςϜͷϦΫΤετͷྲྀΕΛࢹ֮Խ ಛʹαʔόʔϨεΞʔΩςΫνϟͰ༗༻
©Fusic Co., Ltd. 13 AWS X-Ray ͷΈ - τϨʔγϯάσʔλͷऩू -
࠷ॳʹτϨʔε IDΛੜͯ͠ɺ֤छαʔϏεʹ࿈ܞ - τϨʔεηάϝϯτΛར༻ͯ͠ՄࢹԽ͢Δ - LambdaɺAPI GatewayɺDynamoDB ͳͲͷαʔϏε - ҙͷαϒηάϝϯτͷ֓೦ಋೖՄೳ - τϨʔεͷྲྀΕ - ϦΫΤετ͕ͲͷαʔϏεΛ௨ա͢Δ͔ΛՄࢹԽ Ͳ͜Ͱ͍͔ɺΤϥʔ͕ൃੜ͍ͯ͠ͳ͍͔֬ೝՄೳ
©Fusic Co., Ltd. 14 AWS X-Ray ͷಋೖɿtemplate.yaml AWS SAM Template.yaml
Tracing: Active Λهड़͢Δ τϨʔεID͕ੜ͞ΕΔ Α͏ʹͳΔ
©Fusic Co., Ltd. 15 AWS X-Ray ͷಋೖɿιʔείʔυ requirements.txtΛར༻͠ pip install
ͦͷޙpatch_all()Λ࣮ߦ͢Δ ֤छAWSαʔϏεͷ τϨʔε͕ߦΘΕͯɺ τϨʔεϚοϓ͕࡞͞ΕΔ
©Fusic Co., Ltd. 16 AWS X-Ray τϨʔεϚοϓ ԿΒ༷ʑͳґଘ͕ؔ͋Γͦ͏
©Fusic Co., Ltd. 17 AWS X-Ray τϨʔεϚοϓ ԿΒ༷ʑͳґଘ͕ؔ͋Γͦ͏ - DynamoDB
- S3 - DynamoDB - ֎෦API
©Fusic Co., Ltd. 18 ߋʹιʔείʔυͷϘτϧωοΫΛ͏ segment୯ҐͰͷτϨʔε͕Մೳ xray_recorder.begin_subsegment xray_recorder.end_subsegment Ͱࢦఆൣғͷsubsegment୯Ґͷ࣮ߦ࣌ؒ with
xray_recorder.in_subsegment ࣮ࡍͷॲཬ ͱ͍͏ॻ͖ํՄೳ
©Fusic Co., Ltd. 19 ߋʹιʔείʔυͷϘτϧωοΫΛ͏ segment୯ҐͰͷτϨʔε͕Մೳ xray_recorder.begin_subsegment xray_recorder.end_subsegment Ͱࢦఆൣғͷsubsegment୯Ґͷ࣮ߦ࣌ؒ with
xray_recorder.in_subsegment ࣮ࡍͷॲཬ ͱ͍͏ॻ͖ํՄೳ
©Fusic Co., Ltd. 20 ؔ୯ҐͰͷTraceՄೳ ؔ୯ҐͰTrace͍ͨ͠߹ @xray_recorder.captureΛར༻ ࣮ߦ͕͔͔͍࣌ؒͬͯΔؔͷಛఆ͕Մೳ
©Fusic Co., Ltd. 21 ؔͰͷαϒηάϝϯτઃఆ͕Մೳ ෳࡶ͔ͭߴՃ͕͔͔Δcomplex_logicʹ ॲཧ͕͔͔͍࣌ؒͬͯΔՕॴΛಛఆ͢Δҝɺ Segment୯ҐͰͷऩूΛ࣮ࢪ ※͜ͷؔͷதࣗମChatGPTʹ ʮpandasͱnumpyΛͬͨCPUόϯυͳॲཧʯ
Λੜͯ͠Β͍·ͨ͠ ސ٬ͷϥΠϑλΠϜՁʢCLVʣ ͷγϛϡϨʔγϣϯΒ͍͠ ؔͷதͰ͕͔͔͍࣌ؒͬͯΔϙΠϯτ͕ Ͳ͜ͳͷ͔ͷಛఆ͕ग़དྷΔ
©Fusic Co., Ltd. 22 ؔͰͷαϒηάϝϯτઃఆ͕Մೳ
©Fusic Co., Ltd. 23 AWS X-Ray τϨʔεը໘ શମͰ23ඵͱ͓ੈࣙʹૣ͍ͱݴ͑ͳ͍͜ͱ͕ݟ͑Δ ҰͭҰͭυϦϧμϯ͍͖ͯ͠·͠ΐ͏
©Fusic Co., Ltd. 24 ϘτϧωοΫݪҼͷߟ 3
©Fusic Co., Ltd. 25 Init -> ColdStart initʹ͕͔͔͍࣌ؒͬͯΔࣄ͕Θ͔Δ -> ColdStart͕3ඵͱൺֱత͍ͷͰɺColdStartରࡦ͚ͩͰ͋Δఔվળͦ͠͏
©Fusic Co., Ltd. 26 Ϣʔβʔใͷऔಘ Ϣʔβʔใͷऔಘʹͯɺget_users -> get_user_infoͱ͍͏ DynamoDBʹؔ͢Δσʔλऔಘ͕ൃੜ͍ͯ͠Δ get_usersͱ͍͏ෳͷऔಘͱget_user_infoͱ͍͏ύʔςΟγϣϯΩʔʹରͯ͠
ߦ͍ͦ͏ͳؔͰDynamoDBʹର͢Δ͕ࠩ΄΅ͳ͍͜ͱ͕ؾʹͳΔ
©Fusic Co., Ltd. 27 Ϣʔβʔใͷऔಘ Ϣʔβʔใͷऔಘʹͯɺget_users -> get_user_infoͱ͍͏ DynamoDBʹؔ͢Δσʔλऔಘ͕ൃੜ͍ͯ͠Δ get_usersͱ͍͏ෳͷऔಘͱget_user_infoͱ͍͏ύʔςΟγϣϯΩʔʹରͯ͠
ߦ͍ͦ͏ͳؔͰDynamoDBʹର͢Δ͕ࠩ΄΅ͳ͍͜ͱ͕ؾʹͳΔ
©Fusic Co., Ltd. 28 DynamoDBʹର͢ΔN+1 get_user_info͕܁Γฦ͞Ε͍ͯΔ N+1͕ൃੜ͍ͯ͠Δࣄ͕Θ͔Δ DynamoDBʹܧଓతͳෛՙ͕͔͔Δ͠ ୯७ʹύϑΥʔϚϯεͷӨڹ͕ग़͍ͯΔ
©Fusic Co., Ltd. 29 complex_logicͱ͍͏ෛՙ͕ߴ͍ؔ complex_logicͱ͍͏ෛՙ͕ߴ͍ؔͷதͰɺ ಛʹγϛϡϨʔγϣϯΛߦ͍ͬͯΔ෦ͷෛՙ͕ߴ͍͜ͱ͕ݟ͑Δ ͳ͓͔ͭઌఔ֬ೝͨ࣌͠ʹɺͻͨ͢ΒܭࢉॲཧΛߦ͍ͬͯͨ͜ͱ֬ೝग़དྷͨͷͰ ୯७ʹCPUͷରॲ͔͠ͳͦ͞͏
©Fusic Co., Ltd. 30 վम͕͍͠֎෦APIͷϘτϧωοΫ ֎෦APIΞΫηε͍ͯͯ͠ɺվम͕͍͠ύϑΥʔϚϯεͷϘτϧωοΫ ֬ೝ͕ग़དྷͨ ʢhttpbin.org֤Methodʹର͢ΔϨεϙϯεΛฦͯ͘͠ΕΔαΠτʣ
©Fusic Co., Ltd. 31 શମͷ͕ݟ͑ͯ͘Δ ·ͩશʹΘ͔͍ͬͯͳ͍͕վम͠ͳ͚ΕͳΒͳ͍ର͕ߜΕ͖ͯͨ ࠓճSegment୯ҐͰѲ͠ʹ͍͍ͬͯΔ͕ɺࡶʹpatch_all͢Δ͚ͩͰ༗༻Ͱ͢
©Fusic Co., Ltd. 32 Lambda Insights AWSͷαʔϏεΛར༻͢ΔͳΒ Lambda InsightsҰͭͷखஈ ػೳΛOnʹ͢Δ͚ͩͰ
AWS LambdaͷύϑΥʔϚϯε ʹؔΘΔσʔλͷՄࢹԽ͕ ͘͢͠ͳΓ·͢
©Fusic Co., Ltd. 33 Lambda Insights ύϑΥʔϚϯεΛࣔ࣌ؒ͢ CPUͷ༻࣌ؒϝϞϦͷ༻ྔωοτϫʔΫIO·ͰݟΕΔ ͜͜Ͱେ·͔ͳঢ়گΛ࠷৽1000݅·ͰѲ͢Δ͜ͱ͕Մೳʹ
©Fusic Co., Ltd. 34 Lambda Insights Performanceϩά ColdStart͍ͯ͠Δ͔ɺColdStartͷ࣌ؒͳͲදࣔ ϝϞϦ༻ྔѲͰ͖ΔͷͰ ࣮ࡍͷLambdaͷϝϞϦαΠζΛܾΊΔ࣌ͷ
ඇৗʹࢀߟʹͳΓ·͢ ࠓճϝϞϦ90%Ҏ্͍ͬͯ·͢͠ CPUύϫʔΛ্͍͛ͨͷͰϝϞϦΛ1024MB·Ͱ্͛·͢ ※AWS Lambda ͷCPUϝϞϦґଘ ߋʹ͜ͷιʔείʔυΛཧղ͢ΔͨΊʹѲΛਐΊΔ
©Fusic Co., Ltd. 35 cProfile ιʔείʔυͷதͷϥΠϒϥϦͷதͷॲཧ·Ͱ ੳ͢ΔͨΊʹcProfileͱ͍͏ϥΠϒϥϦΛར༻ cProfile.Profile().enable cProfile.Profile().disable ͷؒͷϓϩάϥϜ࣮ߦΛؔͷ୯ҐͰ
ͯ͢ϓϩϑΝΠϦϯάͯ͘͠ΕΔεάϨϞϊ ※ࠓճPythonͳͷͰcProfile͕ͩ PHPͳΒ Xdebug GoͳΒ pprof JavaScriptͳΒ Profiler API
©Fusic Co., Ltd. 36 cProfile ࠷ऴతʹϓϩϑΝΠϦϯά݁ՌΛऔΓग़͢ ඞཁ͕͋ΔͷͰS3ʹϑΝΠϧอଘ ͦͷϑΝΠϧΛऔಘͯ͠ɺ ϩʔΧϧͷPCͰ࣮ࡍͷղੳΛߦ͏ ※S3ͷputݖݶΛΕͣʹ
©Fusic Co., Ltd. 37 snakeviz औಘͨ͠profϑΝΠϧΛ ՄࢹԽ͢ΔͨΊʹ ʮsnakevizʯΛར༻ profϑΝΠϧΛಡΈࠐ·ͤ ϩʔΧϧαʔόʔΛཱͯΔ
http:://localhost:8080 ࠨͷ༷ͳάϥϑ͕֬ೝՄೳʹ
©Fusic Co., Ltd. 38 snakeviz ؔΛΫϦοΫ͢Δͱ υϯυϯؔʹજΓɺ Ͳ͕͜ݪҼͷؔͳͷ͔ ಛఆ͢Δ͜ͱ͕Մೳ
©Fusic Co., Ltd. 39 snakeviz connectionpool.py͕ ͔ͳΓͷׂ߹ΛΊ͍ͯΔ Կར༻͢Δ෦Ͱ͋Δ͕ ຊདྷଓΛҰߦͬͯɺ ͍ճ࣮͢ʹͳͬͯΔͣ
͔ͯ͠͠connectionpool͕ ਖ਼͑ͯ͘͠ͳ͍ʁ
©Fusic Co., Ltd. 40 snakeviz Call͞Ε͍ͯΔճɺ͔͔͍ͬͯΔؙ࣌ؒΘ͔ΓͳͷͰɺରॲ͕͍͢͠ ͱ͍͑ؔΊͪΌͪ͘Ό͕͋ΔͷͰɺ ਖ਼͜Ε͚ͩͩͱݫ͠͞Λײ͡ΔͨΊɺAWS X-rayͱͷ݁ՌΛΈ߹Θͤͯ ߟ͢Δͷ͕ྑ͍
©Fusic Co., Ltd. 41 ରॲ༰ͷߟ - CPUόϯυͳܭࢉॲཧ͕େ͖͘Өڹ - CPUΛ্͛ΔͨΊʹɺϝϞϦαΠζΛ্͛ΔͱΑͦ͞͏ -
DynamoDBͷσʔλऔಘॲཬࣗମʹ͕͋Γͦ͏ - औಘؔͷॲཬݟ͕͠ඞཁͦ͏ - DynamoDBʹର͢ΔN+1͕ൃੜ͍ͯͦ͠͏ - DynamoDBͷઃܭݟ͠ͰରԠग़དྷͳ͍͔ - ֎෦APIͷΞΫηε͕ͦͷ··͘ͳΔ - ֎෦APIͷରॲग़དྷͳ͍ͷͰඇಉظʹॲཧͰ͖ͳ͍͔ ※ࠓճඇಉظॲཧͯ͠ྑ͍ͷͱ͢Δ
©Fusic Co., Ltd. 42 ࣮ࡍͷରॲΛߦ͍ͬͯ͘ ܭଌͷ݁ՌɺରԠࡦ·Ͱݟ͖͑ͯͨͷͰ࣮ࡍͷॲཧվળΛߦ͍ͬͯ͘
©Fusic Co., Ltd. 43 ϘτϧωοΫͷΞϓϩʔν 4
©Fusic Co., Ltd. 44 ϝϞϦαΠζΞοϓ ·ͣ୯७ʹϝϞϦαΠζΛ্͛ͯΈΔ 128 MB -> 1024MB
߹ΘͤͯArchitecturearm64ʹͨ͠΄͏͕ ૣ͘ͳΓ·͢ CPUόϯυͳcomplex_logic͕ ͔͋Β͞·ʹૣ͘ͳΔͷ͕Θ͔Δ
©Fusic Co., Ltd. 45 ϓϩϏδϣϯυίϯΧϨϯγʔͷద༻ ϓϩϏδϣϯυίϯΧϨϯγʔΛద༻͢Δ͚ͩͰ ίʔϧυελʔτ͕ରॲग़དྷΔ ϥΠϒϥϦΛݮΒ͢ࣄ͕ग़དྷͳ͍࣌ૉʹಋೖ
©Fusic Co., Ltd. 46 ϥΠϒϥϦͷImportͷରࡦΛߦ͍͍ͨ࣌ҎԼͷهࣄ Ҿ༻ɿhttps://qiita.com/_kensh/items/ce620ec5b53c623775ae AWSJ Serverless Specialist @_kensh
ͦΖͦΖΧϯϑΝϨϯεͰຊҰԼ͞ΜͷهࣄΛҾ༻͍ͯ͠ΔஉʹͳΓͦ͏Ͱ͢
©Fusic Co., Ltd. 47 DynamoDBΫϥΠΞϯτͷੜ ίʔυΛΑ͘ݟΔͱ͕ؔݺΕΔͨͼʹ DynamoDBΫϥΠΞϯτ͕ੜ͞Ε͍ͯͨ ͜ΕΛάϩʔόϧείʔϓͰ༧Ί࡞͢ΔࣄͰ ଓΛ͍ճ͢Α͏ʹग़དྷͨ
©Fusic Co., Ltd. 48 DynamoDBઃܭͷݟ͠ N+1ൃੜݪҼςʔϒϧΛUserͱUserInfosʹ͚ RDBͷࢥͰઃܭ͕ߦΘΕ͍͔ͯͨΒ 1ରଟͷؔΛޮతʹѻ͏ͨΊʹ ୯Ұςʔϒϧઃܭʹ͢Δ͜ͱͰN+1ͷղফ͕Մೳ
©Fusic Co., Ltd. 49 SQSʹΑΔඇಉظԽ ֎෦APIରॲ͕͠Α͏͕ͳ͍ͷͰɺ ϦΫΤετ͔ΒΓ͢ࣄͰରԠΛߦ͏ AWS SAMͰSQSΠϕϯτۦಈͷઃఆΛߦͬͯ SQSσʔλΛૹ৴͢Δ͚ͩ
ࢥͬͨΑΓඇಉظԽ؆୯ʹग़དྷΔ
©Fusic Co., Ltd. 50 SQSʹΑΔඇಉظԽ ֎෦API෦ΛSQSͷΩϡʔΠϯάʹมߋ SQSىಈͰผͷLambdaΛىಈ LambdaଆͰ֎෦APIΛݺͼग़͢ࣄͰɺ ֎෦APIґଘ͔Β٫
©Fusic Co., Ltd. 51 ॲཧ༰มߋͤͣͱߴԽ ͻͨ͢Βରॲ͢Δ͜ͱͰ23ඵ -> Λ1.26ඵ·ͰݮΒ͢͜ͱʹޭʢτϨʔε͠ͳ͕Βʣ ͬͯΔ͜ͱେͨ͠༰Ͱͳ͍ͷʹɺ͜͜·Ͱվળ͕ߦ͑Δ
©Fusic Co., Ltd. 52 αʔόʔϨεͰύϑΥʔϚϯενϡʔχϯάͷجຊಉ͡ ϚωʔδυαʔϏεϕʔεͷαʔόʔϨε݁ہΞʔΩςΫνϟ ύϑΥʔϚϯενϡʔχϯάͷجຊಉ͡Ͱ ܭଌɺߟɺ࣮ߦͷαΠΫϧΛճ͢ ͜ͷαΠΫϧΛճͨ݁͠Ռɺજࡏೳྗ͕ߴ͍ՁΛൃشͰ͖Δ
©Fusic Co., Ltd. 53 ·ͱΊ 5
©Fusic Co., Ltd. 54 ·ͱΊ αʔόʔϨεΞʔΩςΫνϟεέʔϧΛલఏͱ͍ͯ͠Δ͕ɺॲཧΛݟ͢͜ͱͰਅͷ࣮ྗΛൃش Point 01 ·ͣঢ়گͷѲ͕େࣄɺAWS X-rayɺLambda
InsightsɺϓϩϑΝΠϥʔΛۦͯ͠ܭଌͱѲ Point 02 ঢ়گͷѲ͕ग़དྷͨΒɺࠓ·ͰͷࣝΛۦͯ͠ҰͭҰ࣮ͭ֬ʹରॲɺܭଌΛ܁Γฦͯ͠վળ Point 03 ܭଌɺߟɺ࣮ߦͷαΠΫϧΛճͯ͠ɺServerlessͷਅͷՁʹ͖ۙͮ·͠ΐ͏ʂ Point 04
©Fusic Co., Ltd. 55 Thank You We are Hiring! https://recruit.fusic.co.jp/
͝ਗ਼ௌ͍͖ͨͩ͋Γ͕ͱ͏͍͟͝·ͨ͠