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

一休.com における改善事例のご紹介 /ikyu-storage-improvement

kentana20
January 16, 2017

一休.com における改善事例のご紹介 /ikyu-storage-improvement

一休 ✕ bitFlyer コラボイベントでのLT資料です

kentana20

January 16, 2017
Tweet

More Decks by kentana20

Other Decks in Technology

Transcript

  1. Ұٳ.com ʹ͓͚Δ
    ASP.NET։ൃ
    վળࣄྫͷ͝঺հ
    2017.1.16
    Kensuke Tanaka (@kentana20)

    View full-size slide

  2. ͓࿳ͼ
    ॾࣄ৘ʹΑΓλΠτϧͱ಺༰Λ
    มߋ͓ͯ͠࿩͍ͨ͠·͢

    View full-size slide

  3. ΠϕϯτϖʔδΑΓ

    View full-size slide

  4. ࠓ೔ͷ͓࿩
    Ϋϥ΢υҠߦ΁޲͚ͨ
    αʔϏεվળͷࣄྫ
    ʢϑΝΠϧετϨʔδฤʣ

    View full-size slide

  5. About me
    • ాத ݈հ
    • @kentana20
    • 2006೥5݄͔ΒҰٳ

    View full-size slide

  6. Agenda
    • αʔϏε๊͕͍͑ͯͨ՝୊ʢετϨʔδपΓʣ
    • վળ಺༰ͱޮՌ
    • ࠓޙʹ޲͚ͯ
    • ·ͱΊ

    View full-size slide

  7. αʔϏεͷ՝୊
    ʢετϨʔδฤʣ

    View full-size slide

  8. എܠ
    • ҰٳͰ͸ɺ2017೥தʹݱࡏͷΦϯϓϨ؀ڥ͔Β

    Ϋϥ΢υ؀ڥ(AWS)΁ͷҠߦΛ༧ఆ֤ٕͯ͠ज़՝୊

    ʹର͢ΔվળΛਐΊ͍ͯΔ

    View full-size slide

  9. લఏ
    • Ұٳ.com Ͱ࢖༻͍ͯ͠Δը૾͸جຊతʹϗςϧɾ
    ཱྀ͔ؗΒఏڙΛड͚͍ͯΔ

    View full-size slide

  10. 1. ϗςϧɾཱྀؗ޲͚ͷ؅ཧը໘

    ͔ΒΞοϓϩʔυ

    2. ϝʔϧͰ΋Βͬͯࣾ಺ͷσβΠφʔ

    ͕Ճ޻ͯ͠Ξοϓϩʔυ(ϦϦʔε)
    ը૾ͷఏڙύλʔϯ

    View full-size slide

  11. γεςϜ๊͕͍͑ͯͨ
    ՝୊

    View full-size slide

  12. ՝୊
    • ڞ༗ετϨʔδ໰୊
    • ϨϙδτϦσΧ͗͢໰୊

    View full-size slide

  13. ڞ༗ετϨʔδ໰୊
    • ϗςϧɾཱྀ͕ؗΞοϓϩʔυ͢Δը૾
    • ImageMagickͰϦαΠζॲཧ(ಉظॲཧͰ஗͍…)
    • Shared DiskํࣜͰڞ༗ετϨʔδʹ഑ஔ
    • ϗςϧɾཱྀؗ਺૿Ճʹ൐͍ɺڞ༗ετϨʔδͷ

    σΟεΫ༰ྔΛѹഭ & ը૾഑৴༻αʔό΁ͷϦΫΤε
    τ૿Ճ

    View full-size slide

  14. ڞ༗ετϨʔδ໰୊

    View full-size slide

  15. ϨϙδτϦσΧ͗͢໰୊
    • σβΠϯࢿࡐ΋͢΂ͯGit؅ཧ
    • σβΠφʔͱσϓϩΠϑϩʔΛἧ͑ΔͨΊʹ࣮ࢪ
    ͕ͨ͠ɺѱखͩͬͨ
    • ϨϙδτϦαΠζ͕1.5೥Ͱ4ഒʹ
    • clone / fetch / pull ͳͲͷGitૢ࡞͕ඇৗʹॏ͍

    View full-size slide

  16. ϨϙδτϦσΧ͗͢໰୊

    View full-size slide

  17. վળ಺༰ͱޮՌ

    View full-size slide

  18. ڞ༗ετϨʔδΛ΍ΊΔ
    • Ξοϓϩʔυ͢Δը૾ʢσʔλը૾ʣ͸͢΂ͯS3΁

    ഑ஔ͠Shared Nothingͳߏ੒ʹ
    • ϦαΠζॲཧ͸LambdaͰ࣮ࢪ
    • CDNͷOriginΛS3ʹ޲͚ɺը૾഑৴αʔόʹର͢Δ

    ϦΫΤετΛ௿ݮ

    View full-size slide

  19. มߋલͷߏ੒
    ը૾
    ΞοϓϩʔυˍϦαΠζ
    ڞ༻ετϨʔδ
    ը૾ͷOrigin͸
    ը૾഑৴αʔό
    ը૾഑৴༻αʔό
    www.ikyu.com
    cdn.ikyu.com

    View full-size slide

  20. มߋޙͷߏ੒
    ը૾
    Ξοϓϩʔυ
    ϦαΠζॲཧ
    ڞ༻ετϨʔδ
    ͸࢖༻͠ͳ͍
    σʔλը૾ͷ
    Origin͸S3
    Ξηοτը૾ͷ
    Origin͸Ұٳαʔό
    cdn.ikyu.com
    www.ikyu.com

    View full-size slide

  21. σβΠϯࢿࡐͷGit؅ཧΛ΍ΊΔ
    • σβΠφʔ͕Ճ޻ͨ͠ը૾͸S3ʹ௚઀Ξοϓϩʔυ͠ɺ
    Git؅ཧΛ΍ΊΔ
    • ϨϙδτϦʹೖΕΔͷ͸࠷௿ݶͷΞηοτͷΈ
    • Gitͷϩά͸γεςϜมߋͷΈʹ(ਐߦத)

    View full-size slide

  22. มߋલͷӡ༻
    ڞ༻ετϨʔδ
    ը૾഑৴༻αʔό
    Ճ޻ޙը૾Λ
    Commit&Push
    ϦϦʔε
    σβΠφʔ

    View full-size slide

  23. มߋޙͷӡ༻
    Ճ޻ޙը૾Λ
    Ξοϓϩʔυ
    σβΠφʔ
    Gitɺڞ༻ετϨʔδ͸࢖༻͠ͳ͍

    View full-size slide

  24. +αͰ࣮ࢪͨ͠ରԠ
    • Always on SSLʢAOSSLʣ ରԠΛݟਾ͑ͯS3ʹҠߦͨ͠

    ը૾ͷύεΛ͢΂ͯSSLԽʢMixed Contentsରࡦʣ

    View full-size slide

  25. ϋϚͬͨ͜ͱ
    • S3ҠߦʹΑͬͯCase SensitiveʹͳΓɺը૾͕ݟ͑ͳ͍
    • AkamaiଆͰΩϟογϡ͢ΔͱCase Insentiveʹͳͬͯ
    ༨ܭʹ΍΍͔ͬͨ͜͠(AkamaiଆΦϓγϣϯ)
    • ΋ͱ΋ͱΞοϓϩʔυ͞Εͨը૾ͷେจࣈ/খจࣈ͕
    όϥόϥͩͬͨͷͰɺΞοϓϩʔυ࣌ʹ͢΂ͯLower
    CaseΛ͔͚ͯରԠ

    View full-size slide

  26. ޮՌ
    • ڞ༻ετϨʔδ͸ෆཁʹ
    • ը૾Ξοϓϩʔυߴ଎Խˍ҆ఆԽ
    • ը૾഑৴αʔό΁ͷϦΫΤετ͸ܹݮ
    • σβΠφʔͷӡ༻΋γϯϓϧʹ

    View full-size slide

  27. ޮՌ
    • σβΠφʔΑΓ
    • ʮը૾ͷࠩ͠ସ͑ͳͲɺස౓ߴ͘ߦ͏࡞ۀ͕

    ɹεϐʔυΞοϓ͠·ͨ͠ʂʯ
    • ӦۀΞγελϯτΑΓ
    • ʮը૾ͷΞοϓϩʔυ͕ΊͬͪΌૣ͘ͳͬͨʂʯ

    View full-size slide

  28. ࠓޙʹ޲͚ͯ

    View full-size slide

  29. ࠓޙͷରԠʢਐߦதʣ
    • લड़ͷϨϙδτϦܰྔԽ
    • σβΠϯࢿࡐͱͦͷཤྺΛফ͢
    • Ұ෦ͷσβΠϯ࡞ۀΛCMSԽ
    • ϦϦʔεͤͣʹίϯςϯπߋ৽ՄೳͳՕॴΛ૿΍͢

    View full-size slide

  30. σβΠϯ࡞ۀCMSԽ
    • ߴස౓Ͱߋ৽͢Δ޿ࠂ/͓͢͢Ί࿮ͳͲͷ؅ཧ
    • TOPϖʔδͷϩʔςʔγϣϯͳͲΛ

    ผΞϓϦέʔγϣϯͰCMSԽ

    View full-size slide

  31. ͦͷଞͷվળ΋ਐΜͰ͍·͢
    • ϝʔϧ഑৴ج൫ͷSaaSҠߦ
    • όονॲཧج൫RundeckԽ
    • ΞʔΩςΫνϟ࡮৽ɾΞϓϦέʔγϣϯ෼ׂ
    • Ϋϥ΢υҠߦ etc..

    View full-size slide

  32. ͦͷଞͷվળ΋ਐΜͰ͍·͢
    • ϝʔϧ഑৴ج൫ͷSaaSҠߦ
    • όονॲཧج൫RundeckԽ
    • ΞʔΩςΫνϟ࡮৽ɾΞϓϦέʔγϣϯ෼ׂ
    • Ϋϥ΢υҠߦ etc..
    ؾʹͳΔํ͸͜ͷޙͷ

    ύωϧσΟεΧογϣϯ͔࠙਌ձͰ
    ͓࿩͠·͠ΐ͏ʂ

    View full-size slide

  33. ·ͱΊɾॴײ
    • ࡢࠓͰ͸౰ͨΓલͷ࿩
    • σʔλը૾͸ετϨʔδαʔϏε΁
    • ϨϙδτϦ͸γεςϜʹؔΘΔมߋͷΈ
    • ݱߦͷઃܭɾΞʔΩςΫνϟʹҾͬுΒΕͳ͍
    • ͋Δ΂͖͔࢟ΒվળࡦΛߟ͑Δ
    • αʔϏεΛଓ͚Δͱ՝୊͸ग़Δ
    • ܧଓͨ͠վળΛ͜Ε͔Β΋࣮ࢪ

    View full-size slide

  34. ͝੩ௌ

    ͋Γ͕ͱ͏͍͟͝·ͨ͠

    View full-size slide