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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
8
3.4k
Spec Driven Development入門/spec_driven_development_for_learners
hanhan1978
2
1.6k
フロントエンドがTypeScriptなら、バックエンドはPHPでもいいじゃない/php-is-not-bad
hanhan1978
8
14k
どうすると生き残れないのか/how-not-to-survive
hanhan1978
17
14k
100分で本番デプロイ!Laravelで作るWebアプリケーション作成/100min_web_app_cicd
hanhan1978
1
250
PHPerのための計算量入門/Complexity101 for PHPer
hanhan1978
8
3.5k
集中して作業する技術/how_to_work_deeply
hanhan1978
65
55k
PHPでデータベースを作ってみた/create-data-with-php
hanhan1978
11
11k
ADRを一年運用してみた/adr_after_a_year
hanhan1978
8
4.8k
Other Decks in Programming
See All in Programming
米国のサイバーセキュリティタイムラインと見る Goの暗号パッケージの進化
tomtwinkle
2
430
TROCCOで実現するkintone+BigQueryによるオペレーション改善
ssxota
0
140
go directiveを最新にしすぎないで欲しい話──あるいは、Go 1.26からgo mod initで作られるgo directiveの値が変わる話 / Go 1.26 リリースパーティ
arthur1
2
470
CSC307 Lecture 11
javiergs
PRO
0
590
AI活用のコスパを最大化する方法
ochtum
0
120
ふつうのRubyist、ちいさなデバイス、大きな一年 / Ordinary Rubyists, Tiny Devices, Big Year
chobishiba
1
320
20260228_JAWS_Beginner_Kansai
takuyay0ne
5
450
AWS Infrastructure as Code の新機能 2025 総まとめ 〜SA 4人による怒涛のデモ祭り〜
konokenj
10
3.2k
Rubyと楽しいをつくる / Creating joy with Ruby
chobishiba
0
210
PostgreSQL を使った快適な go test 環境を求めて
otakakot
0
410
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
250
「やめとこ」がなくなった — 1月にZennを始めて22本書いた AI共創開発のリアル
atani14
0
360
Featured
See All Featured
How to Talk to Developers About Accessibility
jct
2
140
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
210
The Language of Interfaces
destraynor
162
26k
Test your architecture with Archunit
thirion
1
2.2k
How Software Deployment tools have changed in the past 20 years
geshan
0
32k
Visualization
eitanlees
150
17k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
80
GitHub's CSS Performance
jonrohan
1032
470k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.4k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
65
How GitHub (no longer) Works
holman
316
140k
Tell your own story through comics
letsgokoyo
1
830
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ӡ༻পͰ͢….
͓͠·͍