Upgrade to Pro — share decks privately, control downloads, hide ads and more …

200万ドメインのHTTPS化を見据えた大規模証明書管理アーキテクチャ / CKP-QGPOP-2milions-tls

200万ドメインのHTTPS化を見据えた大規模証明書管理アーキテクチャ / CKP-QGPOP-2milions-tls

研究開発によってサーバ台数を100分の1にする技術を生み出す

ペパボ研究所 主席研究員 兼 シニアプリンシパルエンジニア 松本 亮介 / Pepabo R&D Institute, GMO Pepabo, Inc.
2017.12.07 CKP-QGPOP研究会

MATSUMOTO Ryosuke

December 07, 2017
Tweet

More Decks by MATSUMOTO Ryosuke

Other Decks in Technology

Transcript

  1. ݚڀ։ൃʹΑͬͯαʔό୆਺Λ100෼ͷ1ʹ͢Δٕज़ΛੜΈग़͢
    ϖύϘݚڀॴ ओ੮ݚڀһ ݉ γχΞϓϦϯγύϧΤϯδχΞ দຊ ྄հ / Pepabo R&D Institute, GMO Pepabo, Inc.
    2017.12.07 CKP-QGPOPݚڀձ
    200ສυϝΠϯͷHTTPSԽΛݟਾ͑ͨ
    େن໛ূ໌ॻ؅ཧΞʔΩςΫνϟ

    View full-size slide

  2. • ژ౎େֶത࢜ʢ৘ใֶʣ
    • ϖύϘݚڀॴ ओ੮ݚڀһ
    • GMOϖύϘ γχΞɾϓϦϯγύϧΤϯδχΞ
    • ݩΠϯϑϥΤϯδχΞ
    • ೔ຊOSS঑ྭ৆ɾ৘ใॲཧֶձ ࢁԼه೦ݚڀ৆ͳͲଟ਺
    2
    দຊ྄հ / ·ͭ΋ͱΓʔ / @matsumotory

    View full-size slide

  3. 1.ৗ࣌HTTPSԽͷഎܠͱຊݚڀͷ໨త
    2.ैདྷͷWebαʔόͷূ໌ॻઃఆͷ՝୊
    3.ߴूੵϚϧνςφϯτWebαʔόͷେن໛ূ໌ॻ؅ཧ
    4.࣮ݧͱ࣮ӡ༻্ͷධՁ
    5.·ͱΊ
    3
    ໨࣍

    View full-size slide

  4. 1.
    ৗ࣌HTTPSԽͷഎܠͱຊݚڀͷ໨త

    View full-size slide

  5. • HTTP/2ͷRFC࠾୒ͱ࣮༻ԽͷऔΓ૊Έ
    • GoogleʹΑΔৗ࣌HTTPSԽͷਪਐ
    • Let’s EncryptʹΑΔແྉͷDVূ໌ॻͷఏڙ
    • اۀ͚ͩͰͳ͘ݸਓͷWebαΠτͷHTTPSԽ΋ඞਢ
    5
    ݚڀͷഎܠ

    View full-size slide

  6. • ݸਓ޲͚ͷ௿Ձ֨ϗεςΟϯάͰ࠾༻͞ΕΔ͜ͱͷଟ͍ํࣜ※1
    • ୯ҰͷWebαʔόʹߴूੵ(਺ສυϝΠϯ)ʹϗετΛऩ༰
    • Ծ૝ϗετํࣜʹΑΓେྔͷϗετΛಉҰϓϩηεͰॲཧ
    • ϦόʔεϓϩΩγͷ৔߹͸ߋʹߴूੵ(਺ेɺ਺ඦສυϝΠϯ)
    • ߴूੵϚϧνςφϯτํࣜͷHTTPSରԠ΋ٸ຿
    6
    ߴूੵϚϧνςφϯτํࣜͷWebαʔό
    ˞দຊ྄հ തֶ࢜Ґ࿦จ8FCαʔόͷߴूੵϚϧνςφϯτΞʔΩςΫνϟʹؔ͢Δݚڀ
    IUUQTSFQPTJUPSZLVMJCLZPUPVBDKQETQBDFIBOEMF ژ౎େֶ ೥݄

    View full-size slide

  7. • Webαʔόϓϩηεىಈ࣌ʹશͯͷূ໌ॻΛಡΈࠐΉํࣜ
    • ߴूੵϚϧνςφϯτํࣜͰ͸ূ໌ॻ਺͕๲େ
    • ϝϞϦ࢖༻ྔ͕ূ໌ॻ਺ʹґଘͯ͠ϋʔυ΢ΣΞίετ૿Ճ
    • ϓϩηεىಈʹ௕͕͔͔࣌ؒΓઃఆมߋ࣌ͷӡ༻໘ʹ՝୊
    • ࠓޙΛݟਾ͑ͯݚڀऀͱͯ͠ૣΊʹखΛ͏ͭඞཁ͕͋Δ
    7
    ैདྷͷߴूੵϚϧνςφϯτํࣜͷূ໌ॻઃఆͷ՝୊

    View full-size slide

  8. 2015೥Լظ͔ΒऔΓ૊Έ։࢝ޙ2016೥1݄ϦϦʔε
    8
    SFGIUUQICNBUTVNPUPSKQFOUSZ

    View full-size slide

  9. ߴूੵϚϧνςφϯτWebαʔόͷେن໛ূ໌ॻ؅ཧ
    • ূ໌ॻ਺ͷ૿Ճʹ൐͏Ϧιʔε࢖༻ྔͷ૿ՃΛ௿ݮ
    • αʔϏεఀࢭ͢Δ͜ͱͳ͘৽نઃఆΛ൓өՄೳ
    • ϗεςΟϯάαʔϏεͷϓϩμΫγϣϯ؀ڥʹಋೖͯ͠ධՁ
    200ສυϝΠϯͷHTTPSԽʹඞཁͳαʔό୆਺Λ100෼ͷ1΁
    9
    ຊݚڀͷ໨త

    View full-size slide

  10. 2.
    ैདྷͷWebαʔόͷূ໌ॻઃఆͷ՝୊

    View full-size slide

  11. 1. HTTPSԽʹ൐͏ϋʔυ΢ΣΞίετͷ૿Ճ
    2. ূ໌ॻ௥Ճ౳ͷઃఆมߋద༻࣌ؒͷ૿Ճ
    11
    ߴूੵϚϧνςφϯτํࣜͷऩ༰཰ͱӡ༻໘ͷ՝୊

    View full-size slide

  12. • ϗετͷ਺ʹൺྫͯ͠ϗετઃఆɾূ໌ॻ΍ൿີ伴ͷσʔλɾ
    HTTP/HTTPSॲཧʹඞཁͳϝϞϦ࢖༻ྔ͕૿େ
    • ΄ͱΜͲΞΫηεͷແ͍ϗετʹରͯ͠΋ઃఆ৘ใΛอ࣋
    • Մ༻ੑͱอकੑΛߴΊΔͨΊʹHTTPS༻ͷϓϩΩγΛલஈʹ
    ஔ͍ͨ৔߹͸όοΫΤϯυͷυϝΠϯΛશͯू໿͢Δඞཁ͋Γ
    • ฐࣾϗεςΟϯάαʔϏεͰ͸200ສυϝΠϯҎ্
    12
    1. HTTPSԽʹ൐͏ϋʔυ΢ΣΞίετͷ૿Ճ

    View full-size slide

  13. • αʔόϓϩηεىಈ࣌ʹશͯͷূ໌ॻ΍ઃఆΛಡΈࠐΈ
    • ϗετ୯ҐͰରԠ͢Δূ໌ॻͷϑΝΠϧ΍ઃఆΛهड़
    • ߴूੵԽʹ൐͍ઃఆߦ਺ͷ૿େ΍؅ཧίετͷ૿େ
    • ઃఆ਺૿Ճʹ൐͍αʔόϓϩηεͷ࠶ىಈ͕࣌ؒ૿Ճ
    • ઃఆͷ࠶ಡΈࠐΈॲཧ͢ΒαʔϏεఀࢭʹܨ͕ΔڪΕ༗Γ
    13
    2. ূ໌ॻ௥Ճ౳ͷઃఆมߋద༻࣌ؒͷ૿Ճ

    View full-size slide

  14. 3.
    ߴूੵϚϧνςφϯτWebαʔό
    ͷେن໛ূ໌ॻ؅ཧΞʔΩςΫνϟ

    View full-size slide

  15. • αʔόϓϩηεىಈ࣌ʹূ໌ॻ͸Ұ੾ಡΈࠐ·ͳ͍
    • αʔόϓϩηεͷ࠶ىಈ/࠶ಡΈࠐΈ࣌ؒͷ௿଎ԽΛճආ
    • TLSϋϯυγΣΠΫ࣌ʹඞཁͳূ໌ॻͱઃఆΛಈతʹಡΈࠐΈ
    • ߴ଎ͳϓϩηε࠶ಡΈࠐΈʹΑΔϝϞϦղ์΋Մೳ
    • ূ໌ॻ΍ϗετͷ৽ن௥Ճઃఆʹϓϩηε࠶ىಈ͕ෆཁ
    15
    ఏҊख๏

    View full-size slide

  16. ΞʔΩςΫνϟʢํࣜʣͷఏҊ
    16
    'JMF,74
    IUUQE

    QSPDFTT
    $MJFOU
    4/*ʹΑͬͯTFSWFSOBNF͕FYBNQMFKQͷ
    υϝΠϯʹର͢Δ5-4ϋϯυγΣΠΫ͕։࢝
    5-4ϋϯυγΣΠΫ࣌ʹυϝΠϯFYBNQMFKQʹඥͮ͘ূ
    ໌ॻͱൿີ伴ΛϑΝΠϧ΍,FZ7BMVF4UPSF ,74
    ͳͲ
    ͔ΒಈతʹಡΈࠐΈ͍ͨ

    View full-size slide

  17. ΞʔΩςΫνϟʢํࣜʣͷఏҊ
    17
    'JMF,74
    IUUQE

    QSPDFTT
    $MJFOU
    5-4ϋϯυγΣΠΫ࣌ʹ೚ҙͷؔ਺Λ࣮ߦͰ͖Ε͹ྑ͍
    ؔ਺ͷதͰυϝΠϯͱඥͮ͘αʔόূ໌ॻͱൿີ伴Λ
    ಡΈࠐΉؔ਺Λ࣮ߦͰ͖Ε͹ྑ͍

    View full-size slide

  18. • 3೥ͿΓͷϝδϟʔϦϦʔε
    • https://www.openssl.org/news/openssl-1.0.2-notes.html
    • OpenSSLͷίʔυΛٱʑʹோΊ͍ͯͨ
    • TLSϋϯυγΣΠΫ࣌ʹؔ਺ΛίʔϧόοΫ͢Δؔ਺͕௥Ճ
    • SSL_CTX_set_client_cert_cb() ͳͲ
    18
    OpenSSL 1.0.2͕2015೥1݄22೔ʹϦϦʔε

    View full-size slide

  19. • ngx_mruby※1
    ʹTLSϋϯυγΣΠΫͷRubyϑοΫઃఆΛ࣮૷
    • TLSϋϯυγΣΠΫ࣌ʹϑοΫ͞ΕͨRubyͷίʔυΛ࣮ߦ
    • RubyϝιουͰOpenSSLͱσʔλͷड͚౉͠Λ࣮ߦ
    • KVS/File͔Βূ໌ॻ΍ൿີ伴ΛRubyܦ༝ͰಡΈࠐΈՄ
    19
    ngx_mruby v1.16.0ʢ2016೥2݄ʣͰ௥Ճ࣮૷
    ˞দຊ྄հ Ԭ෦णஉ NPE@NSVCZεΫϦϓτݴޠͰߴ଎͔ͭলϝϞϦʹ֦ுՄೳͳ8FCαʔόͷ
    ػೳ֦ுࢧԉػߏ ৘ใॲཧֶձ࿦จࢽɼ7PM /P QQ /PW

    View full-size slide

  20. ngx_mrubyͷূ໌ॻಈతಡΈࠐΈ࣮૷ϑϩʔ
    20
    44-@$59@TFU@DFSU@DC
    ʹ3VCZͷόΠ
    τίʔυΛ࣮ߦ͢ΔIBOEMFSͷؔ਺ϙΠϯ
    λͱίϯςΩετߏ଄ମϙΠϯλΛηοτ
    OHJOYDPOGͷઃఆ͔ΒಡΈࠐΜͩ3VCZε
    ΫϦϓτΛόΠτίʔυԽͯ͠
    ίϯςΩετߏ଄ମʹอଘ
    5-4ϋϯυγΣΠΫ࣌ʹIBOEMFS͕ίʔϧ
    όοΫ͞ΕόΠτίʔυΛ࣮ߦ
    όΠτίʔυͰ࣮ߦ͞ΕΔ3VCZͷϝιο
    υܦ༝Ͱূ໌ॻ΍ൿີ伴σʔλ͕
    ίϯςΩετߏ଄ମʹηοτ͢Δ
    ূ໌ॻͱൿີ伴σʔλʹج͍ͯ#*0ܦ༝Ͱ
    σʔλΛಡΈࠐΜͰϋϯυγΣΠΫΛଓߦ
    OHJOYىಈ࣌ͷॲཧ OHJOY͕ϦΫΤετड৴ͨ࣌͠ͷॲཧ
    NSVCZͷ5-4ϋϯυγΣΠΫϑοΫσΟ
    ϨΫςΟϒ͕ଘࡏͨ͠Β
    44-@$59@TFU@DFSU@DC
    Λݺͼग़͢

    View full-size slide

  21. • ϦΫΤετͷ͋ͬͨOpenSSLͷservernameͰ൑ఆ
    • ඥͮ͘ূ໌ॻͱϓϩΩγઌΛRubyͷίʔυͰܾఆ
    • RubyͰಈతʹઃఆ(mruby_set $hostͱproxy_pass $host)
    • ୯ҰͷઃఆͰສͷΦʔμʔͷυϝΠϯΛಈతʹॲཧ
    • ઃఆͱূ໌ॻʹؔ͢ΔϝϞϦ࢖༻ྔΛઅ໿
    21
    ngx_mrubyͷಈతͳઃఆͱূ໌ॻಡΈࠐΈ

    View full-size slide

  22. 22
    ϦΫΤετ͞ΕͨυϝΠϯ͔Βಈతʹূ໌ॻΛಡΈସ͑Δ͜ͱʹΑ
    ΓόοΫΤϯυ΁ͷϓϩΩγઃఆ΋ؚΊ୯Ұͷઃఆʹू໿Մೳ
    ϑΝΠϧϕʔεͷಈతূ໌ॻಡΈࠐΈྫ
    3VCZͰϓϩάϥϚϒϧʹهड़Մೳ

    View full-size slide

  23. 23
    ϦΫΤετ͞ΕͨυϝΠϯ͔Βಈతʹূ໌ॻΛ
    ಡΈସ͑Δ͜ͱʹΑΓ୯Ұͷઃఆʹू໿Մೳ
    ,74ϕʔεͷಈతূ໌ॻಡΈࠐΈྫ

    View full-size slide

  24. 1. αʔόϓϩηεىಈ࣌ʹ͸ূ໌ॻ͸ಡΈࠐ·ͳ͍
    2. υϝΠϯͱূ໌ॻɺϓϩΩγͷઃఆ͸୯Ұͷઃఆʹѹॖ
    3. ΞΫηεͷ͋ͬͨυϝΠϯͷΈͷূ໌ॻΛಡΈࠐΉ
    • 200ສυϝΠϯͰΞΫηεͷແ͍υϝΠϯ͸ଟ਺ଘࡏ
    4. ఆظతͳϓϩηεϦϩʔυʹΑΓূ໌ॻσʔλΛղ์
    24
    HTTPSԽʹؔ͢ΔϝϞϦ࢖༻ྔޮ཰Խ·ͱΊ

    View full-size slide

  25. 4.
    ࣮ݧͱ࣮ӡ༻্ͷධՁ

    View full-size slide

  26. 1. ࣮ݧ؀ڥͰैདྷख๏ͱఏҊख๏ͷىಈ࣌ؒͷ࣮ݧ
    2. ࣮ݧ؀ڥͰैདྷख๏ͱఏҊख๏ͷੑೳൺֱ࣮ݧ
    ɾಈతূ໌ॻಡΈࠐΈͷΦʔόʔϔου͸Ͳͷఔ౓͔ʁ
    3. ຊ൪؀ڥͰ࣮ӡ༻্ͷධՁ
    ɾແྉHTTPSΦϓγϣϯαʔϏεͷ։࢝ͱͦͷޙ
    26
    ࣮ݧͱ࣮ӡ༻্ͷධՁ

    View full-size slide

  27. 1. ैདྷख๏ͱఏҊख๏ͷىಈ࣌ؒͷ࣮ݧ

    View full-size slide

  28. ࣮ݧ؀ڥ
    28
    ࢓༷
    $16 *OUFM9FPO&W()[DPSF
    .FNPSZ (CZUFT
    4FSWFS /&$&YQSFTT3G&
    04 $FOU04-JOVY,FSOFM

    View full-size slide

  29. • 10ສϗετ෼ͷ4096bitsͷ伴௕ͷൿີ伴ͱαʔόূ໌ॻΛ
    nginxόʔδϣϯ1.11.13ͰಡΈࠐΈ
    • ैདྷख๏͸࠶ಡΈࠐΈॲཧͰ΋αʔϏεఀࢭʹܨ͕Δ
    29
    ैདྷख๏ͱఏҊख๏ͷىಈ࣌ؒͷ࣮ݧ
    ߲໨ ैདྷख๏ ఏҊख๏
    ϓϩηεىಈͷ࣮࣌ؒ ඵ
    ϓϩηεىಈͷϢʔβ$16࢖༻࣌ؒ ඵ
    ϓϩηεىಈͷγεςϜ$16࢖༻࣌ؒ ඵ

    View full-size slide

  30. 2. ैདྷख๏ͱఏҊख๏ͷੑೳൺֱ࣮ݧ

    View full-size slide

  31. •ैདྷͷࣄલূ໌ॻಡΈࠐΈख๏ͱఏҊख๏ͷTLSϋϯυ
    γΣΠΫ࣌ʹಈతʹಡΈࠐΉख๏(KVSϕʔε)ͱൺֱ
    •ಉ࣌઀ଓ਺ΛมԽͤ͞ͳ͕ΒੑೳΛධՁ
    •nginxʹॳظಉ෧͞Ε͍ͯΔ612Bytesͷindex.html
    •cipher suites͸ECDHE-RSA-AES128-GCM-SHA256
    31
    ఏҊख๏ͷੑೳධՁ

    View full-size slide

  32. ఏҊํࣜͱैདྷํࣜͷੑೳൺֱ
    32
    ಉ࣌઀ଓ਺
    ैདྷํࣜ
    QSFMPBE
    SFRTFD

    ఏҊํࣜ
    EZOBNJDMPBE
    SFRTFD





    $(*ͷΑ͏ͳϓϩηεෳ੡͕ੜ͡ͳ͍ܰྔͳ੩తϑΝΠϧ΁ͷϦΫΤετͰ΋ɺ
    ূ໌ॻͷಈతಡΈࠐΈ͸ैདྷख๏ͷ੩తಡΈࠐΈͱൺֱͯ͠΋΄΅͕ࠩͳ͍

    View full-size slide

  33. 10ສϗετऩ༰࣌ͷ੩తϑΝΠϧͷੑೳൺֱ
    33
    ਺ेCZUFTͷܰྔͳ)5.-ϑΝΠϧ΁ͷϦΫΤετ
    3FRVFTUTFD





    ಉ࣌઀ଓ਺

    ैདྷख๏ ఏҊख๏

    View full-size slide

  34. • TLS΍Ϩεϙϯεੜ੒ॲཧͱൺֱͯ͠ಈతূ໌ॻಡΈࠐΈॲཧ
    ͸࣮༻্໰୊ʹͳΒͳ͍ఔ౓ͷॲཧίετ
    • TLSϋϯυγΣΠΫ࣌ͷ҉߸ɾ෮߸ॲཧͷίετ͕େ͖͍
    34
    ߟ࡯

    View full-size slide

  35. 3. ຊ൪؀ڥͰ࣮ӡ༻্ͷධՁ

    View full-size slide

  36. • ैདྷख๏ͱఏҊख๏ͷ1ϲ݄ؒͷϦιʔε࢖༻ྔΛൺֱ
    • ैདྷख๏͸2017೥3݄͔Β4݄ɺఏҊख๏͸7݄͔Β8݄
    • ෳ਺୆ͷಉҰϋʔυ΢ΣΞ্ʹ4݄຤ΛػʹϦϓϨʔε
    • ैདྷख๏͸Apache2.4ɺఏҊख๏͸nginx1.11Ͱ࣮૷
    • ূ໌ॻ਺ͷ૿Ճ΍ϦΫΤετॲཧ਺ͷมԽͱൺֱ͠ͳ͕Βߟ࡯
    36
    ແྉূ໌ॻαʔϏεΛػʹ࣮ӡ༻্ͷධՁ

    View full-size slide

  37. ຊ൪؀ڥͷఏҊख๏ʹΑΔγεςϜߏ੒֓ཁ
    37
    ఏҊख๏ͷద༻Օॴ

    View full-size slide

  38. ຊ൪؀ڥͷϦόʔεϓϩΩγαʔόͷ࢓༷
    38
    ࢓༷
    $16 *OUFM9FPO&W()[UISFBE
    .FNPSZ (CZUFT
    4FSWFS /&$&YQSFTT&F.
    04 $FOU04

    View full-size slide

  39. 1ϲ݄ؒͷূ໌ॻ਺ͷભҠ
    39
    0
    5000
    10000
    15000
    20000
    25000
    1 6 11 16 21 26 31
    The number of cer-ficates
    day
    The number of cer-ficate in a month
    dynamic load preload
    Θ͔Γʹ͍͕͘Ұϲ݄Ͱ͔Β΁ͱ
    ূ໌ॻఔ౓૿͍͑ͯΔ
    ূ໌ॻ਺͸ϦϓϨʔεલͷഒ͔Βഒ

    View full-size slide

  40. 1ϲ݄ؒͷ1αʔό΁ͷඵؒHTTPϦΫΤετ਺
    40
    0
    200
    400
    600
    800
    1000
    1200
    1400
    1600
    1 6 11 16 21 26 31
    Requests/sec
    day
    Request/sec in a mouth
    dynamic load preload
    ϦϓϨʔεޙʹ-#ͷׂΓ౰ͯൺ཰͕มΘͬͨͨΊ
    )551ʴ)5514ϦΫΤετॲཧ਺͸ഒ͔Βഒ

    View full-size slide

  41. 1ϲ݄ؒͷCPU࢖༻཰ͷભҠ
    41
    0.00
    1.00
    2.00
    3.00
    4.00
    5.00
    6.00
    7.00
    8.00
    9.00
    1 6 11 16 21 26 31
    CPU usage(%)
    day
    CPU usage in a mouth
    dynamic load preload
    ূ໌ॻ਺͕͔Βഒʹ΋ؔΘΒͣ$16࢖༻཰͸ඍ͕ࠩͩ௿ݮ܏޲
    ສূ໌ॻ૿ՃͰ$16͸ఔ౓ඍ૿

    View full-size slide

  42. 1ϲ݄ؒͷϝϞϦ࢖༻཰ͷભҠ
    42
    0
    1000
    2000
    3000
    4000
    5000
    6000
    7000
    8000
    1 6 11 16 21 26 31
    Memory usage(MBytes)
    day
    Memory usage in a mouth
    dycamic load preload
    ূ໌ॻ਺͸͔Βഒʹ΋ؔΘΒͣϝϞϦ࢖༻཰͸௿ݮ
    ఏҊख๏͸ສҎ্૿Ճ͍ͯ͠Δূ໌ॻ਺ʹ΋΄΅ґଘ͍ͯ͠ͳ͍
    ূ໌ॻ਺૿Ճʹ൐͍ϝϞϦ࢖༻ྔ͸αʔόશମͰ(#ZUFTఔ౓૿Ճ

    View full-size slide

  43. • ैདྷख๏(preload)͸1ϗετ௥Ճ͋ͨΓϝϞϦ2.5MBytes૿Ճ
    • 2ສূ໌ॻͷ৔߹͸50GBytesҎ্ͷϝϞϦ͕ඞཁ
    • ϝϞϦ32GbytesͷαʔόͳͷͰैདྷख๏Ͱ͸طʹ௒ա
    • ఏҊख๏͸2ສূ໌ॻΛ௒͑ͯ΋໿3GbytesͰ΄΅Ұఆ
    • ຖ೔ͷreload͕ՄೳʹͳΓͦͷ૊Έ߹ΘͤʹΑ࣮ͬͯݱ
    43
    1ϲ݄ͷ࣮ӡ༻্ͷධՁ͔ΒϝϞϦͷ࢖༻ྔΛߟ࡯

    View full-size slide

  44. • ैདྷख๏͸20ສূ໌ॻΛॲཧ͢Δͷʹ500Gbytesඞཁ
    • 32GBytesͷαʔό͕15୆Ҏ্ඞཁ
    • ఏҊख๏͸20ສূ໌ॻͰ΋1୆ͰॲཧՄೳͷݟࠐΈ
    • 1ɺ2ສূ໌ॻ૿Ճͯ͠΋ϝϞϦ࢖༻ྔ͸3GBytesͰ΄΅Ұ
    ఆɺCPU࢖༻཰͸0.2ʙ0.5%૿Ճఔ౓
    44
    ϝϞϦ࢖༻ྔ͔Βඞཁͳϋʔυ΢ΣΞΛݟੵ΋Γ

    View full-size slide

  45. ఏҊख๏ʹΑΓαʔό୆਺Λ15෼ͷ1΁ͱ
    େ෯ʹ௿ݮՄೳͳݟੵ΋Γ

    View full-size slide

  46. 100෼ͷ1Λ໨ࢦ͢

    View full-size slide

  47. ݕূ͍ͯ͘͠ͱ
    վળ͢ΔՕॴ͕ݟ͖͑ͯͨ

    View full-size slide

  48. • ϝϞϦ࢖༻ྔΛ͞Βʹ௿ݮͤ͞ΔઓུΛͱΔ
    • reloadͷ૊Έ߹ΘͤͰ΋૿ՃྔΛߋʹݮΒͤͨΒޮ཰ԽՄೳ
    • reloadΛ΍Ίͯ·ͣ͸૿ՃྔΛ֬ೝ
    • ͔ͦ͜Βո͍͠ίʔυͱઃఆΛϦϑΝΫλϦϯά͍ͯ͘͠
    • 4ϲ݄ؒͷϝϞϦભҠΛάϥϑԽ…..༧૝֎ʹϦʔΫ͍ͯͨ͠
    49
    ϝϞϦό΢ϯυͷ՝୊Λߋʹվળ͍ͨ͠

    View full-size slide

  49. 50
    0
    5000
    10000
    15000
    20000
    25000
    30000
    2017/07/02-09:00
    2017/07/04-09:00
    2017/07/06-09:00
    2017/07/08-09:00
    2017/07/10-09:00
    2017/07/12-09:00
    2017/07/14-09:00
    2017/07/16-09:00
    2017/07/18-09:00
    2017/07/20-09:00
    2017/07/22-09:00
    2017/07/24-09:00
    2017/07/26-09:00
    2017/07/28-09:00
    2017/07/30-09:00
    2017/08/01-09:00
    2017/08/03-09:00
    2017/08/05-09:00
    2017/08/07-09:00
    2017/08/09-09:00
    2017/08/11-09:00
    2017/08/13-09:00
    2017/08/15-09:00
    2017/08/17-09:00
    2017/08/19-09:00
    2017/08/21-09:00
    2017/08/23-09:00
    2017/08/25-09:00
    2017/08/27-09:00
    2017/08/29-09:00
    2017/08/31-09:00
    2017/09/02-09:00
    2017/09/04-09:00
    2017/09/06-09:00
    2017/09/08-09:00
    2017/09/10-09:00
    2017/09/12-09:00
    2017/09/14-09:00
    2017/09/16-09:00
    2017/09/18-09:00
    2017/09/20-09:00
    2017/09/22-09:00
    2017/09/24-09:00
    2017/09/26-09:00
    2017/09/28-09:00
    2017/09/30-09:00
    2017/10/02-09:00
    2017/10/04-09:00
    2017/10/06-09:00
    2017/10/08-09:00
    2017/10/10-09:00
    2017/10/12-09:00
    2017/10/14-09:00
    2017/10/16-09:00
    2017/10/18-09:00
    2017/10/20-09:00
    2017/10/22-09:00
    2017/10/24-09:00
    2017/10/26-09:00
    2017/10/28-09:00
    2017/10/30-09:00
    2017/11/01-09:00
    Memory Usage [MBytes]
    Day
    Memory Usage for Four Months
    Memory Usage
    ಈతॲཧຖ೔SFMPBE SFMPBEఀࢭத SFMPBEఀࢭத
    ϦϑΝΫλϦϯά
    ສυϝΠϯ)5514Խ
    ສυϝΠϯ)5514Խ
    SFMPBEఀࢭ

    View full-size slide

  50. • ngx_mrubyͷcacheΦϓγϣϯͰϦʔΫ͢Δύλʔϯ͋Δʁ
    • ݱࡏௐࠪதʢҟৗॲཧ࣌ʹϦʔΫ͍ͯ͠Δ͔΋ʣ
    • mruby_setͰ͸ͳ͘mruby_set_codeͳͲʹॻ͖׵͑
    • Ϋϥε΍ϞδϡʔϧΛmrbgemԽͯ͠Ϗϧυ࣌ʹ૊ΈࠐΈ
    • ྫ֎ॲཧ΍ҟৗͳΞΫηε΁ͷΤϥʔॲཧͷݟ௚͠
    51
    ϦϑΝΫλϦϯάͰ΍ͬͨ͜ͱ

    View full-size slide

  51. 52
    0
    5000
    10000
    15000
    20000
    25000
    30000
    2017/07/02-09:00
    2017/07/04-09:00
    2017/07/06-09:00
    2017/07/08-09:00
    2017/07/10-09:00
    2017/07/12-09:00
    2017/07/14-09:00
    2017/07/16-09:00
    2017/07/18-09:00
    2017/07/20-09:00
    2017/07/22-09:00
    2017/07/24-09:00
    2017/07/26-09:00
    2017/07/28-09:00
    2017/07/30-09:00
    2017/08/01-09:00
    2017/08/03-09:00
    2017/08/05-09:00
    2017/08/07-09:00
    2017/08/09-09:00
    2017/08/11-09:00
    2017/08/13-09:00
    2017/08/15-09:00
    2017/08/17-09:00
    2017/08/19-09:00
    2017/08/21-09:00
    2017/08/23-09:00
    2017/08/25-09:00
    2017/08/27-09:00
    2017/08/29-09:00
    2017/08/31-09:00
    2017/09/02-09:00
    2017/09/04-09:00
    2017/09/06-09:00
    2017/09/08-09:00
    2017/09/10-09:00
    2017/09/12-09:00
    2017/09/14-09:00
    2017/09/16-09:00
    2017/09/18-09:00
    2017/09/20-09:00
    2017/09/22-09:00
    2017/09/24-09:00
    2017/09/26-09:00
    2017/09/28-09:00
    2017/09/30-09:00
    2017/10/02-09:00
    2017/10/04-09:00
    2017/10/06-09:00
    2017/10/08-09:00
    2017/10/10-09:00
    2017/10/12-09:00
    2017/10/14-09:00
    2017/10/16-09:00
    2017/10/18-09:00
    2017/10/20-09:00
    2017/10/22-09:00
    2017/10/24-09:00
    2017/10/26-09:00
    2017/10/28-09:00
    2017/10/30-09:00
    2017/11/01-09:00
    Memory Usage [MBytes]
    Day
    Memory Usage for Four Months
    Memory Usage
    ಈతॲཧຖ೔SFMPBE SFMPBEఀࢭத SFMPBEఀࢭத
    ϦϑΝΫλϦϯά
    ສυϝΠϯ)5514Խ
    ສυϝΠϯ)5514Խ
    SFMPBEఀࢭ

    View full-size slide

  52. • ϦϑΝΫλϦϯάલ͸5೔Ͱ10GBఔ౓ϦʔΫ(1೔2GB)
    • ىಈ࣌͸αʔόશମͰϝϞϦ2GB઎༗͠1೔Ͱ2GBϦʔΫ͢
    Δঢ়گΛຖ೔reloadͯ͠ฏۉ3GBͰ҆ఆ͍ͤͯͨ͞
    • ϦʔΫରԠޙ͸5೔Ͱ250MBఔ౓ͷϦʔΫ(1೔50MB)
    • reloadͱ૊Έ߹ΘͤΔͱฏۉ2GBͰ҆ఆͰ͖ΔՄೳੑ͋Γ
    53
    ϦʔΫ໰୊ͷߟ࡯

    View full-size slide

  53. • ैདྷख๏͸200ສυϝΠϯͰ32GBytesαʔό͕150୆ඞཁ
    • ఏҊख๏͸ϝϞϦό΢ϯυͷ؍఺Ͱ1୆ʹऩ·ΔՄೳੑ͋Γ
    • 6ສυϝΠϯ૿ՃͰ1೔50MBͷϝϞϦ૿Ճʹऩ·Δܭࢉ
    • 200ສυϝΠϯͰ1೔2GBͷϝϞϦ૿Ճʹऩ·ΔՄೳੑ͋Γ
    • ϝϞϦҎ֎ͷΦʔόʔϔου͕Ͳ͜ʹग़ͯ͘Δ͔Λਵ࣌ධՁ
    54
    ཧ࿦తʹ΋αʔό୆਺ͷ100෼ͷ1͕ࢹ໺ʹ

    View full-size slide

  54. 7݄͔Β8݄ͷ2ϲ݄ؒͷτϥϑΟοΫมԽ
    55
    ূ໌ॻ਺͸ສ૿Ճ͕ͨ͠ɺ΋ͱ΋ͱ)551ͱ)5514྆ํॲཧ͍ͯ͠ΔͨΊ
    )551ͷυϝΠϯ͕)5514Խ͞Εͯ΋ͦΕ΄Ͳۃ୺ͳӨڹ͸ແ͍ɻ

    View full-size slide

  55. • ߴूੵϚϧνςφϯτํࣜͷେྔূ໌ॻ؅ཧͷఏҊͱධՁ
    • ඞཁͳυϝΠϯͷΈͷಈతূ໌ॻಡΈࠐΈͱαʔόϓϩηε࠶
    ಡΈࠐΈͷ௿଎Խ๷ࢭʹΑΔϝϞϦղ์ͷ૊Έ߹ΘͤͰ࣮ݱ
    • ϋʔυ΢ΣΞίετΛ࡟ݮՄೳ(কདྷతʹ͸200ສυϝΠϯ)
    • ॲཧੑೳʹ΋࣮༻্໰୊ͳ͘ઃఆ൓ө΋ਝ଎ʹՄೳ
    57
    ·ͱΊ

    View full-size slide

  56. • 2017೥11݄Ͱ200ສυϝΠϯத໿7ສυϝΠϯ͕HTTPSԽ
    • ϝϞϦ࢖༻ྔʹج͍ͯreloadΛ࣮ࢪ͢ΔػೳΛ௥Ճ༧ఆ
    • ngx_mrubyࣗମ͕ࣗಈͰ࣮ࢪͰ͖ΔΑ͏ʹ͢Δ
    • reload͠ͳͯ͘΋ఆظతʹূ໌ॻσʔλΛύʔδͤ͞Δػೳ
    • τϥϑΟοΫό΢ϯυʹͳΓͦ͏ͳͷͰͦͷ؍఺Ͱݚڀ։ൃ
    58
    ࠓޙͷ՝୊

    View full-size slide