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
About Rails ConnectionPool
Search
Takahiro Uchiyama
July 22, 2020
Technology
0
170
About Rails ConnectionPool
Quipper社内の「ゆるいRuby LT会 Vol.1」でやった資料です。
Takahiro Uchiyama
July 22, 2020
Tweet
Share
More Decks by Takahiro Uchiyama
See All by Takahiro Uchiyama
日々の意思決定の積み重ねを記録するアーキテクチャ・デシジョン・レコード / Architectural Decision Records
highwide
24
17k
停止性問題と数 / Halting problem and number
highwide
0
980
GraphQLスキーマ設計の悩みどころ/My concerns about GraphQL schema design
highwide
0
1.5k
How about today's coffee?
highwide
0
460
How to choose "best of the best"
highwide
1
650
A question about private method testing
highwide
0
3.3k
A life-changing innovation for my work-style by IoT
highwide
0
640
a-code-to-rhyme
highwide
3
600
よちがや.rb案内スライド
highwide
1
570
Other Decks in Technology
See All in Technology
LINEヤフーのフロントエンド組織・体制の紹介【24年12月】
lycorp_recruit_jp
0
530
終了の危機にあった15年続くWebサービスを全力で存続させる - phpcon2024
yositosi
10
7.9k
私なりのAIのご紹介 [2024年版]
qt_luigi
1
120
PHPからGoへのマイグレーション for DMMアフィリエイト
yabakokobayashi
1
170
GitHub Copilot のテクニック集/GitHub Copilot Techniques
rayuron
36
13k
マイクロサービスにおける容易なトランザクション管理に向けて
scalar
0
120
10分で学ぶKubernetesコンテナセキュリティ/10min-k8s-container-sec
mochizuki875
3
330
【re:Invent 2024 アプデ】 Prompt Routing の紹介
champ
0
140
Wantedly での Datadog 活用事例
bgpat
1
440
Turing × atmaCup #18 - 1st Place Solution
hakubishin3
0
480
20241220_S3 tablesの使い方を検証してみた
handy
4
400
re:Invent をおうちで楽しんでみた ~CloudWatch のオブザーバビリティ機能がスゴい!/ Enjoyed AWS re:Invent from Home and CloudWatch Observability Feature is Amazing!
yuj1osm
0
120
Featured
See All Featured
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
Building Adaptive Systems
keathley
38
2.3k
Producing Creativity
orderedlist
PRO
341
39k
Practical Orchestrator
shlominoach
186
10k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
Music & Morning Musume
bryan
46
6.2k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Optimising Largest Contentful Paint
csswizardry
33
3k
Speed Design
sergeychernyshev
25
670
Done Done
chrislema
181
16k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Transcript
Նͩʂ ϓʔϧͩʂ 3VCZͰ-5ͩʂʂʂ Նͩʂ ϓʔϧͩʂ 3VCZͰ-5ͩʂʂʂ 2VJQQFSࣾΏΔ͍3VCZ-5ձ7PM !IJHIXJEF
ίωΫγϣϯ ϓʔϧͷ ࣮ΛͬͯΈͨ ίωΫγϣϯ ϓʔϧͷ ࣮ΛͬͯΈͨ 2VJQQFSࣾΏΔ͍3VCZ-5ձ7PM !IJHIXJEF ͱ͍͏Θ͚Ͱ
"CPVUNF BOEUPEBZTUIFNF ✴ ݄2VJQQFSʹKPJO ✴ ίʔνϯάνʔϜͰ8FC։ൃΛ͍ͬͯΔ ✴ ͜ͳ͍ͩͷVKJIJTBษڧձͰͷGPSLUISFBEͷઆ໌͕େมΘ͔Γ͔ͬͨ͢ͷͰɺۀʹͭͳ͕ ΔܗͰ͏গ͠۷ΓԼ͛ͯΈ͍ͨͱࢥͬͨ ✴
✴ 3BJMTͷ$POOFDUJPO1PPM5ISFBEͱ͕ؔ͋Δͱ͍͏ͳΜͱͳ͘ฉ͍ͨ͜ͱ͕͋Γɺ͜ ΕΛ۷ΓԼ͛Δͷʮࣗʹͱͬͯ৽نੑʯ͕͋Γͦ͏
ͱ͍͏͍ܰؾ࣋ͪͰ࢝ΊͨΒ ऩर͕͔ͭͳ͘ͳͬͨͷͰ ੜஆ͔͍ͰݟकͬͯΒ͑Δͱ͏Ε͍͠Ͱ͢ ˞͜ͷϖʔδൃදલʹͲ͏͢Μͩ͜Εͬͯؾ࣋ͪʹͳͬͯՃ͠·ͨ͠
Foo.find(1) ௐࠪΛελʔτ͢Δ্Ͱͷ࠷ॳͷϞνϕʔγϣϯ ࠓ3BJMTͷ͜ͷཪଆͰ ίωΫγϣϯ͕Ͳ͏ΘΕ͍͔ͯ͘ίʔυΛ͍ͬͯͧ͘ʂ
ͱ͜Ζ͕ʮ'PPGJOEʯͰίωΫγϣϯϓʔϧ͕ Ͳ͏ΘΕΔ͔ݟΔલʹ 3BJMTΛىಈͨ͠ͱ͜Ζ͔Β͍ͬͯ͘ඞཁ͕͋Δͱɺ ࠓճֶΜͰ͍ͯΘ͔ͬͨɻ
SBJMTىಈ࣌ʹBDUJWFSFDPSESBJMUJF͕SFRVJSF͞ΕΔ IUUQTSBJMTHVJEFTKQJOJUJBMJ[BUJPOIUNM
BDUJWFSFDPSEMJCBDUJWF@SFDPSEDPOOFDUJPO@IBOEMJOHSC DPOGJHͷಡΈࠐΈׂѪɻ
BDUJWFSFDPSEMJCBDUJWF@SFDPSESBJMUJFSC ·ͣ͜͜ͰFTUBCMJTI@DPOOFDUJPO͕ݺΕΔɻ
BDUJWFSFDPSEMJCBDUJWF@SFDPSEDPOOFDUJPO@IBOEMJOHSC ͜͜ͷFTUBCMJTI@DPOOFDUJPO͕ݺΕΔɻ
DPOOFDUJPOͷઃఆΛಡΈࠐΜͰ
ʮDPOOFDUJPO@IBOEMFSʯͷɺFTUBCMJTI@DPOOFDUJPOΛݺͿɻ DPOOFDUJPO@IBOEMFSͬͯԿʁ
BDUJWFSFDPSEMJCBDUJWF@SFDPSEDPSFSC ࠓͷ5ISFBEʹઃఆ͞Ε͍ͯΕɺͦͷDPOODUJPO@IBOEMFSΛ͏ɻ ·ͩઃఆ͞Εͯͳ͔ͬͨΒɺ$POOFDUJPO"EBQUFST$POOFDUJPO)BOEMFSΛ5ISFBEʹొ͓ͯ͘͠ɻ $POOFDUJPO)BOEMFS5ISFBEʹͭͷΑ͏ͩɻ
BDUJ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͘ɻ
ᐌ͘ ✴ ίωΫγϣϯϓʔϧɺσʔλϕʔεଓΛߦ͏εϨουͱಉظ͢Δ ✴ ͦΕͧΕͷεϨουσʔλϕʔεͷίωΫγϣϯΛίωΫγϣϯϓʔϧ͔ΒνΣοΫΞ τ͠ɺίωΫγϣϯΛ͍ɺ͍ऴΘͬͨΒνΣοΫΠϯ͢Δ ฦ͢ ɻ ✴ $POOFDUJPO1PPMશʹUISFBETBGFͰɺҰͭͷίωΫγϣϯͭͷεϨου͔Βಉ࣌ʹ
͑ͳ͍ɻ ✴ ίωΫγϣϯΑΓεϨου͕ଟ͍ͱ͖ʹɺεϨου্͕ݶΛ͑ͯίωΫγϣϯΛ νΣοΫΞτ͠Α͏ͱͨ͠ͱ͖ɺ$POOFDUJPO1PPM5ISFBE͕ίωΫγϣϯΛฦͯ͘͠ ΔͷΛͭ
BDUJWFSFDPSEMJCBDUJWF@SFDPSEDPOOFDUJPO@BEBQUFSTBCTUSBDUDPOOFDUJPO@QPPMSC
ίωΫγϣϯΛΩϟογϡ͢Δ͍ΕͷΛ࡞͓ͬͯ͘
ίωΫγϣϯऔಘͪ ͷΩϡʔΛ࡞͓ͬͯ͘
None
IUUQTBQJSVCZPOSBJMTPSHDMBTTFT"DUJWF3FDPSE$POOFDUJPO"EBQUFST$POOFDUJPO1PPM3FBQFSIUNM EBUBCBTFZNMͰઃఆ͞ΕͨGSFRVFODZͷඵ ͘͠σϑΥϧτͷඵ ͝ͱʹ ίωΫγϣϯϓʔϧͷGMVTIͱSFBQΛݺΜͰ͍Δ
None
None
None
None
✴ EBUBCBTFZNM͔ΒಘΒΕͨTQFDΛͱʹ$POOFDUJPO1PPMΛ࡞͍ͬͯΔ ✴ $POOFDUJPO1PPMࣗମ࡞Δͷͷɺ·ͩ$POOFDUJPOࣗମཱ͍֬ͯ͠ͳ͍͜ͱ͕Θ͔Δ "DUJWF3FDPSE$POOFDUJPO"EBQUFST$POODFUJPO)BOEMFSFTUBCMJTI@DPOOFD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EMJCBDUJWF@SFDPSEDPOOFDUJPO@BEBQUFSTBCTUSBDUDPOOFDUJPO@QPPMSC OFX@DPOOFDUJPOࣗମɺ֤%#ͷBEBQUFS͔ΒಘΒΕΔ
BDUJWFSFDPSEMJCBDUJWF@SFDPSEDPOOFDUJPO@BEBQUFSTBCTUSBDUDPOOFDUJPO@QPPMSC 5ISFBEಉظͷதͰɺ৽͍͠DPOOFDUJPO͕QPPMʹొ͞ΕΔ
BDUJWFSFDPSEMJCBDUJWF@SFDPSEDPSFSC ͱ͍͏Θ͚ͰɺDPOFODUJPOऔಘͷཱྀ͍͕ऴΘΓɺGJOEͰ͏ͨΊͷDPOOFDUJPO͕֬อͰ͖ͨʂ
ײ ✴ ࣮ɺ·ͱʹ3BJMTͷίʔυΛಡΜͰ͍͘ܦݧ͕͋·Γͳ͔ͬͨͷͰָ͋ͬͨ͘͠ ✴ εϥΠυʹసه͠ͳ͕ΒίʔυϦʔσΟϯά͍ͯ͘͠ͷɺҙ֎ͱϝϞϦ͕εϥΠυʹ ΔͷͰͪΐͬͱ͚ͩศར ✴ $POOFDUJPO1PPMͷ2VFVFͱ3FBQFSपΓͷཧղ͕·ͩઙ͍ ✴ 3BJMTͷ"84ͷ"VSPSBͷϑΣΠϧΦʔόʔ$POOFDUJPO1PPMपΓͰ૬ੑ͕ѱ͍ͱ͍͏ʹͭ
͍ͯฉ͍ͨ͜ͱ͕͋Γɺͦͷ͋ͨΓͷݟ͕ࣝਂ·ͬͨ ✴ ࢀߟIUUQNBUTVLB[IBUFOBCMPHDPNFOUSZ
-FUTEJWFJOUPUIFQPPM 5IBOLT