200万ドメインを超えるレンタルサーバのコンテンツキャッシュ機能の裏側/2_million_more_than_the_domain_the_back_of_the_rental_server_content_cache

 200万ドメインを超えるレンタルサーバのコンテンツキャッシュ機能の裏側/2_million_more_than_the_domain_the_back_of_the_rental_server_content_cache

July Tech Festa 2018 (https://2018.techfesta.jp/)

22522e2bc35255ab75308c399ff782f6?s=128

Takuma Kume

July 29, 2018
Tweet

Transcript

  1. !UBLVNBLVNF(.01FQBCP *OD +VMZ5FDI'FTUB ສυϝΠϯΛ௒͑ΔϨϯλϧαʔόͷ ίϯςϯπΩϟογϡػೳͷཪଆ

  2. (.0ϖύϘϗεςΟϯάࣄۀ෦ ΠϯϑϥΤϯδχΞ ٱถ୓അ!UBLVNBLVNF

  3. None
  4. ֹ݄ԁ͔Βར༻Ͱ͖Δʂ

  5. ֹ݄ԁ͔Βར༻Ͱ͖Δʂ ඵؒ໿ສઍϦΫΤετΛॲཧʂ

  6. ֹ݄ԁ͔Βར༻Ͱ͖Δʂ ສαΠτҎ্ӡ༻தʂ ඵؒ໿ສઍϦΫΤετΛॲཧʂ

  7. None
  8. ίϯςϯπΩϟογϡػೳ 3FWFSTF1SPYZ 8&#4FSWFS ௨ৗ

  9. ίϯςϯπΩϟογϡػೳ 3FWFSTF1SPYZ 8&#4FSWFS 3FWFSTF1SPYZ $BDIF4FSWFS 8&#4FSWFS Ωϟογϡ ίϯςϯπΩϟογϡ͋Γ

  10. ίϯςϯπΩϟογϡػೳ 3FWFSTF1SPYZ $BDIF4FSWFS 8&#4FSWFS Ωϟογϡ ίϯςϯπΩϟογϡ͋Γ 8&#4FSWFSͷલஈͰΩϟογϡͯ͠ ߴ଎ʹԠ౴͢Δɻ

  11. ίϯςϯπΩϟογϡػೳ 3FWFSTF1SPYZ $BDIF4FSWFS 8&#4FSWFS Ωϟογϡ ίϯςϯπΩϟογϡ͋Γ OHJOY IUUQE ύϑΥʔϚϯεͷߴ͍OHJOYͰϦΫΤετ Λॲཧ͢Δɻ

    8&#4FSWFSͷલஈͰΩϟογϡͯ͠ ߴ଎ʹԠ౴͢Δɻ
  12. ίϯςϯπΩϟογϡػೳ 3FWFSTF1SPYZ $BDIF4FSWFS 8&#4FSWFS Ωϟογϡ ίϯςϯπΩϟογϡ͋Γ OHJOY IUUQE ύϑΥʔϚϯεͷߴ͍OHJOYͰϦΫΤετ Λॲཧ͢Δɻ

    1)1౳ͷॲཧͰߴෛՙʹͳΓ΍͍͢ 8&#αʔόͷෛՙ௿ݮ 8&#4FSWFSͷલஈͰΩϟογϡͯ͠ ߴ଎ʹԠ౴͢Δɻ
  13. ฒྻສϦΫΤετ #FODI.BSLFS "QBDIF#FODI 3FWFSTF1SPYZ 8&#4FSWFS 3FWFSTF1SPYZ $BDIF4FSWFS 8&#4FSWFS Ωϟογϡ 8PSE1SFTTαΠτ

    8PSE1SFTTαΠτ
  14. 3FWFSTF1SPYZ 8&#4FSWFS 3FWFSTF1SPYZ $BDIF4FSWFS 8&#4FSWFS Ωϟογϡ 8PSE1SFTTαΠτ 8PSE1SFTTαΠτ ύϑΥʔϚϯεഒʂ

  15. 3FWFSTF1SPYZ 8&#4FSWFS 3FWFSTF1SPYZ $BDIF4FSWFS 8&#4FSWFS Ωϟογϡ 8PSE1SFTTαΠτ 8PSE1SFTTαΠτ ύϑΥʔϚϯεഒʂ ແྉఏڙ

  16. ͳͥ࡞ͬͨͷ͔ʁ

  17. ࠃ಺࠷଎ Ϩϯαό ࠷଎

  18. ੈͷதʹ͸ଟ͘ͷ $%/ࣄۀऀ͕ଘࡏ͢Δ ίϯςϯπΩϟογϡͱ͍͑͹$%/

  19. ϩϦϙοϓʂͰ֎෦$%/αʔϏε࢖͏ *OUFSOFU 3FWFSTF1SPYZ $BDIF4FSWFS 8&#4FSWFS $%/ࣄۀऀ%$ ΞΫηε ϩϦϙοϓʂ

  20. *OUFSOFU 3FWFSTF1SPYZ $BDIF4FSWFS 8&#4FSWFS $%/ࣄۀऀ%$ ΞΫηε ΦϦδϯͷαʔόʹΞΫηε Ωϟογϡର৅֎ͷίϯςϯπ Ωϟογϡظݶ੾Ε ϩϦϙοϓʂ

    ϩϦϙοϓʂͰ֎෦$%/αʔϏε࢖͏
  21. *OUFSOFU 3FWFSTF1SPYZ $BDIF4FSWFS 8&#4FSWFS $%/ࣄۀऀ%$ ΞΫηε ϩϦϙοϓʂ ΠϯλʔωοτΛߦ͖དྷ͢Δඞཁ͕͋Δ ϩϦϙοϓʂͰ֎෦$%/αʔϏε࢖͏

  22. ίϯςϯπΩϟογϡػೳͷ৔߹ *OUFSOFU 3FWFSTF1SPYZ $BDIF4FSWFS 8&#4FSWFS ΞΫηε ϩϦϙοϓʂ

  23. ίϯςϯπΩϟογϡػೳͷ৔߹ *OUFSOFU 3FWFSTF1SPYZ $BDIF4FSWFS 8&#4FSWFS ΞΫηε ໢಺ߴ଎ ϩϦϙοϓʂ

  24. $%/͸োน͕ߴ͍

  25. $%/͸োน͕ߴ͍ υϝΠϯΛ$%/ʹ޲͚ΔͨΊͷ%/4ͷઃఆ ͦ΋ͦ΋%/4ͱ͸ʁ $%/͸ػೳ͕ଟ͘ઃఆ͕ෳࡶ ඇΤϯδχΞͷํʹͱͬͯ͸೉͍͠ αʔϏεʹΑͬͯ͸ར༻ྉ͕ۚൃੜ͢Δ ϩϦϙοϓʂ͸ΤϯδχΞҎ֎ͷํʑ͔Β΋ ଟ͘͝ར༻௖͍͍ͯΔ

  26. ίϯςϯπΩϟογϡػೳ͸ʁ

  27. None
  28. Άͪͬ

  29. Άͪͬ ଟػೳΑΓ؆୯Λ༏ઌ

  30. ͜͜·Ͱͷ͓͞Β͍ ίϯςϯπΩϟογϡػೳΛϦϦʔε ࠃ಺࠷଎ϨϯαόΛ໨ࢦ͢ʂ ֎෦$%/Λซ༻͢ΔΑΓɺ໢಺ંฦ͠ ͷ௨৴Ͱ׬݁͢Δɻ ୭Ͱ΋؆୯ʹઃఆͰ͖Δʂ $%/͕೉͍͠ͱײ͡Δ͓٬༷Ͱ΋؆୯ ʹઃఆ͕Մೳɻ

  31. ͜͜·Ͱ໘ന͘ͳ͍Ͷʁ

  32. ຊ೔͸ େن໛ϗεςΟϯάͳΒͰ͸ͷ ίϯςϯπΩϟογϡػೳΛ ࢧ͑ΔΠϯϑϥٕज़ʹ͍ͭͯ ͓࿩͠·͢ʂ

  33. ઃܭ લఏ ࣮૷ ·ͱΊ ຊ೔ͷྲྀΕ ίϯςϯπΩϟογϡͷ֓ཁɾ։ൃܦҢ ࠓίί ίϯςϯπΩϟογϡͷػೳͱΠϯϑϥʹٻΊͨ͜ͱ

  34. ઃܭ લఏ ࣮૷ ·ͱΊ ίϯςϯπΩϟογϡͷػೳͱ ΠϯϑϥʹٻΊͨ͜ͱ

  35. ΩϟογϡϞʔυ

  36. ΩϟογϡϞʔυ 81Ωϟογϡػೳ ੩తΩϟογϡػೳ

  37. 81Ωϟογϡػೳ 8PSE1SFTT༻ʹ࠷దԽͨ͠Ωϟογϡػೳ ϩϦϙοϓʂͷ͓٬༷ͷଟ͘͸8PSE1SFTTΛ ར༻͍ͯ͠Δ ੩తΩϟογϡػೳ ը૾΍+4 $44ͳͲͷ੩తίϯςϯπΛର৅ʹ ͨ͠Ωϟογϡػೳ 8PSE1SFTTҎ֎Λར༻͍ͯ͠Δํ޲͚ ҆ఆͨ͠αΠτදࣔʹد༩

    ΩϟογϡϞʔυ
  38. ͢΂ͯͷίϯςϯπΛΩϟογϡͨ͠৔߹ɿ 8PSE1SFTTͷϩάΠϯޙͷ؅ཧը໘͕Ωϟο γϡ͞Εͨ৔߹ʹҙਤ͠ͳ͍৘ใ͕࿙ΕΔ ಠࣗձһ੍8&#ΞϓϦέʔγϣϯͰɺผͷ ձһͷϖʔδ͕ݟ͑ͯ͠·͏ ϚωʔδυͳΩϟογϡػೳΛఏڙ ΩϟογϡϞʔυ ͳͥΩϟογϡϞʔυΛ෼͚Δඞཁ͕͋Δʁ

  39. υϝΠϯͷઃఆʹԠͨ͡ ػೳͷϋϯυϦϯά

  40. طଘͷߏ੒ 3FWFSTF1SPYZ 8&#4FSWFS *OUFSOFU 8&#4FSWFS 4JUF" 4JUF# 4JUF$ 4JUF% ͓٬༷ͷίϯςϯπ

     
  41. طଘͷߏ੒ 3FWFSTF1SPYZ 8&#4FSWFS *OUFSOFU 8&#4FSWFS 4JUF" 4JUF# 4JUF$ 4JUF% ͓٬༷ͷίϯςϯπ

      ໿ສαΠτ
  42. υϝΠϯͷઃఆʹԠͯ͡ϓϩΩγઌΛมߋ͍ͨ͠ 3FWFSTF1SPYZ 8&#4FSWFS *OUFSOFU 8&#4FSWFS   IUUQTTJUFBDPN 4JUF" 4JUF#

    4JUF$ 4JUF% ͓٬༷ͷίϯςϯπ $BDIF4FSWFS PS ίϯςϯπΩϟογϡػೳ͸ 0/ʁ0''ʁ 
  43. 3FWFSTF1SPYZ 8&#4FSWFS *OUFSOFU 8&#4FSWFS   IUUQTTJUFBDPN 4JUF" 4JUF# 4JUF$

    4JUF% ͓٬༷ͷίϯςϯπ $BDIF4FSWFS PS ΩϟογϡͷϞʔυ͸ 81Ωϟογϡʁ ੩తΩϟογϡʁ  υϝΠϯͷઃఆʹԠͯ͡ৼΔ෣͍Λ੍ޚ͍ͨ͠
  44. εέʔϥϏϦςΟ

  45. εέʔϥϏϦςΟ αʔόΛ௥Ճ͚ͨͩ͠Ͱউखʹػೳ͕εέʔϧ ͢ΔΠϯϑϥΞʔΩςΫνϟʹ͍ͨ͠ $BDIF4FSWFS $BDIF4FSWFS $BDIF4FSWFS  3FWFSTF1SPYZ

  46. ߴՄ༻ੑ

  47. ߴՄ༻ੑ αʔό͸յΕΔ յΕͯ΋શࣗಈͰαʔϏεͷঢ়ଶ͕෮چ͢Δ ΠϯϑϥΞʔΩςΫνϟʹ͍ͨ͠ $BDIF4FSWFS $BDIF4FSWFS $BDIF4FSWFS 3FWFSTF1SPYZ

  48. ޮ཰తͳΩϟογϡ

  49. ޮ཰తͳΩϟογϡ ୯७ʹ$BDIF4FSWFSΛฒ΂ͯ෼ࢄ͢Δͱ 3FWFSTF1SPYZ $BDIF 4FSWFS $BDIF 4FSWFS $BDIF 4FSWFS $BDIF

    4FSWFS $BDIF 4FSWFS $BDIF 4FSWFS  8&#4FSWFS Ωϟογϡώοτ཰௿Լ σΟεΫྖҬͷফඅ FYBNQMFDPN FYBNQMFDPN
  50. ޮ཰తͳΩϟογϡ υϝΠϯຖʹॲཧ͢Δ$BDIF4FSWFSΛݶఆ͍ͨ͠ 3FWFSTF1SPYZ $BDIF 4FSWFS $BDIF 4FSWFS $BDIF 4FSWFS $BDIF

    4FSWFS $BDIF 4FSWFS $BDIF 4FSWFS  8&#4FSWFS Ωϟογϡώοτ཰޲্ σΟεΫྖҬͷઅ໿ FYBNQMFDPN FYBNQMFDPN
  51. ͜͜·Ͱͷ͓͞Β͍ ΩϟογϡϞʔυ 81 ੩తΩϟογϡ  υϝΠϯͷઃఆʹԠͨ͡ػೳͷϋϯυϦϯά εέʔϥϏϦςΟ ߴՄ༻ੑ ޮ཰తͳΩϟογϡ ίϯςϯπΩϟογϡͷػೳͱ

    ɹɹɹɹɹɹɹɹΠϯϑϥʹٻΊͨ͜ͱ
  52. ͜ΕΒΛಉ࣌ʹຬͨ͢ ج൫Λ࣮૷͢Δඞཁ͕͋Δ

  53. ࣮૷ લఏ ઃܭ ·ͱΊ ίϯςϯπΩϟογϡػೳͷ࣮૷

  54. ͜͜Ͱ#FFS څਫ

  55. ΩϟογϡϞʔυͷ࣮૷

  56. ΩϟογϡϞʔυͷ࣮૷ http { : proxy_cache_path /var/cache/nginx/cache levels=1:2 \ keys_zone=zone1:1024m inactive=10m;

    proxy_cache_valid 200 10m; proxy_cache_valid 404 1m; server { : proxy_cache zone1; proxy_cache_key $proxy_scheme://$host$ $is_args$args; proxy_pass $proxy_scheme://${Origin Server}; } } OHJOYඪ४ͷOHY@IUUQ@QSPYZ@NPEVMFΛར༻
  57. http { : proxy_cache_path /var/cache/nginx/cache levels=1:2 \ keys_zone=zone1:1024m inactive=10m; proxy_cache_valid

    200 10m; proxy_cache_valid 404 1m; server { : proxy_cache zone1; proxy_cache_key $proxy_scheme://$host$request_uri$is_args$args; proxy_pass $proxy_scheme://${Origin Server}; } } OHJOYඪ४ͷOHY@IUUQ@QSPYZ@NPEVMFΛར༻ DBDIFͷอଘઌ΍αΠζɺ༗ޮظؒ ΩϟογϡϞʔυͷ࣮૷
  58. http { : proxy_cache_path /var/cache/nginx/cache levels=1:2 \ keys_zone=zone1:1024m inactive=10m; proxy_cache_valid

    200 10m; proxy_cache_valid 404 1m; server { : proxy_cache zone1; proxy_cache_key $proxy_scheme://$host$request_uri$is_args$args; proxy_pass $proxy_scheme://${Origin Server}; } } OHJOYඪ४ͷOHY@IUUQ@QSPYZ@NPEVMFΛར༻ εςʔλείʔυʹ ΑͬͯอଘظؒΛม͑Δ ΩϟογϡϞʔυͷ࣮૷
  59. http { : proxy_cache_path /var/cache/nginx/cache levels=1:2 \ keys_zone=zone1:1024m inactive=10m; proxy_cache_valid

    200 10m; proxy_cache_valid 404 1m; server { : proxy_cache zone1; proxy_cache_key $proxy_scheme://$host$request_uri$is_args$args; proxy_pass $proxy_scheme://${Origin Server}; } } OHJOYඪ४ͷOHY@IUUQ@QSPYZ@NPEVMFΛར༻ [POFΛ࢖ͬͯΩϟογϡ͢Δ ΩϟογϡϞʔυͷ࣮૷
  60. http { : proxy_cache_path /var/cache/nginx/cache levels=1:2 \ keys_zone=zone1:1024m inactive=10m; proxy_cache_valid

    200 10m; proxy_cache_valid 404 1m; server { : proxy_cache zone1; proxy_cache_key $proxy_scheme://$host$request_uri$is_args$args; proxy_pass $proxy_scheme://${Origin Server}; } } OHJOYඪ४ͷOHY@IUUQ@QSPYZ@NPEVMFΛར༻ Ωϟογϡͷอଘɾ୳ࡧͷΩʔ ΩϟογϡϞʔυͷ࣮૷
  61. ΩϟογϡϞʔυͷ࣮૷ http { : proxy_cache_path /var/cache/nginx/cache levels=1:2 \ keys_zone=zone1:1024m inactive=10m;

    proxy_cache_valid 200 10m; proxy_cache_valid 404 1m; server { : proxy_cache zone1; proxy_cache_key $proxy_scheme://$host$request_uri$is_args$args; proxy_pass $proxy_scheme://${Origin Server}; } } OHJOYඪ४ͷOHY@IUUQ@QSPYZ@NPEVMFΛར༻ Ωϟογϡ͕ͳ͍৔߹ɾ༗ޮظݶ੾Εͷ৔߹ʹ ΞΫηε͢ΔΦϦδϯαʔό
  62. ΩϟογϡϞʔυͷ࣮૷ http { : server { : location /login {

    proxy_no_cache 1; proxy_cache_bypass 1; } } } OHJOYඪ४ͷOHY@IUUQ@QSPYZ@NPEVMFΛར༻ Ωϟογϡ͠ͳ͍ ΩϟογϡΛ୳ࡧ͠ͳ͍
  63. Ωϟογϡػೳ : location / { : set $do_not_cache 0; if

    ($http_cookie ~ '(wordpress_|comment_author|wp-postpass)') { set $do_not_cache 1; } proxy_no_cache $do_not_cache; proxy_cache_bypass $do_not_cache; proxy_cache zone1; proxy_cache_key "$proxy_scheme://$host$request_uri$is_args$args"; proxy_pass $proxy_scheme://${Origin Server}; } DPPLJFʹಛఆͷจࣈྻ͕ ͋Δ࣌͸Ωϟογϡ͠ͳ͍ 81Ωϟογϡػೳͷྫ Ұ෦ ɿ
  64. ஌ͬͯΔ͠ ͋Μ·໘ന͘ͳ͍Ͱ͢ΑͶʂ

  65. Ҏ߱ͰɺϨϯαόʹ͓͚Δ ՝୊Λόʔϯͱղܾ͢Δ ιϑτ΢ΣΞͷ࿩Λ ͍͖ͯ͠·͢

  66. υϝΠϯʹԠͨ͡ ػೳͷϋϯυϦϯάͷ࣮૷

  67. ΍Γ͍ͨ͜ͱ 3FWFSTF1SPYZ 8&#4FSWFS *OUFSOFU 8&#4FSWFS   IUUQTTJUFBDPN 4JUF" 4JUF#

    4JUF$ 4JUF% ͓٬༷ͷίϯςϯπ $BDIF4FSWFS PS  ίϯςϯπΩϟογϡػೳ͸ 0/ʁ0''ʁ ΩϟογϡͷϞʔυ͸ 81Ωϟογϡʁ ੩తΩϟογϡʁ
  68. ͲͷΑ͏ʹ࣮૷͢Δ͔ʁ

  69. طଘͷߏ੒Λ΋͏গ͠ৄ͘͠ 3FWFSTF1SPYZ 8&#4FSWFS *OUFSOFU 8&#4FSWFS 4JUF" 4JUF# 4JUF$ 4JUF% ͓٬༷ͷίϯςϯπ

     
  70. 3FWFSTF1SPYZ 8&#4FSWFS *OUFSOFU 8&#4FSWFS 4JUF" 4JUF# 4JUF$ 4JUF% ͓٬༷ͷίϯςϯπ 

     ਺ඦ୆ طଘͷߏ੒Λ΋͏গ͠ৄ͘͠
  71. 3FWFSTF1SPYZ 8&#4FSWFS *OUFSOFU 8&#4FSWFS 4JUF" 4JUF# 4JUF$ 4JUF% ͓٬༷ͷίϯςϯπ 

     ໿ສαΠτ طଘͷߏ੒Λ΋͏গ͠ৄ͘͠
  72. 3FWFSTF1SPYZ 8&#4FSWFS *OUFSOFU 8&#4FSWFS 4JUF" 4JUF# 4JUF$ 4JUF% ͓٬༷ͷίϯςϯπ 

     සൟʹ૿ݮ͢Δ طଘͷߏ੒Λ΋͏গ͠ৄ͘͠
  73. Ϩϯλϧαʔόͷ৔߹ 3FWFSTF1SPYZ 8&#4FSWFS *OUFSOFU 8&#4FSWFS 4JUF" 4JUF# 4JUF$ 4JUF% 

     େྔͷ૿ݮ͢ΔυϝΠϯΛ ͲͷΑ͏ʹϓϩΩγ͍ͯ͠Δ͔ʁ
  74. େྔυϝΠϯͷϓϩΩγ 3FWFSTF1SPYZ 8&#4FSWFS *OUFSOFU 8&#4FSWFS   IUUQTTJUFBDPN 4JUF" 4JUF#

    4JUF$ 4JUF% ͓٬༷ͷίϯςϯπ ສαΠτҎ্ͷ ϓϩΩγͷઃఆΛ ॻ͘ͷ͸ݱ࣮తͰ͸ͳ͍
  75. େྔυϝΠϯͷಈతͳϓϩΩγ 3FWFSTF1SPYZ 8&#4FSWFS *OUFSOFU 8&#4FSWFS   IUUQTTJUFBDPN 4JUF" 4JUF#

    4JUF$ 4JUF% ͓٬༷ͷίϯςϯπ OHJOY  OHY@NSVCZ
  76. ฐࣾͷ!NBUTVNPUPSZ͕։ൃ͍ͯ͠Δ OHJOYʹ૊ΈࠐΉ͜ͱͰϓϩηεͷىಈ΍ ϦΫΤετͷλΠϛϯάͰNSVCZͷεΫϦ ϓτΛ࣮ߦͰ͖Δ NSVCZ૊ΈࠐΈ޲͚ͷܰྔ3VCZ࣮૷ OHY@NSVCZ

  77. େྔυϝΠϯͷಈతͳϓϩΩγ 3FWFSTF1SPYZ 8&#4FSWFS *OUFSOFU 8&#4FSWFS   IUUQTTJUFBDPN 4JUF" 4JUF#

    4JUF$ 4JUF% ͓٬༷ͷίϯςϯπ OHJOY  OHY@NSVCZ
  78. େྔυϝΠϯͷಈతͳϓϩΩγ 3FWFSTF1SPYZ 8&#4FSWFS *OUFSOFU 8&#4FSWFS   IUUQTTJUFBDPN 4JUF" 4JUF#

    4JUF$ 4JUF% ͓٬༷ͷίϯςϯπ υϝΠϯͱ8&#4FSWFSͷඥ͚ͮ σʔλϕʔε υϝΠϯTJUFBDPN αʔό8&#4FSWFS OHJOY  OHY@NSVCZ
  79. େྔυϝΠϯͷಈతͳϓϩΩγ 3FWFSTF1SPYZ 8&#4FSWFS *OUFSOFU 8&#4FSWFS   IUUQTTJUFBDPN 4JUF" 4JUF#

    4JUF$ 4JUF% ͓٬༷ͷίϯςϯπ υϝΠϯͱ8&#4FSWFSͷඥ͚ͮ σʔλϕʔε υϝΠϯTJUFBDPN αʔό8&#4FSWFS OHJOY  OHY@NSVCZ NSVCZΛ࢖ͬͯ ίϯςϯπΩϟογϡػೳͷ ϋϯυϦϯάΛߦ͏ʂ
  80. ػೳͷϋϯυϦϯά 3FWFSTF1SPYZ 8&#4FSWFS *OUFSOFU 8&#4FSWFS   IUUQTTJUFBDPN 4JUF" 4JUF#

    4JUF$ 4JUF% ͓٬༷ͷίϯςϯπ $BDIF4FSWFS PS  ίϯςϯπΩϟογϡػೳ͸ 0/ʁ0''ʁ ΩϟογϡͷϞʔυ͸ 81Ωϟογϡʁ ੩తΩϟογϡʁ ίϯςϯπΩϟογϡػೳ͸ 0/ʁ0''ʁ ΩϟογϡͷϞʔυ͸ 81Ωϟογϡʁ ੩తΩϟογϡʁ 3FWFSTF1SPYZ 8&#4FSWFS $BDIF4FSWFS
  81. ػೳͷϋϯυϦϯά 3FWFSTF1SPYZ 8&#4FSWFS *OUFSOFU 8&#4FSWFS   IUUQTTJUFBDPN 4JUF" 4JUF#

    4JUF$ 4JUF% ͓٬༷ͷίϯςϯπ $BDIF4FSWFS  σʔλϕʔε υϝΠϯTJUFBDPN αʔό8&#4FSWFS ΩϟογϡPO ΩϟογϡλΠϓ81
  82. ػೳͷϋϯυϦϯά 3FWFSTF1SPYZ 8&#4FSWFS *OUFSOFU 8&#4FSWFS   IUUQTTJUFBDPN 4JUF" 4JUF#

    4JUF$ 4JUF% ͓٬༷ͷίϯςϯπ $BDIF4FSWFS  σʔλϕʔε υϝΠϯTJUFBDPN αʔό8&#4FSWFS ΩϟογϡPO ΩϟογϡλΠϓ81 ΩϟογϡͷϞʔυ͸ 81Ωϟογϡʁ ੩తΩϟογϡʁ ΩϟογϡͷϞʔυ͸ 81Ωϟογϡʁ ੩తΩϟογϡʁ
  83. ػೳͷϋϯυϦϯά 3FWFSTF1SPYZ 8&#4FSWFS *OUFSOFU 8&#4FSWFS   IUUQTTJUFBDPN 4JUF" 4JUF#

    4JUF$ 4JUF% ͓٬༷ͷίϯςϯπ $BDIF4FSWFS  σʔλϕʔε ΩϟογϡͷϞʔυ 81PS੩త  ʹΑͬͯڍಈΛม͍ͨ Ωϟογϡର৅֎΍ ظݶ੾Εͷ৔߹ʹ ΞΫηε͢Δ ΦϦδϯαʔόͷ৘ใ υϝΠϯTJUFBDPN αʔό8&#4FSWFS ΩϟογϡPO ΩϟογϡλΠϓ81
  84. ػೳͷϋϯυϦϯά 3FWFSTF1SPYZ 8&#4FSWFS *OUFSOFU 8&#4FSWFS   IUUQTTJUFBDPN 4JUF" 4JUF#

    4JUF$ 4JUF% ͓٬༷ͷίϯςϯπ $BDIF4FSWFS  σʔλϕʔε OHY@NSVCZ υϝΠϯTJUFBDPN αʔό8&#4FSWFS ΩϟογϡPO ΩϟογϡλΠϓ81
  85. ػೳͷϋϯυϦϯά 3FWFSTF1SPYZ 8&#4FSWFS *OUFSOFU 8&#4FSWFS   IUUQTTJUFBDPN 4JUF" 4JUF#

    4JUF$ 4JUF% ͓٬༷ͷίϯςϯπ $BDIF4FSWFS  σʔλϕʔε υϝΠϯTJUFBDPN αʔό8&#4FSWFS ΩϟογϡPO ΩϟογϡλΠϓ81 OHY@NSVCZ OHY@NSVCZΛ࢖͑͹ ΋ͬͱεϚʔτʹͰ͖Δ
  86. ػೳͷϋϯυϦϯά 3FWFSTF1SPYZ 8&#4FSWFS *OUFSOFU 8&#4FSWFS   IUUQTTJUFBDPN 4JUF" 4JUF#

    4JUF$ 4JUF% ͓٬༷ͷίϯςϯπ $BDIF4FSWFS  σʔλϕʔε OHY@NSVCZ υϝΠϯTJUFBDPN αʔό8&#4FSWFS ΩϟογϡPO ΩϟογϡλΠϓ81 3FWFSTF1SPYZ σʔλϕʔε υϝΠϯTJUFBDPN αʔό8&#4FSWFS ΩϟογϡPO ΩϟογϡλΠϓ81 %#͔Βऔಘͨ͠σʔλΛ
  87. ػೳͷϋϯυϦϯά 3FWFSTF1SPYZ 8&#4FSWFS *OUFSOFU 8&#4FSWFS   IUUQTTJUFBDPN 4JUF" 4JUF#

    4JUF$ 4JUF% ͓٬༷ͷίϯςϯπ $BDIF4FSWFS  σʔλϕʔε OHY@NSVCZ υϝΠϯTJUFBDPN αʔό8&#4FSWFS ΩϟογϡPO ΩϟογϡλΠϓ81 σʔλϕʔε υϝΠϯTJUFBDPN αʔό8&#4FSWFS ΩϟογϡPO ΩϟογϡλΠϓ81 3FWFSTF1SPYZ $BDIF4FSWFS %#͔Βऔಘͨ͠σʔλΛ NSVCZͰ IUUQϔομʹ ෇༩ͯ͠఻ൖ )551ϔομ
  88. ػೳͷϋϯυϦϯά 3FWFSTF1SPYZ OHJOY OHY@NSVCZ 8&#4FSWFS 8&#4FSWFS 4JUF" 4JUF# 4JUF$ 4JUF%

    $BDIF4FSWFS IUUQTTJUFBDPN σʔλϕʔε αʔό8&#4FSWFS ΩϟογϡPO ΩϟογϡλΠϓ81
  89. ػೳͷϋϯυϦϯά 3FWFSTF1SPYZ OHJOY OHY@NSVCZ 8&#4FSWFS 8&#4FSWFS 4JUF" 4JUF# 4JUF$ 4JUF%

    $BDIF4FSWFS IUUQTTJUFBDPN σʔλϕʔε IUUQϔομΛ௥Ճ αʔό8&#4FSWFS ΩϟογϡPO ΩϟογϡλΠϓ81 9-0-*10161453&".8FC4FSWFS 9-0-*101$"$)&5:1&81 h = Nginx::Headers_in.new h['X-LOLIPOP-UPSTREAM'] = 'Web Server1' h['X-LOLIPOP-CACHE-TYPE'] = 'WP' ࣮ࡍ͸%#͔Βऔಘͨ͠஋
  90. ػೳͷϋϯυϦϯά 3FWFSTF1SPYZ OHJOY OHY@NSVCZ 8&#4FSWFS 8&#4FSWFS 4JUF" 4JUF# 4JUF$ 4JUF%

    $BDIF4FSWFS IUUQTTJUFBDPN σʔλϕʔε αʔό8&#4FSWFS ΩϟογϡPO ΩϟογϡλΠϓ81 9-0-*10161453&".8FC4FSWFS 9-0-*101$"$)&5:1&81 if ($http_x_lolipop_cache_type = "WP") { # WPΩϟογϡػೳͷڍಈ : } IUUQϔομΛ௥Ճ IUUQϔομΛ΋ͱʹ ΩϟογϡػೳͷڍಈΛมߋ
  91. ػೳͷϋϯυϦϯά 3FWFSTF1SPYZ OHJOY OHY@NSVCZ 8&#4FSWFS 8&#4FSWFS 4JUF" 4JUF# 4JUF$ 4JUF%

    $BDIF4FSWFS IUUQTTJUFBDPN σʔλϕʔε IUUQϔομΛ΋ͱʹϓϩΩγ αʔό8&#4FSWFS ΩϟογϡPO ΩϟογϡλΠϓ81 9-0-*10161453&".8FC4FSWFS 9-0-*101$"$)&5:1&81 IUUQϔομΛ΋ͱʹ ΩϟογϡػೳͷڍಈΛมߋ proxy_pass $proxy_scheme://$http_x_lolipop_upstream; IUUQϔομΛ௥Ճ
  92. ػೳͷϋϯυϦϯά 3FWFSTF1SPYZ OHJOY OHY@NSVCZ 8&#4FSWFS 8&#4FSWFS 4JUF" 4JUF# 4JUF$ 4JUF%

    $BDIF4FSWFS IUUQTTJUFBDPN σʔλϕʔε IUUQϦΫΤετϔομΛ௥Ճ IUUQϦΫΤετϔομΛ΋ͱʹϓϩΩγ αʔό8&#4FSWFS ΩϟογϡPO ΩϟογϡλΠϓ81 9-0-*10161453&".8FC4FSWFS 9-0-*101$"$)&5:1&81 IUUQϦΫΤετϔομΛ΋ͱ ʹΩϟογϡػೳͷڍಈΛมߋ proxy_pass $proxy_scheme://$http_x_lolipop_upstream; NSVCZͰσʔλϕʔε͔Βऔಘͨ͠஋ΛIUUQ ϔομʹຒΊࠐΉ $BDIF4FSWFSଆ͸ຒΊࠐ·ΕͨIUUQϔομΛ ࢀর͚ͩͰυϝΠϯຖͷৼΔ෣͍ͷ੍ޚ͕Մೳ IUUQϔομʹΑΔ৘ใͷ఻೻ͳͷͰɺ$BDIF 4FSWFS͸௨ৗͷOHJOYͰΑ͍ͷͰγϯϓϧ
  93. 3FWFSTF1SPYZ OHJOY OHY@NSVCZ σʔλϕʔε ϦΫΤετ ύϑΥʔϚϯεେৎ෉ʁ

  94. ύϑΥʔϚϯεྼԽΛ࠷খݶʹ ཈͑ΔςΫχοΫΛ͝঺հ͠·͢ʂ

  95. Ωϟογϡͷಋೖ

  96. Ωϟογϡͷಋೖ 3FWFSTF1SPYZ .Z42- ϦΫΤετ 3FEJT OHJOY OHY@NSVCZ

  97. Ωϟογϡͷಋೖ 3FWFSTF1SPYZ .Z42- ϦΫΤετ 3FEJT OHJOY OHY@NSVCZ ᶃ ᶃ3FEJT͔Β৘ใΛऔಘ

  98. Ωϟογϡͷಋೖ 3FWFSTF1SPYZ .Z42- ϦΫΤετ 3FEJT OHJOY OHY@NSVCZ ᶃ ᶄ ᶃ3FEJT͔Β৘ใΛऔಘ

    ᶄᶃͰଘࡏ͠ͳ͚Ε͹.Z42-͔Β৘ใΛऔಘ
  99. Ωϟογϡͷಋೖ 3FWFSTF1SPYZ .Z42- ϦΫΤετ 3FEJT OHJOY OHY@NSVCZ ᶃ ᶅ ᶄ

    ᶃ3FEJT͔Β৘ใΛऔಘ ᶄᶃͰଘࡏ͠ͳ͚Ε͹.Z42-͔Β৘ใΛऔಘ ᶅᶄͰऔಘͨ͠৘ใΛ࣍ճϦΫΤετͷͨΊʹ 3FEJTʹॻ͖ࠐΈ
  100. ϖύϘͰ͸ɺσʔλετΞΛ ֊૚Խͯ͠Λ͍͍ײ͡ʹ͢Δ NSCHFNΛެ։͍ͯ͠·͢ ֦ுػߏ 3VCZͰ͍͏HFN

  101. NSVCZNTE MPDBMNFNDBDIF ΠϯϝϞϦ,74 3FEJT .Z42- ॲཧίετ͕௿͍ॱʹGFUDI ࣍ճҎ߱ͷGFUDIͷͨΊʹΩϟογϡ .VMUJ4UBHF%BUBTUPSF https://github.com/pepabo/mruby-msd NTE͕͍͍ײ͡ʹߴ଎ͳσʔλετΞ͔ΒGFUDI͢Δ

  102. NSVCZNTE redis = Msd::Store::Redis.new mysql = Msd::Store::MySQL.new( 'SELECT host FROM

    table WHERE domain = ?', 'localhost', 'root', 'password', 'DBName' ) msd = Msd::Client.new msd.configure do |c| c.stores = [redis, mysql] end msd.fetch('site-a.com') # => "Web Server1"
  103. NSVCZNTE redis = Msd::Store::Redis.new mysql = Msd::Store::MySQL.new( 'SELECT host FROM

    table WHERE domain = ?', 'localhost', 'root', 'password', 'DBName' ) msd = Msd::Client.new msd.configure do |c| c.stores = [redis, mysql] end msd.fetch('site-a.com') # => "Web Server1" ઀ଓ
  104. NSVCZNTE redis = Msd::Store::Redis.new mysql = Msd::Store::MySQL.new( 'SELECT host FROM

    table WHERE domain = ?', 'localhost', 'root', 'password', 'DBName' ) msd = Msd::Client.new msd.configure do |c| c.stores = [redis, mysql] end msd.fetch('site-a.com') # => "Web Server1" ઀ଓ σʔλετΞΛొ࿥
  105. NSVCZNTE redis = Msd::Store::Redis.new mysql = Msd::Store::MySQL.new( 'SELECT host FROM

    table WHERE domain = ?', 'localhost', 'root', 'password', 'DBName' ) msd = Msd::Client.new msd.configure do |c| c.stores = [redis, mysql] end msd.fetch('site-a.com') # => "Web Server1" ઀ଓ σʔλετΞΛొ࿥ σʔλΛΩϟογϡͭͭ͠GFUDI͢Δ
  106. 3FWFSTF1SPYZ OHJOY OHY@NSVCZ .Z42- 3FEJT ϦΫΤετ ϦΫΤετຖʹίωΫγϣϯΛ ுΔͷ͸ίετ͕ߴ͍ ίωΫγϣϯ

  107. ίωΫγϣϯͷ࢖͍ճ͠

  108. OHY@NSVCZʹ͸NSVCZͷϑοΫϙΠϯτ͕ଘࡏ͢Δ https://github.com/matsumotory/ngx_mruby/tree/master/docs/directives mruby_init_worker /path/to/init.rb; mruby_init_worker_code " # ίʔυ "; mruby_set

    $variable /path/to/variable.rb; mruby_access_handler /path/to/access.rb; mruby_access_handler /path/to/access.rb cache; nginx.conf # Workerϓϩηεىಈ࣌ # cacheΦϓγϣϯΛ͚ͭΔͱnginxىಈ࣌ʹmrubyΛόΠτίʔυ # _code ͷσΟϨΫςΟϒ͸ΠϯϥΠϯͰmrubyͷίʔυΛهड़Ͱ͖Δ # mrubyͷ࣮ߦ݁ՌΛnginxͷม਺ʹ֨ೲ͢Δ # ϦΫΤετ։࢝࣌ʹ࣮ߦ͞ΕΔ
  109. OHY@NSVCZʹ͸NSVCZͷϑοΫϙΠϯτ͕ଘࡏ͢Δ https://github.com/matsumotory/ngx_mruby/tree/master/docs/directives mruby_init_worker /path/to/init.rb; mruby_init_worker_code " # ίʔυ "; mruby_set

    $variable /path/to/variable.rb; mruby_access_handler /path/to/access.rb; mruby_access_handler /path/to/access.rb cache; nginx.conf # Workerϓϩηεىಈ࣌ # cacheΦϓγϣϯΛ͚ͭΔͱnginxىಈ࣌ʹmrubyΛόΠτίʔυ # _code ͷσΟϨΫςΟϒ͸ΠϯϥΠϯͰmrubyͷίʔυΛهड़Ͱ͖Δ # mrubyͷ࣮ߦ݁ՌΛnginxͷม਺ʹ֨ೲ͢Δ # ϦΫΤετ։࢝࣌ʹ࣮ߦ͞ΕΔ
  110. OHY@NSVCZʹ͸NSVCZͷϑοΫϙΠϯτ͕ଘࡏ͢Δ https://github.com/matsumotory/ngx_mruby/tree/master/docs/directives mruby_init_worker /path/to/init.rb; mruby_init_worker_code " # ίʔυ "; mruby_set

    $variable /path/to/variable.rb; mruby_access_handler /path/to/access.rb; mruby_access_handler /path/to/access.rb cache; nginx.conf # Workerϓϩηεىಈ࣌ # cacheΦϓγϣϯΛ͚ͭΔͱnginxىಈ࣌ʹmrubyΛόΠτίʔυ # _code ͷσΟϨΫςΟϒ͸ΠϯϥΠϯͰmrubyͷίʔυΛهड़Ͱ͖Δ # mrubyͷ࣮ߦ݁ՌΛnginxͷม਺ʹ֨ೲ͢Δ # ϦΫΤετ։࢝࣌ʹ࣮ߦ͞ΕΔ
  111. OHY@NSVCZʹ͸NSVCZͷϑοΫϙΠϯτ͕ଘࡏ͢Δ https://github.com/matsumotory/ngx_mruby/tree/master/docs/directives mruby_init_worker /path/to/init.rb; mruby_init_worker_code " # ίʔυ "; mruby_set

    $variable /path/to/variable.rb; mruby_access_handler /path/to/access.rb; mruby_access_handler /path/to/access.rb cache; nginx.conf # Workerϓϩηεىಈ࣌ # cacheΦϓγϣϯΛ͚ͭΔͱnginxىಈ࣌ʹmrubyΛόΠτίʔυ # _code ͷσΟϨΫςΟϒ͸ΠϯϥΠϯͰmrubyͷίʔυΛهड़Ͱ͖Δ # mrubyͷ࣮ߦ݁ՌΛnginxͷม਺ʹ֨ೲ͢Δ # ϦΫΤετ։࢝࣌ʹ࣮ߦ͞ΕΔ
  112. OHY@NSVCZʹ͸NSVCZͷϑοΫϙΠϯτ͕ଘࡏ͢Δ https://github.com/matsumotory/ngx_mruby/tree/master/docs/directives mruby_init_worker /path/to/init.rb; mruby_init_worker_code " # ίʔυ "; mruby_set

    $variable /path/to/variable.rb; mruby_access_handler /path/to/access.rb; mruby_access_handler /path/to/access.rb cache; nginx.conf # Workerϓϩηεىಈ࣌ # cacheΦϓγϣϯΛ͚ͭΔͱnginxىಈ࣌ʹmrubyΛόΠτίʔυ # _code ͷσΟϨΫςΟϒ͸ΠϯϥΠϯͰmrubyͷίʔυΛهड़Ͱ͖Δ # mrubyͷ࣮ߦ݁ՌΛnginxͷม਺ʹ֨ೲ͢Δ # ϦΫΤετ։࢝࣌ʹ࣮ߦ͞ΕΔ
  113. ίωΫγϣϯΛ࢖͍ճ͢ https://github.com/matsumotory/ngx_mruby/tree/master/docs/directives mruby_init_worker /path/to/init.rb; mruby_init_worker_code " # ίʔυ "; mruby_set

    $variable /path/to/variable.rb; mruby_access_handler /path/to/access.rb; mruby_access_handler /path/to/access.rb cache; nginx.conf # Workerϓϩηεىಈ࣌ # cacheΦϓγϣϯΛ͚ͭΔͱnginxىಈ࣌ʹmrubyΛόΠτίʔυ # _code ͷσΟϨΫςΟϒ͸ΠϯϥΠϯͰmrubyͷίʔυΛهड़Ͱ͖Δ # mrubyͷ࣮ߦ݁ՌΛnginxͷม਺ʹ֨ೲ͢Δ # ϦΫΤετ։࢝࣌ʹ࣮ߦ͞ΕΔ mruby_init_worker /path/to/init.rb; # Workerϓϩηεىಈ࣌ # ϦΫΤετ։࢝࣌ʹ࣮ߦ͞ΕΔ mruby_access_handler /path/to/access.rb;
  114. OHJOY 3FEJT 8PSLFSىಈ࣌ʹ3FEJTͱ઀ଓ͠ίωΫγϣϯΛอଘ͢Δ

  115. OHJOY XPSLFS 3FEJT ίωΫγϣϯ 8PSLFSىಈ࣌ʹ3FEJTͱ઀ଓ͠ίωΫγϣϯΛอଘ͢Δ 8PSLFSϓϩηεͷ ىಈ

  116. OHJOY XPSLFS 3FEJT mruby_init_worker_code " Userdata.new.redis = Redis.new('127.0.0.1', 6379) ";

    ίωΫγϣϯ 8PSLFSىಈ࣌ʹ3FEJTͱ઀ଓ͠ίωΫγϣϯΛอଘ͢Δ 8PSLFSϓϩηεͷ ىಈ NSVCZVTFSEBUBͱ͍͏NSCHFNΛ࢖ͬͯɺNSVCZεΫϦϓτ͔Β௚઀ࢀর Ͱ͖ͳ͍NSVCZͷάϩʔόϧม਺ʹ3FEJTͷίωΫγϣϯΛ֨ೲ ൺֱత҆શʹάϩʔόϧม਺ʹΦϒδΣΫτΛ֨ೲͰ͖Δ
  117. OHJOY XPSLFS 3FEJT 8PSLFSىಈ࣌ʹ઀ଓͨ͠3FEJTͷίωΫγϣϯΛ࢖͏

  118. OHJOY XPSLFS 3FEJT 8PSLFSىಈ࣌ʹ઀ଓͨ͠3FEJTͷίωΫγϣϯΛ࢖͏ ϦΫΤετ ΞΫηε mruby_access_handler_code " Userdata.new.redis.get('hoge') ";

  119. OHJOY XPSLFS 3FEJT 8PSLFSىಈ࣌ʹ઀ଓͨ͠3FEJTͷίωΫγϣϯΛ࢖͏ ϦΫΤετ ΞΫηε mruby_access_handler_code " Userdata.new.redis.get('hoge') ";

    8PSLFSىಈ࣌ʹ઀ଓͨ͠ίωΫγϣϯΛऔΓग़ͯ͠ɺར༻͢Δɻ NSVCZͷΠϯλϓϦλ͕8PSLFS಺Ͱ࢖͍ճ͞Ε͍ͯΔͨΊΞΫηε͕Մೳ ͦͷͨΊɺผͷ8PSLFS͔Β͸ผͷΠϯλϓϦλͳͷͰࢀরͰ͖ͳ͍
  120. OHJOY XPSLFS 3FEJT 8PSLFSىಈ࣌ʹ઀ଓͨ͠3FEJTͷίωΫγϣϯΛ࢖͏ ϦΫΤετ ΞΫηε mruby_access_handler_code " Userdata.new.redis.get('hoge') ";

    ίωΫγϣϯΛுͬͨޙʹ3FEJT͕࠶ىಈ͞ΕΔͳͲɺ ίωΫγϣϯ͕੾அ͞ΕΔ͜ͱΛ૝ఆͯ͠࠶઀ଓॲཧͷ࣮૷͸ඞཁɻ NSVCZNTE͸࣮૷ࡁΈ
  121. εέʔϥϏϦςΟ ߴՄ༻ੑ

  122. εέʔϥϏϦςΟ ߴՄ༻ੑ ໘౗ͳखॱͳ͘؆୯ɺࣗಈʹ

  123. 3FWFSTF1SPYZ $BDIF 4FSWFS $BDIF 4FSWFS $BDIF 4FSWFS $BDIF 4FSWFS $BDIF

    4FSWFS $BDIF 4FSWFS ϓϩΩγ͕ਖ਼ৗͳαʔόΛೝࣝͯ͠ ಈతʹϓϩΩγઌΛܾΊΔ
  124. $POTVM OHY@NSVCZ CZ)BTIJ$PSQ

  125. )BTIJ$PSQ͕։ൃ͍ͯ͠Διϑτ΢ΣΞ ػೳɿ αʔϏεσ ΟεΧόϦ ϔϧενΣοΫ ͳͲͳͲ DPOTVM

  126. DPOTVMͷΠϕϯτʹൃՐͯ͠ɺ༧Ί༻ҙ͠ ͨςϯϓϨʔτΛ࢖ͬͯϑΝΠϧΛੜ੒Ͱ ͖Δɻ αʔόͷ૿ݮ ϔϧενΣοΫͷ݁Ռ DPOTVMUFNQMBUF

  127. $POTVMΛ࢖͏ͱͲ͏ͳΔʁ

  128. 3FWFSTF1SPYZ DPOTVM DPOTVM DBDIFTFSWFS DPOTVM DBDIFTFSWFS $POTVMΛ࢖͏ͱͲ͏ͳΔʁ

  129. 3FWFSTF1SPYZ DPOTVM DPOTVM DBDIFTFSWFS DPOTVM DBDIFTFSWFS TFSWJDFDBDIFTFSWFS $POTVMͰTFSJWDFΛఆٛ ϔϧενΣοΫ TFSWJDFΛఆٛͯ͠ϔϧενΣοΫ͕Ͱ͖Δ

    { "service": { "name": "cache-server", "checks": [ { "script": "ϔϧενΣοΫίϚϯυ", } ] } }
  130. 3FWFSTF1SPYZ DPOTVM DPOTVM DBDIFTFSWFS DPOTVM DBDIFTFSWFS # curl -s http://localhost:8500/v1/health/service/

    \ cache-server | jq '.[].Node.Node' "cache-server-1" "cache-server-2" TFSWJDFDBDIFTFSWFS ϔϧενΣοΫ DPOTVM"1*ʹΞΫηε͢ΔͱαʔϏεʹଐ͢Δ ϊʔυΛಘΔ͜ͱ͕Ͱ͖Δɻ ϔϧενΣοΫ݁Ռ΋ಘΔ͜ͱ͕Ͱ͖Δɻ αʔϏεʹଐ͢ΔϊʔυͷҰཡ΍ϔϧενΣοΫ݁ՌΛಘΒΕΔ
  131. DPOTVMUFNQMBUFΛ࢖ͬͯɺ ಈతʹϑΝΠϧΛੜ੒͢Δ

  132. 3FWFSTF1SPYZ OHJOY XJUIOHY@NSVCZ DPOTVM DPOTVM DBDIFTFSWFS DPOTVM DBDIFTFSWFS TFSWJDFDBDIFTFSWFS DPOTVMUFNQMBUFΛ࢖ͬͯɺಈతʹϑΝΠϧΛੜ੒͢Δ

    DPOTVMUFNQMBUF
  133. 3FWFSTF1SPYZ OHJOY XJUIOHY@NSVCZ DPOTVM DPOTVM DBDIFTFSWFS DPOTVM DBDIFTFSWFS TFSWJDFDBDIFTFSWFS DPOTVMUFNQMBUF

    {{ range service "cache-server|passing" }} - {{ .Address }} {{ end }} servers.yml.ctmpl DPOTVMUFNQMBUFΛ࢖ͬͯɺಈతʹϑΝΠϧΛੜ੒͢Δ ϩʔυ ςϯϓϨʔτϑΝΠϧ
  134. 3FWFSTF1SPYZ OHJOY XJUIOHY@NSVCZ DPOTVM DPOTVM DBDIFTFSWFS DPOTVM DBDIFTFSWFS TFSWJDFDBDIFTFSWFS DPOTVMUFNQMBUF

    {{ range service "cache-server|passing" }} - {{ .Address }} {{ end }} servers.yml.ctmpl TFSWJDF ϔϧενΣοΫঢ়ଶ OPEFͷ*1ΞυϨε DPOTVMUFNQMBUFΛ࢖ͬͯɺಈతʹϑΝΠϧΛੜ੒͢Δ ϩʔυ ςϯϓϨʔτϑΝΠϧ
  135. 3FWFSTF1SPYZ OHJOY XJUIOHY@NSVCZ DPOTVM DPOTVM DBDIFTFSWFS DPOTVM DBDIFTFSWFS TFSWJDFDBDIFTFSWFS DPOTVMUFNQMBUF

    {{ range service "cache-server|passing" }} - {{ .Address }} {{ end }} - cache-server-1ͷIPΞυϨε - cache-server-2ͷIPΞυϨε servers.yml.ctmpl servers.yml DPOTVMUFNQMBUFΛ࢖ͬͯɺಈతʹϑΝΠϧΛੜ੒͢Δ ϩʔυ औಘ ੜ੒ ςϯϓϨʔτϑΝΠϧ
  136. 3FWFSTF1SPYZ OHJOY XJUIOHY@NSVCZ DPOTVM DPOTVM DBDIFTFSWFS DPOTVM DBDIFTFSWFS TFSWJDFDBDIFTFSWFS DPOTVMUFNQMBUF

    {{ range service "cache-server|passing" }} - {{ .Address }} {{ end }} - cache-server-1ͷIPΞυϨε - cache-server-2ͷIPΞυϨε - cache-server-3ͷIPΞυϨε servers.yml.ctmpl servers.yml αʔόΛ૿ઃͨ͠ͱ͖ DPOTVM DBDIFTFSWFS ςϯϓϨʔτϑΝΠϧ
  137. 3FWFSTF1SPYZ OHJOY XJUIOHY@NSVCZ DPOTVM DPOTVM DBDIFTFSWFS DPOTVM DBDIFTFSWFS TFSWJDFDBDIFTFSWFS DPOTVMUFNQMBUF

    {{ range service "cache-server|passing" }} - {{ .Address }} {{ end }} - cache-server-1ͷIPΞυϨε - cache-server-2ͷIPΞυϨε servers.yml.ctmpl servers.yml αʔό͕μ΢ϯͨ͠ͱ͖ ϔϧενΣοΫ ςϯϓϨʔτϑΝΠϧ
  138. αʔόͷ૿ݮ࣌ʹ ਖ਼ৗͳαʔόҰཡΛ ಈతੜ੒͢Δ͜ͱ͕Ͱ͖ͨʂ

  139. NSVCZΛ૊Έ߹ͤͯ ಈతʹઃఆΛಡΈࠐΉ

  140. 3FWFSTF1SPYZ OHJOY XJUIOHY@NSVCZ DPOTVM DPOTVM DBDIFTFSWFS DPOTVM DBDIFTFSWFS TFSWJDFDBDIFTFSWFS NSVCZΛ૊Έ߹ͤͯಈతʹઃఆΛಡΈࠐΉ

    DPOTVMUFNQMBUF mruby_init_worker_code " servers = YAML.load( File.open('servers.yml').read ) Userdata.new.servers = servers "; nginx.conf DPOTVM DBDIFTFSWFS
  141. 3FWFSTF1SPYZ OHJOY XJUIOHY@NSVCZ DPOTVM DPOTVM DBDIFTFSWFS DPOTVM DBDIFTFSWFS TFSWJDFDBDIFTFSWFS DPOTVMUFNQMBUF

    mruby_init_worker_code " servers = YAML.load( File.open('servers.yml').read ) Userdata.new.servers = servers "; nginx.conf DPOTVM DBDIFTFSWFS XPSLFSϓϩηεىಈ࣌ʹ ੜ੒͞Εͨ:".-Λϩʔυ *1ΞυϨεͷ഑ྻΛอଘ NSVCZΛ૊Έ߹ͤͯಈతʹઃఆΛಡΈࠐΉ
  142. 3FWFSTF1SPYZ OHJOY XJUIOHY@NSVCZ DPOTVM DPOTVM DBDIFTFSWFS DPOTVM DBDIFTFSWFS TFSWJDFDBDIFTFSWFS DPOTVMUFNQMBUF

    mruby_init_worker_code " servers = YAML.load( File.open('servers.yml').read ) Userdata.new.servers = servers "; nginx.conf DPOTVM DBDIFTFSWFS XPSLFSϓϩηεىಈ࣌ʹ ੜ੒͞Εͨ:".-Λϩʔυ *1ΞυϨεͷ഑ྻΛอଘ DPOTVMUFNQMBUFͰϑΝΠϧੜ੒ޙʹOHJOYSFMPBEΛ࣮ࢪͯ͠ϩʔυ͢Δʂ OHJOY SFMPBE NSVCZΛ૊Έ߹ͤͯಈతʹઃఆΛಡΈࠐΉ
  143. NSVCZͷੈքʹϓϩΩγઌͷ αʔόҰཡΛ౉͢͜ͱ͕Ͱ͖ͨʂ

  144. NSVCZͰಈతʹ6QTUSFBNΛ ܾఆ͢Δ

  145. NSVCZͰಈతʹ6QTUSFBNΛܾఆ͢Δ 3FWFSTF1SPYZ DBDIFTFSWFS DBDIFTFSWFS DBDIFTFSWFS 8FC4FSWFS ίϯςϯπΩϟογϡػೳແޮ࣌

  146. NSVCZͰಈతʹ6QTUSFBNΛܾఆ͢Δ 3FWFSTF1SPYZ DBDIFTFSWFS DBDIFTFSWFS DBDIFTFSWFS 8FC4FSWFS ίϯςϯπΩϟογϡػೳ༗ޮ࣌ ͲΕ͔̍୆

  147. NSVCZΛ૊Έ߹ͤͯಈతʹઃఆΛಡΈࠐΉ upstream dynamic_cache_server { server 127.0.0.1:80; mruby_upstream_keepalive 64; } mruby_set_code

    $upstream " : if result.enable_contents_cache? servers = Userdata.new.servers port = Nginx::Connection.new.local_port index = SecureRandom.random_number(servers.size) upstream = Nginx::Upstream.new("dynamic_cache_server") upstream.server = "#{servers[index]}:#{port}" "dynamic_cache_server" else result.upstream end "; proxy_pass $upstream; # DB͔Βऔಘͨ͠ίϯςϯπΩϟογϡػೳͷར༻༗ແ # DB͔Βऔಘͨ͠υϝΠϯʹඥͮ͘Web Server nginx.conf
  148. NSVCZΛ૊Έ߹ͤͯಈతʹઃఆΛಡΈࠐΉ upstream dynamic_cache_server { server 127.0.0.1:80; mruby_upstream_keepalive 64; } mruby_set_code

    $upstream " : if result.enable_contents_cache? servers = Userdata.new.servers port = Nginx::Connection.new.local_port index = SecureRandom.random_number(servers.size) upstream = Nginx::Upstream.new("dynamic_cache_server") upstream.server = "#{servers[index]}:#{port}" "dynamic_cache_server" else result.upstream end "; proxy_pass $upstream; # DB͔Βऔಘͨ͠ίϯςϯπΩϟογϡػೳͷར༻༗ແ # DB͔Βऔಘͨ͠υϝΠϯʹඥͮ͘Web Server μϛʔͷ6QTUSFBN OHY@NSVCZͰॻ͖׵͑Δ nginx.conf
  149. NSVCZΛ૊Έ߹ͤͯಈతʹઃఆΛಡΈࠐΉ upstream dynamic_cache_server { server 127.0.0.1:80; mruby_upstream_keepalive 64; } mruby_set_code

    $upstream " : if result.enable_contents_cache? servers = Userdata.new.servers port = Nginx::Connection.new.local_port index = SecureRandom.random_number(servers.size) upstream = Nginx::Upstream.new("dynamic_cache_server") upstream.server = "#{servers[index]}:#{port}" "dynamic_cache_server" else result.upstream end "; proxy_pass $upstream; # DB͔Βऔಘͨ͠ίϯςϯπΩϟογϡػೳͷར༻༗ແ # DB͔Βऔಘͨ͠υϝΠϯʹඥͮ͘Web Server OHJOYͷม਺ʹNSVCZͷ࣮ߦ݁ՌΛ֨ೲ͢Δ nginx.conf
  150. NSVCZΛ૊Έ߹ͤͯಈతʹઃఆΛಡΈࠐΉ upstream dynamic_cache_server { server 127.0.0.1:80; mruby_upstream_keepalive 64; } mruby_set_code

    $upstream " : if result.enable_contents_cache? servers = Userdata.new.servers port = Nginx::Connection.new.local_port index = SecureRandom.random_number(servers.size) upstream = Nginx::Upstream.new("dynamic_cache_server") upstream.server = "#{servers[index]}:#{port}" "dynamic_cache_server" else result.upstream end "; proxy_pass $upstream; # DB͔Βऔಘͨ͠ίϯςϯπΩϟογϡػೳͷར༻༗ແ # DB͔Βऔಘͨ͠υϝΠϯʹඥͮ͘Web Server mruby_init_worker_code " servers = YAML.load( File.open('servers.yml').read ) Userdata.new.servers = servers "; ىಈ࣌ʹऔಘͨ͠$BDIF4FSWFSҰཡ nginx.conf
  151. NSVCZΛ૊Έ߹ͤͯಈతʹઃఆΛಡΈࠐΉ upstream dynamic_cache_server { server 127.0.0.1:80; mruby_upstream_keepalive 64; } mruby_set_code

    $upstream " : if result.enable_contents_cache? servers = Userdata.new.servers port = Nginx::Connection.new.local_port index = SecureRandom.random_number(servers.size) upstream = Nginx::Upstream.new("dynamic_cache_server") upstream.server = "#{servers[index]}:#{port}" "dynamic_cache_server" else result.upstream end "; proxy_pass $upstream; # DB͔Βऔಘͨ͠ίϯςϯπΩϟογϡػೳͷར༻༗ແ # DB͔Βऔಘͨ͠υϝΠϯʹඥͮ͘Web Server ઀ଓઌͷϙʔτ൪߸   nginx.conf
  152. NSVCZΛ૊Έ߹ͤͯಈతʹઃఆΛಡΈࠐΉ upstream dynamic_cache_server { server 127.0.0.1:80; mruby_upstream_keepalive 64; } mruby_set_code

    $upstream " : if result.enable_contents_cache? servers = Userdata.new.servers port = Nginx::Connection.new.local_port index = SecureRandom.random_number(servers.size) upstream = Nginx::Upstream.new("dynamic_cache_server") upstream.server = "#{servers[index]}:#{port}" "dynamic_cache_server" else result.upstream end "; proxy_pass $upstream; # DB͔Βऔಘͨ͠ίϯςϯπΩϟογϡػೳͷར༻༗ແ # DB͔Βऔಘͨ͠υϝΠϯʹඥͮ͘Web Server μϛʔͰఆٛͨ͠6QTUSFBN nginx.conf
  153. NSVCZΛ૊Έ߹ͤͯಈతʹઃఆΛಡΈࠐΉ upstream dynamic_cache_server { server 127.0.0.1:80; mruby_upstream_keepalive 64; } mruby_set_code

    $upstream " : if result.enable_contents_cache? servers = Userdata.new.servers port = Nginx::Connection.new.local_port index = SecureRandom.random_number(servers.size) upstream = Nginx::Upstream.new("dynamic_cache_server") upstream.server = "#{servers[index]}:#{port}" "dynamic_cache_server" else result.upstream end "; proxy_pass $upstream; # DB͔Βऔಘͨ͠ίϯςϯπΩϟογϡػೳͷར༻༗ແ # DB͔Βऔಘͨ͠υϝΠϯʹඥͮ͘Web Server 6QTUSFBNͷαʔόΛॻ͖׵͑Δ nginx.conf
  154. NSVCZΛ૊Έ߹ͤͯಈతʹઃఆΛಡΈࠐΉ upstream dynamic_cache_server { server 127.0.0.1:80; mruby_upstream_keepalive 64; } mruby_set_code

    $upstream " : if result.enable_contents_cache? servers = Userdata.new.servers port = Nginx::Connection.new.local_port index = SecureRandom.random_number(servers.size) upstream = Nginx::Upstream.new("dynamic_cache_server") upstream.server = "#{servers[index]}:#{port}" "dynamic_cache_server" else result.upstream end "; proxy_pass $upstream; # DB͔Βऔಘͨ͠ίϯςϯπΩϟογϡػೳͷར༻༗ແ # DB͔Βऔಘͨ͠υϝΠϯʹඥͮ͘Web Server 6QTUSFBNͷαʔόΛॻ͖׵͑Δ ϥϯμϜʹΩϟογϡαʔόΛ1୆ฦ͢ nginx.conf
  155. NSVCZΛ૊Έ߹ͤͯಈతʹઃఆΛಡΈࠐΉ upstream dynamic_cache_server { server 127.0.0.1:80; mruby_upstream_keepalive 64; } mruby_set_code

    $upstream " : if result.enable_contents_cache? servers = Userdata.new.servers port = Nginx::Connection.new.local_port index = SecureRandom.random_number(servers.size) upstream = Nginx::Upstream.new("dynamic_cache_server") upstream.server = "#{servers[index]}:#{port}" "dynamic_cache_server" else result.upstream end "; proxy_pass $upstream; # DB͔Βऔಘͨ͠ίϯςϯπΩϟογϡػೳͷར༻༗ແ # DB͔Βऔಘͨ͠υϝΠϯʹඥͮ͘Web Server ࠷ޙʹࢀরͨ͠΋ͷ͕ม਺ʹ֨ೲ͞ΕΔ nginx.conf
  156. NSVCZΛ૊Έ߹ͤͯಈతʹઃఆΛಡΈࠐΉ upstream dynamic_cache_server { server 127.0.0.1:80; mruby_upstream_keepalive 64; } mruby_set_code

    $upstream " : if result.enable_contents_cache? servers = Userdata.new.servers port = Nginx::Connection.new.local_port index = SecureRandom.random_number(servers.size) upstream = Nginx::Upstream.new("dynamic_cache_server") upstream.server = "#{servers[index]}:#{port}" "dynamic_cache_server" else result.upstream end "; proxy_pass $upstream; # DB͔Βऔಘͨ͠ίϯςϯπΩϟογϡػೳͷར༻༗ແ # DB͔Βऔಘͨ͠υϝΠϯʹඥͮ͘Web Server ࠷ޙʹࢀরͨ͠΋ͷ͕ม਺ʹ֨ೲ͞ΕΔ ϓϩΩγ͢Δ nginx.conf
  157. NSVCZΛ૊Έ߹ͤͯಈతʹઃఆΛಡΈࠐΉ upstream dynamic_cache_server { server 127.0.0.1:80; mruby_upstream_keepalive 64; } mruby_set_code

    $upstream " : if result.enable_contents_cache? servers = Userdata.new.servers port = Nginx::Connection.new.local_port index = SecureRandom.random_number(servers.size) upstream = Nginx::Upstream.new("dynamic_cache_server") upstream.server = "#{servers[index]}:#{port}" "dynamic_cache_server" else result.upstream end "; proxy_pass $upstream; # DB͔Βऔಘͨ͠ίϯςϯπΩϟογϡػೳͷར༻༗ແ # DB͔Βऔಘͨ͠υϝΠϯʹඥͮ͘Web Server ίϯςϯπΩϟογϡػೳ͕ແޮͷ৔߹͸ %#͔Βऔಘͨ͠8FC4FSWFSΛฦ͢ nginx.conf
  158. DPOTVMͱOHY@NSVCZͷ૊Έ߹ͤͰ αʔόͷ૿ݮʹ߹Θͤͯࣗಈతʹ ϓϩΩγઌΛܾఆ͢Δ࢓૊Έ͕Ͱ͖ͨ

  159. ޮ཰తͳΩϟογϡ

  160. ޮ཰తͳΩϟογϡ ୯७ʹ$BDIF4FSWFSΛฒ΂ͯ෼ࢄ͢Δͱ 3FWFSTF1SPYZ $BDIF 4FSWFS $BDIF 4FSWFS $BDIF 4FSWFS $BDIF

    4FSWFS $BDIF 4FSWFS $BDIF 4FSWFS  8&#4FSWFS Ωϟογϡώοτ཰௿Լ σΟεΫྖҬͷফඅ FYBNQMFDPN FYBNQMFDPN
  161. ޮ཰తͳΩϟογϡ υϝΠϯຖʹॲཧ͢Δ$BDIF4FSWFSΛݶఆ͍ͨ͠ 3FWFSTF1SPYZ $BDIF 4FSWFS $BDIF 4FSWFS $BDIF 4FSWFS $BDIF

    4FSWFS $BDIF 4FSWFS $BDIF 4FSWFS  8&#4FSWFS Ωϟογϡώοτ཰޲্ σΟεΫྖҬͷઅ໿ FYBNQMFDPN FYBNQMFDPN
  162. υϝΠϯຖʹΩϟογϡαʔόΛ ݶఆ͍͚ͨͩ͠Ͱͳ͘ ʴ αʔόͷεέʔϧʹࣗಈରԠ͍ͨ͠ ʴ Մ༻ੑΛҡ͍࣋ͨ͠

  163. NSVCZͰ؆୯ͳΞϧΰϦζϜΛ࣮૷

  164. 3FWFSTF1SPYZ $BDIF 4FSWFS $BDIF 4FSWFS $BDIF 4FSWFS $BDIF 4FSWFS $BDIF

    4FSWFS $BDIF 4FSWFS FYBNQMFDPN
  165. 3FWFSTF1SPYZ $BDIF 4FSWFS $BDIF 4FSWFS $BDIF 4FSWFS $BDIF 4FSWFS $BDIF

    4FSWFS $BDIF 4FSWFS FYBNQMFDPN F Y B N Q M F  D P N υϝΠϯͷઌ಄͔Β̑จࣈநग़
  166. 3FWFSTF1SPYZ $BDIF 4FSWFS $BDIF 4FSWFS $BDIF 4FSWFS $BDIF 4FSWFS $BDIF

    4FSWFS $BDIF 4FSWFS FYBNQMFDPN F Y B N Q M F  D P N      ਐ਺ͷ"4$**ίʔυΛऔಘ υϝΠϯͷઌ಄͔Β̑จࣈநग़
  167. 3FWFSTF1SPYZ $BDIF 4FSWFS $BDIF 4FSWFS $BDIF 4FSWFS $BDIF 4FSWFS $BDIF

    4FSWFS $BDIF 4FSWFS FYBNQMFDPN F Y B N Q M F  D P N        ਐ਺ͷ"4$**ίʔυΛ଍͢ υϝΠϯͷઌ಄͔Β̑จࣈநग़
  168. 3FWFSTF1SPYZ $BDIF 4FSWFS $BDIF 4FSWFS $BDIF 4FSWFS $BDIF 4FSWFS $BDIF

    4FSWFS $BDIF 4FSWFS FYBNQMFDPN F Y B N Q M F  D P N        <> <> <> <> <> <> "SSBZ DPOTVMUFNQMBUFʹΑΔ:".-ੜ੒ˠ:".-MPBE ˠ"SSBZ
  169. 3FWFSTF1SPYZ $BDIF 4FSWFS $BDIF 4FSWFS $BDIF 4FSWFS $BDIF 4FSWFS $BDIF

    4FSWFS $BDIF 4FSWFS FYBNQMFDPN F Y B N Q M F  D P N             <> <> <> <> <> <> "SSBZ MFOHUI
  170. 3FWFSTF1SPYZ $BDIF 4FSWFS $BDIF 4FSWFS $BDIF 4FSWFS $BDIF 4FSWFS $BDIF

    4FSWFS $BDIF 4FSWFS FYBNQMFDPN F Y B N Q M F  D P N             <> <> <> <> <> <> "SSBZ
  171. αʔόͷ૿ݮ͕ൃੜͨ͠৔߹

  172. 3FWFSTF1SPYZ $BDIF 4FSWFS $BDIF 4FSWFS $BDIF 4FSWFS $BDIF 4FSWFS $BDIF

    4FSWFS $BDIF 4FSWFS FYBNQMFDPN F Y B N Q M F  D P N             <> <> <> <> <> <> "SSBZ
  173. 3FWFSTF1SPYZ $BDIF 4FSWFS $BDIF 4FSWFS $BDIF 4FSWFS $BDIF 4FSWFS $BDIF

    4FSWFS $BDIF 4FSWFS FYBNQMFDPN F Y B N Q M F  D P N             <> <> <> <> <> <> "SSBZ MFOHUI DPOTVMUFNQMBUFͰઃఆϑΝΠϧ͕࠶ੜ੒ OHJOYSFMPBE
  174. 3FWFSTF1SPYZ $BDIF 4FSWFS $BDIF 4FSWFS $BDIF 4FSWFS $BDIF 4FSWFS $BDIF

    4FSWFS $BDIF 4FSWFS FYBNQMFDPN F Y B N Q M F  D P N             <> <> <> <> <> <> "SSBZ
  175. NSVCZΛ࢖ͬͨ؆୯ͳΞϧΰϦζϜͷ ࣮૷ʹΑͬͯ ޮ཰తͳΩϟογϡΛ࣮ݱͨ͠ʂ

  176. ·ͱΊ

  177. ·ͱΊ ίϯςϯπΩϟογϡػೳΛϦϦʔεͨ͠ ໢಺ંฦ͠Ͱߴ଎ɾઃఆ؆୯ NSVCZΛ׆༻ͯ͠େن໛Ϩϯαό؀ڥʹඞཁͳཁ݅ Λຬͨͨ͠ NSVCZNTE NSVCZVTFSEBUBΛ༻͍ͨύϑΥʔϚ ϯε޲্5JQTΛ঺հͨ͠ DPOTVMͱNSVCZΛ૊Έ߹ͤͯɺαʔόͷঢ়ଶʹ߹ ΘͤͯಈతʹมԽ͢ΔΠϯϑϥΞʔΩςΫνϟΛ

    ࣮ݱͨ͠
  178. ܅΋ϖύϘͰಇ͔ͳ͍͔ʁ ࠷৽ͷ࠾༻৘ใΛνΣοΫˠ !QC@SFDSVJU

  179. ͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠