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

ECS×スポットインスタンス活用の秘訣

 ECS×スポットインスタンス活用の秘訣

2020/06/10開催された「【オンラインセミナー】「コンテナ × スポットインスタンス」 活用セミナー」(https://aws-seminar.smktg.jp/public/seminar/view/2212)にて発表した資料です

NAVITIME JAPAN

June 10, 2020
Tweet

More Decks by NAVITIME JAPAN

Other Decks in Technology

Transcript

  1. גࣜձࣾφϏλΠϜδϟύϯɹ
    Πϯϑϥάϧʔϓ
    ాத Ұथ

    ECS×εϙοτΠϯελϯε׆༻ͷൿ݃

    View full-size slide

  2. ໊લɿాத Ұथ
    ໾ׂɿCloud Architect
    ܦྺɿ2013೥৽ଔೖࣾɻ2017೥ʙΫϥ΢υܥͷ࡞ۀʹैࣄ
    ޷͖ͳAWSαʔϏεɿCloudFormation, Lambda
    Ωϟϯϓ޷͖ΤϯδχΞ

    View full-size slide

  3. ຊ೔͓࿩͢͠Δ͜ͱ
    • ίϯςφҠߦͷྲྀΕ
    • εϙοτΠϯελϯεͷ׆༻
    • ίϯςφ×εϙοτΠϯελϯεͷϋϚϦϙΠϯτ

    View full-size slide

  4. ձࣾ঺հ
    • גࣜձࣾ φϏλΠϜδϟύϯ
    • ઃཱ 2000 ೥ 3 ݄ 1 ೔
    • ۀ຿಺༰
    • φϏήʔγϣϯαΠτɾΞϓϦͷӡӦ։ൃ
    • ௨৴ΧʔφϏήʔγϣϯࣄۀ
    • ܦ࿏୳ࡧΤϯδϯͷϥΠηϯεࣄۀ ͳͲ
    • ैۀһ਺ ໿ 540 ໊ (ΤϯδχΞ 80% Ҏ্ʣ

    View full-size slide

  5. αʔϏε঺հ
    NAVITIME
    ৐׵NAVITIME
    όεNAVITIME
    ͜ΈΕΆ
    ެڞަ௨ υϥΠϒ
    ΧʔφϏλΠϜ
    υϥΠϒαϙʔλʔ
    τϥοΫΧʔφϏ
    πʔϦϯά
    πʔϦϯάαϙʔλʔ
    ࣗసंNAVITIME
    Travel/Inbound
    JapanTravel
    NAVITIME Transit
    NAVITIME Travel
    Plat
    ϔϧεέΞ
    ALKOO
    PC/SP Web
    όεΧʔφϏ

    View full-size slide

  6. ϏδωεφϏλΠϜ
    ަ௨අਫ਼ࢉύοέʔδ
    ϏδωεφϏλΠϜ
    ಈଶ؅ཧιϦϡʔγϣϯ
    ޿ࠂ/ΞϥΠΞϯε Φ΢ϯυϝσΟΞ
    ަ௨ίϯαϧςΟϯά ిమ/όεࣄۀऀ޲͚
    ιϦϡʔγϣϯ
    API / SDK ςϨϚςΟΫεαʔϏε
    αʔϏε঺հ

    View full-size slide

  7. φϏλΠϜαʔϏεͷߏ੒

    View full-size slide

  8. φϏλΠϜαʔϏεγεςϜߏ੒
    AWS Cloud
    AWS Cloud
    ΞϓϦέʔγϣϯ
    αʔό
    ܦ࿏୳ࡧαʔό
    ֤छDB શจݕࡧDB ֤छDB
    APIαʔό

    View full-size slide

  9. φϏλΠϜαʔϏεγεςϜߏ੒
    AWS Cloud
    AWS Cloud
    ΞϓϦέʔγϣϯ
    αʔό
    ܦ࿏୳ࡧαʔό
    ֤छDB શจݕࡧDB ֤छDB
    APIαʔό

    View full-size slide

  10. ৐׵NAVITIMEͷAWSҠߦ

    View full-size slide

  11. AWSҠߦ
    1. ΦϯϓϨ؀ڥ͔ΒAWS؀ڥ΁ͷҠߦΛݕ౼
    • ൟ๩ظͷΞΫηε਺͕ಡΊͣαʔόௐୡίετͳͲ͕૿Ճ
    • ఱީ౳֎తཁҼʹΑΔಥൃతΞΫηε࣌ʹ͙͢ʹαʔόͷ૿ڧ͕Ͱ͖ͳ͍
    • ᫔᫓ϦεΫ͕೥ʑߴ·Δ

    View full-size slide

  12. AWSҠߦ
    2. AWSҠߦޙͷߏ੒Λݕ౼
    • ݱঢ়ͷΞϓϦέʔγϣϯߏ੒ͷ··ར༻
    • VM Import/ExportΛར༻
    • CLB+EC2ߏ੒
    • ΞϓϦέʔγϣϯΛίϯςφԽ͠ECSΛར༻
    • ׬શʹ৽نߏங
    • ALB+ECSߏ੒

    View full-size slide

  13. AWSҠߦ
    2. AWSҠߦޙͷߏ੒Λݕ౼
    • ݱঢ়ͷΞϓϦέʔγϣϯߏ੒ͷ··ར༻
    • VM Import/ExportΛར༻
    • CLB+EC2ߏ੒
    • ΞϓϦέʔγϣϯΛίϯςφԽ͠ECSΛར༻
    • ׬શʹ৽نߏங
    • ALB+ECSߏ੒
    ɾҠߦίετ͸௿͍
    ɾΦϯϓϨͰͷ՝୊͸ͦͷ··Ҡߦ
    ɾECS͕Α͠ͳʹ΍ͬͯ͘ΕΔ
    ɾଞαʔϏεͷAWSҠߦָ͕ʹͳΔ
    ɾֶशίετ͕ߴ͍

    View full-size slide

  14. AWSҠߦ
    2. AWSҠߦޙͷߏ੒Λݕ౼
    • ݱঢ়ͷΞϓϦέʔγϣϯߏ੒ͷ··ར༻
    • VM Import/ExportΛར༻
    • CLB+EC2ߏ੒
    • ΞϓϦέʔγϣϯΛίϯςφԽ͠ECSΛར༻
    • ׬શʹ৽نߏங
    • ALB+ECSߏ੒
    ɾҠߦίετ͸௿͍
    ɾΦϯϓϨͰͷ՝୊͸ͦͷ··Ҡߦ
    ɾECS͕Α͠ͳʹ΍ͬͯ͘ΕΔ
    ɾଞαʔϏεͷAWSҠߦָ͕ʹͳΔ
    ɾֶशίετ͕ߴ͍

    View full-size slide

  15. AWSҠߦ
    3. ίϯςφͷߏங
    • ݒ೦
    • ͦ΋ͦ΋طଘͷΞϓϦέʔγϣϯ͸ίϯςφ্Ͱಈ͘ͷ͔ʁ
    • ίϯςφԽͨ͜͠ͱͰεϧʔϓοτ͕Լ͕Βͳ͍͔ʁ
    • ΞϓϦέʔγϣϯͷϩά͸Ͳ͏ͨ͠Βʁʁ

    View full-size slide

  16. AWSҠߦ
    3. ίϯςφͷߏங
    • ͦ΋ͦ΋طଘͷΞϓϦέʔγϣϯ͸ίϯςφ্Ͱಈ͘ͷ͔ʁ
    • ͱΓ͋͑ͣߏஙͯ͠ಈ࡞֬ೝ
    • ΞϓϦέʔγϣϯ૚ɿDockerfile + Jenkins
    • Πϯϑϥ૚ɿCloudFormation(ALB+ECS)

    View full-size slide

  17. AWSҠߦ
    3. ίϯςφͷߏங
    • ίϯςφԽͨ͜͠ͱͰεϧʔϓοτ͕Լ͕Βͳ͍͔ʁ
    • JMeterΛ༻͍ͯϩϯάϥϯςετ
    • ݱঢ়ͷΞΫηεϩάΛ༻͍ͨෛՙࢼݧ
    • Ϩεϙϯεʹࠩ෼͕ͳ͍͔ϦάϨογϣϯςετ

    View full-size slide

  18. AWSҠߦ
    3. ίϯςφͷߏங
    • ίϯςφԽͨ͜͠ͱͰεϧʔϓοτ͕Լ͕Βͳ͍͔ʁ
    • JMeterΛ༻͍ͯϩϯάϥϯςετ
    • ݱঢ়ͷΞΫηεϩάΛ༻͍ͨෛՙࢼݧ
    • Ϩεϙϯεʹࠩ෼͕ͳ͍͔ϦάϨογϣϯςετ
    • ࠓ͸Locustͱ͍͏πʔϧΛ࢖ͬͯෛՙࢼݧͱϦάϨογϣϯςετΛ
    ͍ͯ͠·͢(Fargate Spot+CloudMap)

    View full-size slide

  19. AWSҠߦ
    3. ίϯςφͷߏங
    • ΞϓϦέʔγϣϯͷϩά͸Ͳ͏ͨ͠Βʁʁ
    • αΠυΧʔͱͯ͠fluentdͷίϯςφΛىಈ
    • fluentdΛ༻͍ͯίϯςφͷ֎(S3)ʹసૹ͢Δ࢓૊Έͷߏங
    • ΄΅ϦΞϧλΠϜʹS3΁อଘ͢ΔͨΊɺίϯςφ͕མͪͯ΋໰୊ͳ͠

    View full-size slide

  20. AWSҠߦ
    Ҡߦ׬ྃޙ
    • ΞϓϦέʔγϣϯͷΤϥʔ͕සൃ
    • ௨৴தʹίϯςφ͕མͪͯΤϥʔ͕ൃੜ
    • DBͱͷίωΫγϣϯ΍ηογϣϯͳͲΞϓϦέʔγϣϯͷվम
    • Circuit Breakerͷಋೖ
    • ALBͷΤϥʔ͕ଟൃ
    • Πϯελϯε͕ϝϯςφϯε౳Ͱγϟοτμ΢ϯ͞ΕΔͱ͖ʹυϨΠχϯ
    άॲཧ͕͏·͘͞Εͳ͍
    • ASGͷϥΠϑαΠΫϧϑοΫͱLambdaΛ༻͍ͯυϨΠχϯάΛ࣮ࢪ

    View full-size slide

  21. AWSҠߦ
    Ҡߦ׬ྃޙ
    • ݁Ռతʹίετ͕૿Ճ
    • ͜ͷ࣌఺Ͱ͸ΦϯσϚϯυΠϯελϯεͷΈར༻
    • Τϥʔൃੜ࣌ʹ͸ෛՙ෼ࢄͷͨΊεέʔϧΞ΢τͰରԠ
    • Ͳ͏ʹ΋Ͱ͖ͳ͍Τϥʔൃੜ࣌ʹ͸ΦϯϓϨ΁ͷ੾Γ໭͠΋
    • ΦϯϓϨඅ༻+AWSඅ༻(εέʔϧΞ΢τ)Ͱίετ͕૿େ

    View full-size slide

  22. AWSҠߦޙͷར༻අ༻/ΞΫηεਪҠ
    0%
    20%
    40%
    60%
    80%
    100%
    120%
    140%
    コスト⽐率 アクセス⽐率
    AWSҠߦ௚ޙ=100%
    վम/੾Γ໭͠ͳͲͷରԠ

    View full-size slide

  23. 0%
    20%
    40%
    60%
    80%
    100%
    120%
    140%
    コスト⽐率 アクセス⽐率
    AWSҠߦޙͷར༻අ༻/ΞΫηεਪҠ
    εϙοτར༻։࢝
    Φʔτεέʔϧ৚݅ௐ੔
    ϛοΫεΠϯελϯεάϧʔϓ
    ػೳ׆༻
    RIߪೖ

    View full-size slide

  24. 0%
    20%
    40%
    60%
    80%
    100%
    120%
    140%
    コスト⽐率 アクセス⽐率
    AWSҠߦޙͷར༻අ༻/ΞΫηεਪҠ
    εϙοτར༻։࢝
    Φʔτεέʔϧ৚݅ௐ੔
    RIߪೖ
    ϛοΫεΠϯελϯεάϧʔϓ
    ػೳ׆༻

    View full-size slide

  25. εϙοτΠϯελϯεͷར༻

    View full-size slide

  26. EC2ྉۚ
    • ྫʣm5.large(౦ژϦʔδϣϯ)
    ※Ձ֨͸2020/05࣌఺
    On-Demand
    Instances
    $0.124/h
    Spot Instances
    $0.035/h
    Reserved Instances
    (1೥શֹલ෷͍)
    $0.073/h
    Savings Plans
    (1೥શֹલ෷͍)
    $0.073/h
    Scheduled
    Reserved Instances

    View full-size slide

  27. EC2ྉۚ
    • ྫʣm5.large(౦ژϦʔδϣϯ)
    ※Ձ֨͸2020/05࣌఺
    On-Demand
    Instances
    $0.124/h
    Spot Instances
    $0.035/h
    Reserved Instances
    (1೥શֹલ෷͍)
    $0.073/h
    Savings Plans
    (1೥શֹલ෷͍)
    $0.073/h
    Scheduled
    Reserved Instances
    41%OFF
    71%OFF 41%OFF

    View full-size slide

  28. εϙοτΠϯελϯε
    • େ෯ͳ௿ίετʹҾ͖׵͑ϦεΫ͋Γ

    • ೖࡳՁ֨ΑΓࢢ৔Ձ͕֨Լճ͍ͬͯΔؒͷΈར༻Մೳ
    • ࢢ৔Ձ͕֨ೖࡳՁ֨Λ্ճΔͱγϟοτμ΢ϯ͞ΕΔ
    • AWSଆͷ༨৒ΠϯελϯεͰߏ੒
    • ىಈதͰ΋༨৒Πϯελϯε͕ͳ͘ͳΔͱγϟοτμ΢ϯ͞ΕΔ
    • ϦεΫΛ൐͏͕ɺՄೳͳݶΓར༻͍ͨ͠
    • ΦϯσϚϯυΠϯελϯε͸ͳΔ΂͘ར༻͠ͳ͍
    • ΋͠ར༻͢ΔͳΒϦβʔϒυΠϯελϯεΛߪೖ͢Δ

    View full-size slide

  29. εϙοτΠϯελϯε
    • ίϯςφ
    • ϔϧενΣοΫ͕ࣦഊͨ͠ΒམͪΔ
    • མͪͯ΋ECS͕ࣗಈͰίϯςφΛىಈͯ͘͠ΕΔ
    • ಥવམͪͯ΋໰୊ͳ͍Α͏ʹߏ੒ʢϩά΍ΞϓϦέʔγϣϯʣ
    • εϙοτΠϯελϯε
    • AWSଆͷ౎߹Ͱγϟοτμ΢ϯ͞ΕΔ
    • མͪͯ΋AutoScalingGroupΛઃఆ͓͚ͯ͠͹ࣗಈͰىಈͯ͘͠ΕΔ

    View full-size slide

  30. εϙοτΠϯελϯε
    • ίϯςφ
    • ϔϧενΣοΫ͕ࣦഊͨ͠ΒམͪΔ
    • མͪͯ΋ECS͕ࣗಈͰίϯςφΛىಈͯ͘͠ΕΔ
    • ಥવམͪͯ΋໰୊ͳ͍Α͏ʹߏ੒ʢϩά΍ΞϓϦέʔγϣϯʣ
    • εϙοτΠϯελϯε
    • AWSଆͷ౎߹Ͱγϟοτμ΢ϯ͞ΕΔ
    • མͪͯ΋AutoScalingGroupΛઃఆ͓͚ͯ͠͹ࣗಈͰىಈͯ͘͠ΕΔ
    ίϯςφͱεϙοτΠϯελϯεͷ਌࿨ੑ͸ߴ͍ʂ

    View full-size slide

  31. εϙοτΠϯελϯε
    • ίϯςφ
    • ϔϧενΣοΫ͕ࣦഊͨ͠ΒམͪΔ
    • མͪͯ΋ECS͕ࣗಈͰίϯςφΛىಈͯ͘͠ΕΔ
    • ಥવམͪͯ΋໰୊ͳ͍Α͏ʹߏ੒ʢϩά΍ΞϓϦέʔγϣϯʣ
    • εϙοτΠϯελϯε
    • AWSଆͷ౎߹Ͱγϟοτμ΢ϯ͞ΕΔ
    • མͪͯ΋AutoScalingGroupΛઃఆ͓͚ͯ͠͹ࣗಈͰىಈͯ͘͠ΕΔ
    ίϯςφͱεϙοτΠϯελϯεͷ਌࿨ੑ͸ߴ͍ʂ

    View full-size slide

  32. εϙοτΠϯελϯε
    • εϙοτΠϯελϯεͷΈىಈ͢ΔͱશஅͷϦεΫ͕͋Δ
    • ΦϯσϚϯυΠϯελϯεͱεϙοτΠϯελϯεΛฒߦͯ͠ར༻
    • ͨͩ͠ɺεϙοτΠϯελϯεΛ࠷େݶʹར༻͍ͨ͠

    View full-size slide

  33. εϙοτΠϯελϯε
    • εϙοτΠϯελϯεͷΈىಈ͢ΔͱશஅͷϦεΫ͕͋Δ
    • ΦϯσϚϯυΠϯελϯεͱεϙοτΠϯελϯεΛฒߦͯ͠ར༻
    • ͨͩ͠ɺεϙοτΠϯελϯεΛ࠷େݶʹར༻͍ͨ͠
    ϛοΫεΠϯελϯεάϧʔϓػೳͷ׆༻

    View full-size slide

  34. • 1ͭͷASGͰΦϯσϚϯυ/εϙοτΠϯελϯεͷىಈ͕Մೳ
    • ෳ਺ͷΠϯελϯελΠϓ͕ࢦఆՄೳ
    ϛοΫεΠϯελϯεάϧʔϓػೳ
    ΦϯσϚϯυ εϙοτ

    View full-size slide

  35. ϛοΫεΠϯελϯεάϧʔϓػೳ

    View full-size slide

  36. • ΠϯελϯελΠϓ
    • ΦϓγϣϯͷΦϯσϚϯυϕʔε
    • ΦϯσϚϯυׂ߹
    ϛοΫεΠϯελϯεάϧʔϓػೳ

    View full-size slide

  37. ϛοΫεΠϯελϯεάϧʔϓػೳ
    • ΠϯελϯελΠϓ
    • ASG͸ઌ಄͔ΒॱʹىಈΛࢼΈΔ
    • ىಈͯ͠΄͍͠ر๬ॱͰྻڍ
    • ECSͰఆٛͨ͠CPU/ϝϞϦαΠζΑΓ΋େ͖͍΋ͷΛࢦఆ
    • ΠϯελϯελΠϓ͸ͳΔ΂͘ଟ͘ྻڍ
    • ֬อͰ͖ͳ͍Մೳੑ͕͋ΔͨΊ
    • ࠷ۙΑ͘མͪ·͢ɾɾɾ

    View full-size slide

  38. ϛοΫεΠϯελϯεάϧʔϓػೳ
    • Α͘ݕ౼͞ΕΔΠϯελϯελΠϓ
    • ಉ͡ίΞ਺ͷ΋ͷΛෳ਺ੈ୅ฒ΂Δ
    • ྫʣm5.large, c5.large, r5.large, m4.large, c4.large, r4.large

    ※ϝϞϦαΠζ͸࠷௿ݶඞཁͳαΠζͰܾΊΔ
    • ͋·Γ࢖ΘΕͯͳͦ͞͏ͳΠϯελϯελΠϓ΋બͿ
    • ྫʣm5.large, m5d.large, r5.large, m4.large, r4.large

    φϏλΠϜͷΞϓϦέʔγϣϯ͸ɺm5ͱm5dͰύϑΥʔϚϯεʹେ͖ͳ
    ࠩҟ͸Ͱͳ͍ͨΊੵۃతʹར༻

    View full-size slide

  39. ϛοΫεΠϯελϯεάϧʔϓػೳ
    • dܥΠϯελϯε
    • ϗεταʔόʔʹ෺ཧతʹ઀ଓ͞ΕͨΠϯελϯεετϨʔδ෇͖
    • EBSΛར༻ͤͣɺΠϯελϯεετϨʔδΛར༻͢Δ͜ͱͰI/OύϑΥʔϚϯ
    ε޲্ΛਤΔ
    • Πϯελϯεىಈ࣌ʹuserdata಺Ͱॲཧ
    • metadata͔ΒΠϯελϯελΠϓΛऔಘ
    • dܥΠϯελϯεͰ͋Ε͹dockerͷmountσΟϨΫτϦΛΠϯελϯεε
    τϨʔδʹมߋ

    View full-size slide

  40. ϛοΫεΠϯελϯεάϧʔϓػೳ
    ࢀߟ
    ɹuserdata಺Ͱͷॲཧ
    mkdir $DOCKER_MOUNT_DIR
    instance_type=$(curl -H "X-aws-ec2-metadata-token: $(curl -X PUT -H ‘X-aws-ec2-
    metadata-token-ttl-seconds: 10’)" -v http://169.254.169.254/latest/meta-data/instance-type)
    if [[ "${!instance_type}" =~ ^(c5d|m5d|z1d)\.[0-9]{1,}xlarge$ ]]; then
    #z1d,c5d,m5dͷ৔߹͸ϩʔΧϧssdΛར༻
    mkfs.ext4 -I 512 /dev/nvme2n1
    mount /dev/nvme2n1 $DOCKER_MOUNT_DIR
    echo "/dev/nvme2n1 $DOCKER_MOUNT_DIR ext4 defaults 0 0" >>/etc/fstab
    fi

    View full-size slide

  41. ϛοΫεΠϯελϯεάϧʔϓػೳ
    ࢀߟ

    View full-size slide

  42. ϛοΫεΠϯελϯεάϧʔϓػೳ
    • ΦϓγϣϯͷΦϯσϚϯυϕʔε
    • ΦϯσϚϯυΠϯελϯεΛԿ୆ىಈͤ͞Δ͔
    • ΦϯσϚϯυΠϯελϯεΛͳΔ΂͘࢖͍ͨ͘ͳ͍
    • ϦβʔϒυΠϯελϯε(RI)ͷߪೖ਺ͱಉ͡ʹ͢Δ͜ͱͰɺ࣮࣭Φϯσ
    ϚϯυΠϯελϯε0୆

    View full-size slide

  43. • ΦϯσϚϯυׂ߹
    • ΦϯσϚϯυϕʔεΛ௒͑ΔΠϯελϯεͷ͏ͪԿ%ΛΦϯσϚϯυΠϯ
    ελϯεʹ͢Δ͔
    • ྫʣر๬୆਺ɿ10୆
    ϛοΫεΠϯελϯεάϧʔϓػೳ
    ΦϯσϚϯυϕʔε4୆

    View full-size slide

  44. • ΦϯσϚϯυׂ߹
    • ΦϯσϚϯυϕʔεΛ௒͑ΔΠϯελϯεͷ͏ͪԿ%ΛΦϯσϚϯυΠϯ
    ελϯεʹ͢Δ͔
    • ྫʣر๬୆਺ɿ10୆
    • ΦϯσϚϯυϕʔεҎ֎͸͢΂ͯεϙοτʹ͍ͨ͠ͷͰ0%Λࢦఆ
    ϛοΫεΠϯελϯεάϧʔϓػೳ
    ΦϯσϚϯυϕʔε4୆

    View full-size slide

  45. 0%
    20%
    40%
    60%
    80%
    100%
    120%
    140%
    コスト⽐率 アクセス⽐率
    ݁Ռ
    ϛοΫεΠϯελϯεάϧʔϓ
    ػೳ׆༻

    View full-size slide

  46. 0%
    20%
    40%
    60%
    80%
    100%
    120%
    140%
    コスト⽐率 アクセス⽐率
    ݁Ռ
    ΞΫηε਺૿Ճʹର͠ɺίετ͸ݮগ܏޲
    ϛοΫεΠϯελϯεάϧʔϓ
    ػೳ׆༻

    View full-size slide

  47. • ىಈׂ߹
    • ΄΅εϙοτΠϯελϯεͱϦβʔϒυΠϯελϯεͰΧόʔ
    ݁Ռ

    View full-size slide

  48. ݁Ռ
    • εϙοτΠϯελϯεΛར༻࢝͠Ί௚ޙɺ࠶౓ALBͰΤϥʔ͕૿Ճ
    • υϨΠχϯάॲཧ͕͏·͍͍ͬͯ͘ͳ͍
    • εϙοτΠϯελϯε͕γϟοτμ΢ϯ͞ΕΔࡍʹϥΠϑαΠΫϧϑοΫ͕
    ൃՐͤͣʢϥΠϑαΠΫϧϑοΫ͕ൃՐ͢Δࡍʹ͸͢Ͱʹγϟοτμ΢ϯ͞
    Ε͍ͯΔʣ
    • 2෼લʹड͚औΕΔεϙοτΠϯελϯεͷγϟοτμ΢ϯΠϕϯτΛ
    CloudWatchEventͰड͚औͬͯυϨΠχϯάॲཧΛ࣮ࢪ
    • ͨͩ͠ɺݱঢ়͸AWSଆͰ࣮ߦͯ͘͠ΕΔ
    echo ECS_ENABLE_SPOT_INSTANCE_DRAINING=true >> /etc/ecs/ecs.config

    View full-size slide

  49. ݱঢ়ͷ՝୊/ཁ๬

    View full-size slide

  50. ՝୊
    • CapacityProvider͕CloudFormationະରԠ
    • CapacityProviderΛར༻ͤͣʹASGͷ૿ݮʹ߹ΘͤͯɺαʔϏεΛ૿ݮͤ͞
    Δ࢓૊ΈͷߏஙʢASG+Lambdaʣ
    • αʔϏελΠϓͰDAEMONΛબͿͱυϨΠχϯά͕͏·͍͔͘ͳ͍
    • ݪଇREPLICAͰىಈ
    • ARMରԠத…
    • ARMͱAMDΠϯελϯεͷڞଘΛ༧ఆ

    View full-size slide

  51. ཁ๬
    • EC2ΦʔτεέʔϦϯά
    • ΦϯσϚϯυΠϯελϯεͱεϙοτΠϯελϯεͰࢦఆͰ͖ΔΠϯελϯ
    ελΠϓΛ෼͚͍ͨ
    • هࡌͨ͠ΠϯελϯελΠϓͷεϙοτ͕શͯރׇͨ͠ΒΦϯσϚϯυׂ߹
    0%Ͱ΋ΦϯσϚϯυͰىಈ͍ͤͨ͞ʢબ୒͍ͨ͠ʣ

    View full-size slide

  52. ©NAVITIME JAPAN

    View full-size slide