Slide 1

Slide 1 text

PHPͰֶͿCacheͷڑ཭ͷ࿩ 1)1ษڧձ

Slide 2

Slide 2 text

Cacheͱ͸ʁ

Slide 3

Slide 3 text

Oxford Dictionary ΑΓ An auxilirary memory from which high speed retrieval is possible ߴ଎Ͱσʔλऔಘ͕Ͱ͖ΔهԱ૷ஔ

Slide 4

Slide 4 text

WebΞϓϦͰͷར༻༻్ ߴෛՙΫΤϦͷॲཧ݁Ռ ूܭॲཧͷ݁Ռ ϧʔςΟϯά ઃఆϑΝΠϧ CDNͱ͔ϒϥ΢βΩϟογϡ͸ɺࠓճ͸ର৅֎

Slide 5

Slide 5 text

ࠓ೔࿩͢͜ͱ CacheͷޮՌΛࣄલʹ೺Ѳ͢Δ͜ͱ ΑΓߴ͍ޮՌΛಘΔͨΊͷCacheͷڑ཭ͷ࿩

Slide 6

Slide 6 text

ࠓ೔࿩͞ͳ͍͜ͱ Cacheͷϛυϧ΢ΣΞ Cacheͷӡ༻ ࢀߟ1 WebαʔϏεʹ͓͚ΔΩϟογϡઓུ https://speakerdeck.com/yusukebe/websabisuniokeru-kiyatusiyuzhan-lue ࢀߟ2 WebΞϓϦέʔγϣϯͷΩϟογϡઓུͱͦͷύλʔϯ https://speakerdeck.com/moznion/pattern-and-strategy-of-web-application-caching

Slide 7

Slide 7 text

CacheͷޮՌΛࣄલʹ೺Ѳ͢Δ

Slide 8

Slide 8 text

CacheΛ࢖͏͜ͱͰԿނ଎͘ͳΔͷ͔ʁ

Slide 9

Slide 9 text

ྫ͑͹͜Μͳߏ੒

Slide 10

Slide 10 text

ಉҰωοτϫʔΫ಺ͷDBͷΫΤϦ݁ՌΛCache ΫΤϦ݁ՌΛಘΔ·Ͱͷ࣌ؒ 5$1઀ଓ $16ԋࢉ %JTL*0 MySQL + +

Slide 11

Slide 11 text

5$1઀ଓ $16ԋࢉ %JTL*0 MySQL + + ΫΤϦ݁ՌΛಘΔ·Ͱͷ࣌ؒ - RedisʹCache 5$1઀ଓ .FNPSZ*0 Redis + ಉҰωοτϫʔΫ಺ͷDBͷΫΤϦ݁ՌΛCache ΫΤϦ݁ՌΛಘΔ·Ͱͷ࣌ؒ

Slide 12

Slide 12 text

$16ԋࢉ %JTL*0 MySQL + .FNPSZ*0 Redis MemoryIOͷํ͕଎͚Ε͹ɺ଎౓޲্͕ݟࠐΊͦ͏

Slide 13

Slide 13 text

ϨΠςϯγʔ https://gist.github.com/jboner/2841832

Slide 14

Slide 14 text

͔͠͠ɺ͋·Γ଎͘ͳΒͳ͍ύλʔϯ͕͋Δ

Slide 15

Slide 15 text

DBͷσʔλ͕ϝϞϦʹ৐Δ৔߹ ΫΤϦ݁ՌΛಘΔ·Ͱͷ࣌ؒ 5$1઀ଓ ΄΅.FNPSZ*0 MySQL + ΫΤϦ݁ՌΛಘΔ·Ͱͷ࣌ؒ - RedisʹCache 5$1઀ଓ .FNPSZ*0 Redis +

Slide 16

Slide 16 text

DBͷσʔλ͕ϝϞϦʹ৐Δ৔߹ ΄΅.FNPSZ*0 MySQL .FNPSZ*0 Redis Φʔμʔ͕มΘΔΑ͏ͳ଎౓޲্͸ݟࠐΊͳ͍

Slide 17

Slide 17 text

͜ΕҎ্ͷ଎౓޲্Λ͢Δʹ͸ʁʁ

Slide 18

Slide 18 text

WebΞϓϦ͔ΒCache·Ͱͷڑ཭Λม͑Δ 5$1઀ଓ .FNPSZ*0 ͬͪ͜ +

Slide 19

Slide 19 text

WebΞϓϦ͔ΒCache·Ͱͷڑ཭Λม͑Δ 5$1઀ଓ .FNPSZ*0 ͬͪ͜ + TCP઀ଓΛ΍ΊΔ -> ϩʔΧϧCache

Slide 20

Slide 20 text

https://gist.github.com/jboner/2841832 ϨΠςϯγʔ

Slide 21

Slide 21 text

PHPͰϩʔΧϧCache ϩʔΧϧRedis, Memcached -> ਏ͍ ϑΝΠϧ -> ͍͍͚Ͳ… APCu(ϝϞϦ) -> ྑͦ͞͏ աڈͷऔΓ૊Έ - ແཧ΍ΓOPCache࢖͏Cache https://speakerdeck.com/hanhan1978/cachegasu-ifalsekaque-ren-suruhua

Slide 22

Slide 22 text

PHPͷࣄ৘ ϓϩηεͷಠཱੑ͕ߴ͍ ॲཧऴྃޙʹϝϞϦ͸ΫϦΞ͞ΕΔ ϓϩηεؒͰͷϝϞϦڞ༗͕ग़དྷͳ͍ɻ PHP΢Σϒαʔόʔͷొ৔͕๬·ΕΔ

Slide 23

Slide 23 text

࣮ଌͯ͠Έͨ

Slide 24

Slide 24 text

Trans/SecͱCacheํ๏ ํ๏ USBOTTFD ϦϞʔτ.Z42- ϦϞʔτ3FEJT ϩʔΧϧ"1$V DBσʔλ͕ϝϞϦʹ৐͍ͬͯΔ৔߹ʹ͍ͭͯݕূ

Slide 25

Slide 25 text

·ͱΊ Latencyͷද͸͓֮͑ͯ͜͏Ͷ CacheʹΑΔվળݟࠐΈ͸ࣄલʹཱͯΔ ܭࢉྔ͚ͩ͡Όͳ͘ڑ཭΋ߟ͑Δ ͳ͓ɺCacheӡ༻͸পͰ͢….

Slide 26

Slide 26 text

͓͠·͍