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

SRE入門 & チームで取り組んでいるSRE #srefukuoka / introduce-...

SRE入門 & チームで取り組んでいるSRE #srefukuoka / introduce-to-sre

「SRE meetup at Fukuoka #1」での発表資料です
https://sre-fukuoka.connpass.com/event/119041/

Manabu Matsuzaki

March 13, 2019
Tweet

More Decks by Manabu Matsuzaki

Other Decks in Technology

Transcript

  1. About me • Nameɿ Manabu Matsuzaki • Work atɿ LINE

    Fukuoka Corporation • Roleɿ SRE • Twitterɿ @matsumana
  2. GoogleͰ͸ • https://landing.google.com/sre/ SRE is what you get when you

    treat operations as if it’s a software problem. Our mission is to protect, provide for, and progress the software and systems behind all of Google’s public services with an ever-watchful eye on their availability, latency, performance, and capacity. SRE͸ɺӡ༻্ͷ໰୊Λιϑτ΢ΣΞతʹղܾ͢ΔͨΊͷΤϯδχΞϦϯάͰ͢ɻ ࢲͨͪͷ࢖໋͸ɺGoogleͷαʔϏεͷՄ༻ੑɺϨΠςϯγɺύϑΥʔϚϯεɺ ΩϟύγςΟΛ ৗʹ؂ࢹ͠ͳ͕ΒकΓɺਐาͤ͞Δ͜ͱͰ͢ɻ
  3. Ұൠతʹ͸ • https://landing.google.com/sre/sre-book/chapters/introduction/ In general, an SRE team is responsible

    for the availability, latency, performance, efficiency, change management, monitoring, emergency response, and capacity planning of their service(s). ҰൠతʹɺSREνʔϜ͸ɺαʔϏεͷՄ༻ੑɺϨΠςϯγɺ
 ύϑΥʔϚϯεɺޮ཰ੑɺมߋ؅ཧɺϞχλϦϯάɺۓٸରԠɺ
 ΩϟύγςΟϓϥϯχϯάʹ੹೚Λ࣋ͪ·͢ɻ
  4. SRE vs. DevOps: competing standards or close friends? • https://cloud.google.com/blog/products/gcp/sre-vs-devops-

    competing-standards-or-close-friends ͜ͷϒϩάͰ͸ʮclass SRE implements DevOpsʯͱදݱ͞Ε͍ͯ·͢ɻ SRE͸DevOpsͷࢥ૝Λ۩ݱԽͨ͠΋ͷͰ͋ΓɺDevOps΋SREͷཁૉͷҰͭͩͱ ݴ͑Δͱࢥ͍·͢ɻ
  5. ͦͷଞͷαΠτ΋ݟͯΈΔͱ • Google͕ఏএͨ͠ʮSite Reliability EngineeringʢSREʣʯͱ͸
 https://furien.jp/columns/327/ SREʹٻΊΒΕΔਓ෺͸ɺεΩϧ͕ߴ͍ਓͰ͋Δ͜ͱ͕ ଟ͍Ͱ͢ɻୈҰʹΠϯϑϥͷٕज़ɻͦͯ͠ΞϓϦέʔγϣ ϯͷٕज़΋ඞཁʹͳΔ͔ΒͰ͢ɻ •

    APIαʔόͷՄ༻ੑͷҡ࣋ͱ޲্ • APIαʔόͷύϑΥʔϚϯε޲্ • ϛυϧ΢ΣΞͷՄ༻ੑͷҡ࣋ͱ޲্ • ϛυϧ΢ΣΞͷύϑΥʔϚϯε޲্ • ϩάͷऩू • ϩά෼ੳͷج൫ߏஙͱӡ༻ • αʔόɺσϓϩΠ؀ڥͷ੔උ • ։ൃ؀ڥͳͲͷ੔උ • ηΩϡϦςΟͷڧԽ
  6. SREͷۀ຿ൣғ (͜͜·Ͱͷ·ͱΊ) • DevOps • ࣗಈԽɺInfrastructure as CodeɺCI/CDɺetc • αʔϏεΛ҆ఆՔಇ(Մ༻ੑɺύϑΥʔϚϯε)ͤ͞ɺਐาͤ͞Δ

    • Πϯϑϥɺϛυϧ΢ΣΞɺΞϓϦέʔγϣϯ࣮૷ʹؔ͢ΔεΩϧ͕ٻΊΒΕΔ • ϞχλϦϯά • ӡ༻ • ΩϟύγςΟ ϓϥϯχϯά
  7. • Site Reliability Engineering
 Chapter 4 - Service Level Objectives


    https://landing.google.com/sre/sre-book/toc/ • The Site Reliability Workbook
 Chapter 2 - Implementing SLOs, “this is the most important chapter in this book”
 https://landing.google.com/sre/workbook/toc/ • SRE νʔϜͷධՁʹ໾ཱͭϨϕϧผνΣοΫ Ϧετ
 SREͷجຊͱͯ͠ɺ࠷ॳͷ߲໨ͱͯ͠঺հ͞Ε͍ͯΔ
 https://cloudplatform-jp.googleblog.com/2019/02/how-to-start-and-assess-your-sre-journey.html • Google͕ղઆ - ଞࣾͷSRE࣮ફ͸ͳͥޡΓͳͷ͔
 https://www.infoq.com/jp/news/2018/08/google-explains-sre ඇৗʹॏཁͳࣄͱͯ͠ड़΂ΒΕ͍ͯΔ
  8. SLI ͱ SLO • SLI • Service Level Indicator •

    SLO • Service Level Objective • SLIΛϕʔεʹͨ͠αʔϏε৴པੑͷ໨ඪ
  9. WebαʔϏεͰͷSLIͷྫ • AvailabilityʢՄ༻ੑʣ • HTTPϦΫΤετ੒ޭ཰ (successful requests / total requests)

    • ϨΠςϯγ • ͖͍͠஋Λຬͨͨ͠ϦΫΤετͷׂ߹ • Quality • ϑΥʔϧόοΫ͞ΕͨϨεϙϯε • ྫʣ Τϥʔ࣌ʹαʔϏεͷσϑΥϧτը૾΍ݹ͍σʔλΛදࣔ͢ΔɻͳͲ
  10. SLO • ΋͠SLO͕͖͍͠஋ΛԼճͬͨ৔߹ɺϢʔβ͸αʔϏεʹର͢ΔෆຬΛ࣋ͪ ࢝ΊͨΓɺ࢖͏ͷΛ΍ΊΔ͔΋஌Εͳ͍ • SRE workbookͰ͸ɺݱঢ়ͷύϑΥʔϚϯεʹج͍ͮͯઃఆ͢ΔࣄΛ͓͢͢ Ί͍ͯ͠Δ • SLO

    != SLA (service level agreement) • SLA͸ϢʔβͱαʔϏεఏڙऀͷؒͷܖ໿ • ྫ͑͹ɺAWS EC2Ͱ͸݄ؒͷuptime͕SLAΛԼճΔͱͦͷ෼͕ฦۚ͞ΕΔ
  11. SLOΛ100%ʹ͢Δ΂͖͔ʁ • SLO 100%͸ؒҧͬͨ໨ඪ • ྫ͑͹ɺҎԼͷΑ͏ͳࣄ͕ߦ͑ͳ͘ͳΔ • ৽ػೳ௥Ճ • طଘػೳͷվળ

    • ϋʔυ΢ΣΞ΍ϛυϧ΢ΣΞͷϝϯςφϯε • ηΩϡϦςΟύονͷద༻ • SLOΛԼ͛ͯͰ΋ɺ৽ػೳͷϦϦʔεΛ༏ઌ͍ͨ͠৔໘΋͋Δ • ͦ΋ͦ΋ɺ࢖͍ͬͯΔϓϥοτϑΥʔϜͷSLA͕100%Ͱ͸ͳ͍
  12. Error budget • 100% - SLO = Error budget •

    SLO͔Βܭࢉ͞Εͨɺڐ༰Ͱ͖ΔΤϥʔͷׂ߹ • ྫ͑͹ɺ”APIϦΫΤετͷAvailability 99.9%"ΛSLOͱͨ͠৔߹ • Error budget ͸ 0.1% • ݄ؒ300ສϦΫΤετͷαʔϏεͷ৔߹ɺError budget͸3,000
  13. SREͷۀ຿ൣғ (·ͱΊ) • DevOps • ࣗಈԽɺInfrastructure as CodeɺCI/CDɺetc • αʔϏεΛ҆ఆՔಇ(Մ༻ੑɺύϑΥʔϚϯε)ͤ͞ɺਐาͤ͞Δ

    • Πϯϑϥɺϛυϧ΢ΣΞɺΞϓϦέʔγϣϯ࣮૷ʹؔ͢ΔεΩϧ͕ٻΊΒΕΔ • ϞχλϦϯά • ӡ༻ • ΩϟύγςΟ ϓϥϯχϯά • SLO ͱ Error budget
  14. ܞΘ͍ͬͯΔαʔϏε • LINEͷίϯςϯπൢചϓϥοτϑΥʔϜ • LINE DEVELOPER DAY 2018Ͱͷϙελʔηογϣϯࢿྉ
 https://twitter.com/LINE_DEV/status/1073068507707789313 •

    νʔϜߏ੒ • ౦ژɿ ։ൃΤϯδχΞ 10਺ਓ • ෱Ԭɿ ։ൃΤϯδχΞ 10਺ਓ + SRE 1ਓʢSRE΋αʔϏε։ൃνʔϜͷ1ਓʣ • ݩʑαʔϏε։ൃ୲౰ΤϯδχΞ͕SRE΋΍͍͕ͬͯͨɺ
 αʔϏε͕͞Βʹେن໛ɾෳࡶʹͳ͍ͬͯ͘ͳ͔Ͱ2018/07ʹνʔϜ಺ʹSRE role͕৽ઃɻ
 ͦͷλΠϛϯάͰҟಈ
  15. PracticalͳTopic • SLO ͱ Error budget • On-call • νʔϜશһ(։ൃΤϯδχΞ

    + SRE)Ͱ1िؒ͝ͱͷ࣋ͪճΓɻ1st:1ਓ, 2nd:1ਓ • ϙετϞʔςϜ • ϨϙʔτΛॻ͍ͯؔ܎ऀʹڞ༗͠ɺϛʔςΟϯάΛ։࠵
 ʢνʔϜ֎͔Β΋ؔ܎ऀ͕ࢀՃʣ • DevOps
  16. ΑΓTechnicalͳTopic • Monitoring • ΞϓϦέʔγϣϯͷӡ༻ • ϛυϧ΢ΣΞͷӡ༻ • NginxɺElasticsearchͳͲ •

    ΩϟύγςΟ ϓϥϯχϯά • εέʔϧΞοϓɺεέʔϧΞ΢τɺεέʔϧΠϯ • Load test
  17. SLOΛμογϡϘʔυͰՄࢹԽ • ֤ϚΠΫϩαʔϏεͷݱঢ়ʹج͍ͮͯSLOΛઃఆ • SLIͱͯ͠ɺAPIͷAvailabilityͱLatencyͷ2ͭΛ࢖༻ • μογϡϘʔυΛ࡞ͬͯɺνʔϜͷڞ༗Ϟχλʹදࣔ • ࠓޙͷ՝୊ •

    ݄ؒ΍࢛൒ظͳͲͷظؒͰूܭ͍ͨ͠ • ϝτϦΫεͷྔ͕ଟ͗ͯ͢୯७ʹܭࢉͯ͠͠·͏ͱΫΤϦ͕ฦͬͯ͜ͳ͍
 ʢPrometheusͷRecording rulesΛ࢖͑͹ղܾͰ͖ͦ͏ͳؾ͕͍ͯ͠Δʣ • εςʔΫϗϧμʔͱSLOΛڞ༗͠ɺܧଓతʹվળ͍ͯ͘͠