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

少数組織で開発する大規模サービス

 少数組織で開発する大規模サービス

2022/07/21
Developers Summit 2022 Summer

イベントURL :
https://event.shoeisha.jp/devsumi/20220721

TVer Inc.

July 21, 2022
Tweet

More Decks by TVer Inc.

Other Decks in Technology

Transcript

  1. গ਺૊৫Ͱ։ൃ͢Δେن໛αʔϏε גࣜձࣾ TVer / Ճզ وࢤ (SRE) גࣜձࣾ TVer /

    ಺ւ ܙհ (Backend)
 2022/07/21
 Developers Summit 2022 Summer
  2. ϞχλϦϯάͷ࡮৽ Before (ʙ2021೥12݄) ʮNew RelicΛ ยखؒ ͰݟΔͷ͕ͭΒ͍ʂʯ Backend ৘γε Πϯϑϥ

    New Relic पΓͷରԠ New Relic पΓͷରԠ New Relic पΓͷରԠ APIͷ։ൃ Fargateݕূ ෛՙςετ ΞΧ΢ϯτ ઃܭͱ੔උ ίετࢼࢉ ͓Αͼܖ໿ ֤෦ॺ͔Β ͷ໰͍߹Θ ͤରԠ νϡʔχϯά CI/CD੔උ ཁ݅੔ཧ ΞϓϦ΍ϑϩ ϯτΤϯυͱ ͷௐ੔ Πϯϑϥߏங ͱCDKपΓͷ ੔උ
  3. ࠷ۙ ϞχλϦϯάͷ࡮৽ Backend SRE μογϡϘʔυͰ 
 ͜ΜͳϝτϦΫε͕ݟ ͍ͨΜ͚ͩͲʙ ͜ͷ৔߹ʹ͸Ξϥʔτ ඈ͹ͯ͠ཉ͍͠ΑͶ

    ΍Γ͍ͨࣄΛԕྀͤͣʹ૬ஊɾ࣮ݱͰ͖Δମ੍΁ ◦◦ͱ͍͏஋ΛΩʔʹ͠ ͯΤϥʔΛௐ͍ࠪͨ͠ ͱࢥͬͯΔΘ͚Α ΍Γ·͢
  4. ϞχλϦϯάͷ࡮৽ ݱ࣮ • New RelicͷGo Agent(APM)ͷ ಋೖ͕एׯ໘౗ • APMͷΦʔόʔϔου͕ෆ҆ •

    pprofͰྑ͘ͳ͍ʁ • ͍ͬͯ͏͔ࠓඞཁͳΜ͚ͩͬʁ ϦϦʔε·Ͱ͋ͱ2ϲ݄ɾɾɾ
  5. ϞχλϦϯάͷ࡮৽ গ਺૊৫ × New Relic One • ػೳ͕๛෋ͰΦʔϧΠϯϫϯ • ಋೖͷϋʔυϧ͕௿͍

    • υΩϡϝϯτɾαϙʔτɾίϛϡχςΟ͕ॆ࣮ • ͱΓ͋͑ͣಋೖ͢Δ͚ͩͰେ෯ʹՄࢹԽͰ͖Δ ಋೖɾӡ༻ͷίετ͕࠷খݶͰࡁΜͩ
  6. ϑΣʔζʹΑͬͯNew Relicͷ࢖͍෼͚(2ϲ݄લ • ΍Δ΂͖͜ͱ͸όά௵͠ • ओʹར༻ͨ͠ػೳ ◦ Errors Inbox ◦

    Errors ◦ NRQL • 4xx/5xxܥΤϥʔͷ಺༰Λ෼ੳ ◦ 4xx: ΫϥΠΞϯτ͕૝ఆ͍ͯ͠ͳ͍ύϥϝʔλ͕ͳ͍͔ ◦ 5xx: ૝ఆ͍ͯ͠ͳ͍ॲཧ΍λΠϜΞ΢τ͕ͳ͍͔
  7. ϑΣʔζʹΑͬͯNew Relicͷ࢖͍෼͚(1ϲ݄લ • ΍Δ΂͖͜ͱ͸ෛՙࢼݧʹΑΔϘτϧωοΫௐࠪ • ओʹར༻ͨ͠ػೳ ◦ Transactions ◦ Go

    Runtime ◦ CloudWatch Metrics • ߴෛՙ࣌ͷΞϓϦέʔγϣϯશମͷڍಈΛ෼ੳ ◦ TransactionsͰͷSlowest΍95percentileͳͲΛࢦඪʹ ◦ ϝϞϦϦʔΫ΍ɺ์ஔ͞Εͨgoroutineͷଘࡏ ◦ GC AllocationʹΑΔஅଓతͳੑೳྼԽ
  8. ϑΣʔζʹΑͬͯNew Relicͷ࢖͍෼͚(2िؒલ • ΍Δ΂͖͜ͱ͸ཁٻੑೳͷୡ੒ • ओʹར༻ͨ͠ػೳ ◦ Transactions ◦ CloudWatch

    Metrics • શମΛ௨ͨ͠ෛՙࢼݧͰͷ҆ఆύϑΥʔϚϯε ◦ 10msҎ্͔͔ΔAPI ◦ ֤ϛυϧ΢ΣΞ΁ͷΫΤϦ΍઀ଓͷ਺ ◦ ॻ͖ࠐΈܥAPIͰͷLock,Waitͷ෼෍
  9. • Α͋͘ΔಥൃతͳεύΠΫ ◦ ஍্೾࿈ಈ΍์ૹ࿮੾ΕʹΑΔྲྀೖ ▪ 1minޙ͸͖ͬ͞·Ͱͷ10ഒҎ্ͷϦΫΤετ਺ ▪ ૿͑Δಉ࣌઀ଓ ◦ ๭ΞΠυϧࣄ຿ॴλϨϯτ༷ग़ԋ൪૊

    ◦ ϦΞϧλΠϜ഑৴൪૊ऴྃ࣌ ▪ Ϣʔβʔ͕Ұ੪ʹβοϐϯά ▪ ಉظͷͱΕͨ਺ສʙ਺ेສͷϢʔβʔΞΫγϣϯ ύϑΥʔϚϯεɾνϡʔχϯά/ෛՙରࡦ
  10. ·ͱΊ • ແࣄϦϦʔεˍ҆ఆӡ༻͕࢝·ͬͨ🎉 • NewRelicΛ։ൃ؀ڥͰ΋׆༻ ◦ ։ൃ࣌ͷόάτϥοΩϯά ◦ ՝୊؅ཧͱͷ࿈ܞ ◦

    QAνʔϜʹΑΔNewRelicͰͷࣄ࣮ڞ༗ • ։ൃ૊৫ͷϦϑΝΫλϦϯάΛ࢝Ί͍͖ͯ·͢ ◦ ࠓ·Ͱͷ୲຿Λ਺ਓνʔϜͰ୲౰ ◦ ઐ೚νʔϜʹΑΔεϧʔϓοτΛ୲อͨ͠։ൃ૊৫