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
PHPで学ぶCacheの距離の話
Search
Ryo Tomidokoro
October 31, 2018
Programming
1.2k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
PHPで学ぶCacheの距離の話
Cacheの距離について
Ryo Tomidokoro
October 31, 2018
More Decks by Ryo Tomidokoro
See All by Ryo Tomidokoro
Laravelで学ぶ Webアプリケーションチューニング入門/web_application_tuning_101
hanhan1978
4
1.8k
あるアーキテクチャ決定と その結果/architecture-decision-and-its-result
hanhan1978
2
1.5k
開発者が知っておきたい複雑さの正体/where-the-complexity-comes-from
hanhan1978
8
3.8k
Spec Driven Development入門/spec_driven_development_for_learners
hanhan1978
2
1.9k
フロントエンドがTypeScriptなら、バックエンドはPHPでもいいじゃない/php-is-not-bad
hanhan1978
8
14k
どうすると生き残れないのか/how-not-to-survive
hanhan1978
17
15k
100分で本番デプロイ!Laravelで作るWebアプリケーション作成/100min_web_app_cicd
hanhan1978
1
290
PHPerのための計算量入門/Complexity101 for PHPer
hanhan1978
8
3.8k
集中して作業する技術/how_to_work_deeply
hanhan1978
69
60k
Other Decks in Programming
See All in Programming
the container ship “Apple Silicon”@WWDC26 Recap -Japan-\(region).swift
shingangan
0
120
仕様駆動開発へのトライを機に チームに適合する手法を模索し続けている話
freee
PRO
0
500
PHP Application における Kubernetes 内 gRPC 通信
ganchiku
0
590
<title><a id="</title>君はこのHTMLをパースできるか"></a></title> #雑LT_study
pizzacat83
0
140
Built Our Own Background Agent at LayerX
layerx
PRO
10
5.4k
自動化したのに回らない テスト運用の壁―AI時代の品質責任と生産性
mfunaki
0
160
Android CLI
fornewid
0
220
源内ハンズオン概要編
hideg
0
170
Terraform標準の組織で AWS CDKをどう使うか
mu7889yoon
1
510
ソフトウェア設計に溶けるインフラ ― AWS CDK のインフラ認識論
konokenj
3
780
torikago - Ruby::Boxで照らすモジュラモノリスの実行境界
se4weed
1
370
React本体のコードリーディング
high_g_engineer
1
140
Featured
See All Featured
GraphQLとの向き合い方2022年版
quramy
50
15k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Navigating Team Friction
lara
192
16k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
3
1.1k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
570
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
250
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.7k
How to Think Like a Performance Engineer
csswizardry
28
2.7k
The Spectacular Lies of Maps
axbom
PRO
1
910
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
410
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
940
Transcript
PHPͰֶͿCacheͷڑͷ 1)1ษڧձ
Cacheͱʁ
Oxford Dictionary ΑΓ An auxilirary memory from which high speed
retrieval is possible ߴͰσʔλऔಘ͕Ͱ͖ΔهԱஔ
WebΞϓϦͰͷར༻༻్ ߴෛՙΫΤϦͷॲཧ݁Ռ ूܭॲཧͷ݁Ռ ϧʔςΟϯά ઃఆϑΝΠϧ CDNͱ͔ϒϥβΩϟογϡɺࠓճର֎
ࠓ͢͜ͱ CacheͷޮՌΛࣄલʹѲ͢Δ͜ͱ ΑΓߴ͍ޮՌΛಘΔͨΊͷCacheͷڑͷ
ࠓ͞ͳ͍͜ͱ CacheͷϛυϧΣΞ Cacheͷӡ༻ ࢀߟ1 WebαʔϏεʹ͓͚ΔΩϟογϡઓུ https://speakerdeck.com/yusukebe/websabisuniokeru-kiyatusiyuzhan-lue ࢀߟ2 WebΞϓϦέʔγϣϯͷΩϟογϡઓུͱͦͷύλʔϯ https://speakerdeck.com/moznion/pattern-and-strategy-of-web-application-caching
CacheͷޮՌΛࣄલʹѲ͢Δ
CacheΛ͏͜ͱͰԿނ͘ͳΔͷ͔ʁ
ྫ͑͜Μͳߏ
ಉҰωοτϫʔΫͷDBͷΫΤϦ݁ՌΛCache ΫΤϦ݁ՌΛಘΔ·Ͱͷ࣌ؒ 5$1ଓ $16ԋࢉ %JTL*0 MySQL + +
5$1ଓ $16ԋࢉ %JTL*0 MySQL + + ΫΤϦ݁ՌΛಘΔ·Ͱͷ࣌ؒ - RedisʹCache 5$1ଓ
.FNPSZ*0 Redis + ಉҰωοτϫʔΫͷDBͷΫΤϦ݁ՌΛCache ΫΤϦ݁ՌΛಘΔ·Ͱͷ࣌ؒ
$16ԋࢉ %JTL*0 MySQL + .FNPSZ*0 Redis MemoryIOͷํ͕͚Εɺ্͕ݟࠐΊͦ͏
ϨΠςϯγʔ https://gist.github.com/jboner/2841832
͔͠͠ɺ͋·Γ͘ͳΒͳ͍ύλʔϯ͕͋Δ
DBͷσʔλ͕ϝϞϦʹΔ߹ ΫΤϦ݁ՌΛಘΔ·Ͱͷ࣌ؒ 5$1ଓ ΄΅.FNPSZ*0 MySQL + ΫΤϦ݁ՌΛಘΔ·Ͱͷ࣌ؒ - RedisʹCache 5$1ଓ
.FNPSZ*0 Redis +
DBͷσʔλ͕ϝϞϦʹΔ߹ ΄΅.FNPSZ*0 MySQL .FNPSZ*0 Redis Φʔμʔ͕มΘΔΑ͏ͳ্ݟࠐΊͳ͍
͜ΕҎ্ͷ্Λ͢Δʹʁʁ
WebΞϓϦ͔ΒCache·ͰͷڑΛม͑Δ 5$1ଓ .FNPSZ*0 ͬͪ͜ +
WebΞϓϦ͔ΒCache·ͰͷڑΛม͑Δ 5$1ଓ .FNPSZ*0 ͬͪ͜ + TCPଓΛΊΔ -> ϩʔΧϧCache
https://gist.github.com/jboner/2841832 ϨΠςϯγʔ
PHPͰϩʔΧϧCache ϩʔΧϧRedis, Memcached -> ਏ͍ ϑΝΠϧ -> ͍͍͚Ͳ… APCu(ϝϞϦ) ->
ྑͦ͞͏ աڈͷऔΓΈ - ແཧΓOPCache͏Cache https://speakerdeck.com/hanhan1978/cachegasu-ifalsekaque-ren-suruhua
PHPͷࣄ ϓϩηεͷಠཱੑ͕ߴ͍ ॲཧऴྃޙʹϝϞϦΫϦΞ͞ΕΔ ϓϩηεؒͰͷϝϞϦڞ༗͕ग़དྷͳ͍ɻ PHPΣϒαʔόʔͷొ͕·ΕΔ
࣮ଌͯ͠Έͨ
Trans/SecͱCacheํ๏ ํ๏ USBOTTFD ϦϞʔτ.Z42- ϦϞʔτ3FEJT ϩʔΧϧ"1$V DBσʔλ͕ϝϞϦʹ͍ͬͯΔ߹ʹ͍ͭͯݕূ
·ͱΊ Latencyͷද͓֮͑ͯ͜͏Ͷ CacheʹΑΔվળݟࠐΈࣄલʹཱͯΔ ܭࢉྔ͚ͩ͡Όͳ͘ڑߟ͑Δ ͳ͓ɺCacheӡ༻পͰ͢….
͓͠·͍