Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
PHPで学ぶCacheの距離の話
Search
Ryo Tomidokoro
October 31, 2018
Programming
1
1.1k
PHPで学ぶCacheの距離の話
Cacheの距離について
Ryo Tomidokoro
October 31, 2018
Tweet
Share
More Decks by Ryo Tomidokoro
See All by Ryo Tomidokoro
開発者が知っておきたい複雑さの正体/where-the-complexity-comes-from
hanhan1978
7
3.1k
Spec Driven Development入門/spec_driven_development_for_learners
hanhan1978
2
1.2k
フロントエンドがTypeScriptなら、バックエンドはPHPでもいいじゃない/php-is-not-bad
hanhan1978
8
13k
どうすると生き残れないのか/how-not-to-survive
hanhan1978
17
14k
100分で本番デプロイ!Laravelで作るWebアプリケーション作成/100min_web_app_cicd
hanhan1978
1
220
PHPerのための計算量入門/Complexity101 for PHPer
hanhan1978
8
3.3k
集中して作業する技術/how_to_work_deeply
hanhan1978
65
53k
PHPでデータベースを作ってみた/create-data-with-php
hanhan1978
11
11k
ADRを一年運用してみた/adr_after_a_year
hanhan1978
8
4.6k
Other Decks in Programming
See All in Programming
マスタデータ問題、マイクロサービスでどう解くか
kts
0
110
Graviton と Nitro と私
maroon1st
0
120
ELYZA_Findy AI Engineering Summit登壇資料_AIコーディング時代に「ちゃんと」やること_toB LLMプロダクト開発舞台裏_20251216
elyza
2
450
愛される翻訳の秘訣
kishikawakatsumi
3
330
実はマルチモーダルだった。ブラウザの組み込みAI🧠でWebの未来を感じてみよう #jsfes #gemini
n0bisuke2
3
1.3k
認証・認可の基本を学ぼう前編
kouyuume
0
260
複数人でのCLI/Infrastructure as Codeの暮らしを良くする
shmokmt
5
2.3k
Canon EOS R50 V と R5 Mark II 購入でみえてきた最近のデジイチ VR180 事情、そして VR180 静止画に活路を見出すまで
karad
0
130
ゆくKotlin くるRust
exoego
1
130
Developing static sites with Ruby
okuramasafumi
0
310
gunshi
kazupon
1
110
Socio-Technical Evolution: Growing an Architecture and Its Organization for Fast Flow
cer
PRO
0
390
Featured
See All Featured
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
0
160
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
12
The Cost Of JavaScript in 2023
addyosmani
55
9.4k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
0
290
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
0
3.3k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.8k
Highjacked: Video Game Concept Design
rkendrick25
PRO
0
240
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
0
60
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.3k
Six Lessons from altMBA
skipperchong
29
4.1k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
0
68
Rebuilding a faster, lazier Slack
samanthasiow
85
9.3k
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ӡ༻পͰ͢….
͓͠·͍