【JAWS-UG大阪&JAWS-UG関西女子会合同企画「AWSのおJAWSな使い方」】ストレージのごっつはまるポイント

 【JAWS-UG大阪&JAWS-UG関西女子会合同企画「AWSのおJAWSな使い方」】ストレージのごっつはまるポイント

2016/7/26【JAWS-UG大阪&JAWS-UG関西女子会合同企画「AWSのおJAWSな使い方」】ストレージのごっつはまるポイント

F0940359a23a1d02661e8715487a729b?s=128

Takayoshi Kobayashi

July 26, 2016
Tweet

Transcript

  1. 2016.7.26 JAWS-UGେࡕˍJAWS-UGؔ੢ঁࢠձ߹ಉاը ʮAWSͷ͓JAWSͳ࢖͍ํʯɹ#jawsug #jawsugkgirls ǏǞȂ✣ǎƑŷƆƇƒơƮdzƺȉǞ ʙ4UPSBHFJTHPUTIBNBSVQPJOUʙ

  2. #jawsug #jawsugkgirls ཬਟ཭἗ ŶƓƧźƂŮƫź  ᇩൔ߶ഠNj✣Ǧ✣ȅ✣DžǏ ǓȀǻ✣ǍǽȉƸ✣ǃǜDžǞ` !LPCB@UBLB ݺŰƍ"84Nj✣ǩǏ $MPVE4FBSDI

     &MBTUJDTFBSDI4FSWJDF   8IPJT
  3. #jawsug #jawsugkgirls ຊ೔ͷϙέϞϯGoঢ়گ • 19:30͔ΒGPS͕ར༻Ͱ͖ͳ͍ঢ়ଶʹ • iPhoneΛ࠶ىಈͯ͠΋վળͤͣ • ॿ͚͍ͯͩ͘͞…

  4. #jawsug #jawsugkgirls ƾȉǕ✣ǭǿƺǐƵᇏྏƎഠ` ǭȃǎƽDžǞƑẹೆ⻎Ὥ`¸୍ᄅଌℭׄ Ọࣘնፘڞ἖༶෻ "1/1SFNJFS$POTVMUJOH1BSUOFS "84Ǝห߄źƂƺȉǜdžȂ✣Ǖ

  5. #jawsug #jawsugkgirls ЧರƒǦǙǟǤƼǥƼƊż

  6. #jawsug #jawsugkgirls ǏǞȂ✣ǎ

  7. #jawsug #jawsugkgirls ǦǙǟǤƼǥƼ€ǏǞȂ✣ǎ

  8. #jawsug #jawsugkgirls ૝૾ͯ͠Έ͍ͯͩ͘͞

  9. #jawsug #jawsugkgirls

  10. #jawsug #jawsugkgirls ŸƉa⇀⻎ƎଢƵМŴŽƎྛŰơźƪũ

  11. #jawsug #jawsugkgirls ЧರƒƇƑǦǙǟǤƼǥƼƵℚࢺźơż &#4€LJ✣Ǐ "VSPSB€LJ✣Ǐ "VSPSB

  12. #jawsug #jawsugkgirls EBSॳظԽ όουέʔε ͦͷ1

  13. #jawsug #jawsugkgirls EBSॳظԽʹ͍ͭͯ͝ଘ஌ͷ͔ͨʁ

  14. #jawsug #jawsugkgirls EBSॳظԽ • ৽͍͠ EBS ϘϦϡʔϜ͸ɺར༻ՄೳʹͳΔͱ͙͢ʹ࠷େͷύϑΥʔ ϚϯεΛൃش͠ɺॳظԽ (Ҏલ͸ࣄલ΢Υʔϛϯάͱݺ͹Ε·ͨ͠) Λඞཁͱ͠·ͤΜɻͨͩ͠ɺεφοϓγϣοτ͔Β෮ݩ͞ΕͨϘ

    ϦϡʔϜͷετϨʔδϒϩοΫ͸ɺΞΫηε͢ΔͨΊʹ͸ࣄલʹॳ ظԽ͢Δඞཁ͕͋Γ·͢ (Amazon S3 ͔Βϓϧμ΢ϯͯ͠ϘϦϡʔ Ϝʹॻ͖ࠐΈ·͢)ɻ
  15. #jawsug #jawsugkgirls έʔε • 14TiBͷEBS(PIOPS)Λར༻ͷϚγϯ • Snapshot͔ΒϦΧόϦ • ϦΧόϦޙ͸i/Oੑೳ͕ஶ͘͠ྼԽ •

    320MB/sఔ౓༧ఆͷI/O͕໿50MB/s • ໿85%ఔ౓ͷI/OੑೳྼԽ
  16. #jawsug #jawsugkgirls ॳظԽରԠ • fio΍ddΛར༻͠શͯͷϒϩοΫΛಡΈࠐΈ fio --filename=/dev/xvdf --bs=4k --direct=1 --ioengine=libaio

    -- clocksource=clock_gettime --randrepeat=0 --iodepth=32 --rw=read: 508k --name=volume-initialize • S3ΑΓॳճ࣌ͷಡΈࠐΈΛ࣮ࢪ
  17. #jawsug #jawsugkgirls • 14TiBΛ50MiB/sͰॳظԽ • 14000000(MiB) / 50(MiB/s) = 280000(s)

    • ໿70࣌ؒఔ౓ඞཁ (280000(s)/3600 = 77.7(h)) • ΄΅3೔͔͔Δܭࢉʹɻɻ ͔͠͠..ʁ
  18. #jawsug #jawsugkgirls ⻻ㅁҦ cƕƂżƬրƇ c 4OBQTIPUŮƬƑἋჭᗥaǦǙDždžǿƼȉǟƊℭᾇƵŮŴƉ䪎Ƣ䴘ơƯơżb c൙భƎсေƍℭᾇƵᾖᄀźƉԚ௹߄Ƶ⻎ീżƮ c ಸਈƎㅁŻƉℭᾇůŮŮƮƂƤa൙భƎсေℭᾇƑίෘƵźƉŭŲ c"DUJWF€"DUJWFƊƑDžǿǏǕἧӮƥॉ⁒żƮ

    c %3Ⴈ๯ƊնŰƍ4OBQTIPUŮƬƑȀǏǞƸ≓ႨƵ㙽ⅯŸƯƉŧƮLJ✣Ǐ c żųƎ*0ůсေƍṳކaDžǿǏǕἧӮƥ㙽Ⅿůсေ
  19. #jawsug #jawsugkgirls Next Bad Case…

  20. #jawsug #jawsugkgirls MBR GPTࣄ݅ όουέʔε ͦͷ2

  21. #jawsug #jawsugkgirls έʔε • WindowsͰϑΝΠϧαʔόʔΛ • 2TiBఔ౓Ͱӡ༻ • ༰ྔ͕ރׇ͖ͯͨ͠ •

    EBSͳΒ༰қʹ֦ுͰ͖..
  22. #jawsug #jawsugkgirls ͓΍‥ʁ • 2TiBҎ্͕ೝࣝ͞Εͳ͍ • ֦ுखॱ͸ؒҧ͍ͬͯͳ͍ • ·͔͞..

  23. #jawsug #jawsugkgirls MBR / GPT • σΟεΫͷϑΥʔϚοτ࣌ʹࢦఆ͢Δܗࣜ • Windows ServerͰ͸EC2configͷڍಈͰ2TiBҎԼͷEBS

    ʹ͍ͭͯ͸ɺMBRϑΥʔϚοτͰࣗಈతʹϚ΢ϯτ • EC2࡞੒࣌ʹAttachͨ͠EBSͰ༰ྔ2TiBҎԼͷEBS͕ର৅
  24. #jawsug #jawsugkgirls ରԠࡦ • EC2configͷڍಈͷͨΊɺEC2 launch࣌ʹ͸֦ு σΟεΫ͸Attach͠ͳ͍ • EC2ىಈޙɺEBSΛ௥ՃAttach͠ɺGPTͰϑΥʔ ϚοτΛ࣮ࢪ͢Δ

  25. #jawsug #jawsugkgirls Next Bad Case..

  26. #jawsug #jawsugkgirls Aurora ΠϯελϯεετϨʔδރׇࣄ݅ όουέʔε ͦͷ3

  27. #jawsug #jawsugkgirls "VSPSBƑȂǏdzȉǏůㆮŧ c ᇷźŲ"VSPSBƑȂǏdzȉǏůㆮŧ c ࢤ䌺ƾǿ✣ů₹㻂 c ᄜఏọٳųƬŧ䌂ἾźƉƥBWBJMBCMFƎƍƬƍŧ

  28. #jawsug #jawsugkgirls ݪҼ • AuroraͷϞχλϦϯάΛ֬ೝ͢Δͱ • Free Local Storage͕ރׇ͍ͯ͠Δ •

    AuroraͬͯσΟεΫ͕ࣗಈ֦ுͰ͸.. • Free Local Storageͱ͸..
  29. #jawsug #jawsugkgirls Aurora Free Local Storage • ΠϯελϯελΠϓ͝ͱʹ༻ҙ͞Ε͍ͯΔΠϯελϯεετϨʔδ • ༰ྔ͸ΠϯελϯελΠϓʹԠͯ͡ҟͳΔ

    • ࣗಈ֦ு͠ͳ͍ • tableྖҬͷͨΊɺඪ४Ͱ͸general log΍slow query͕อଘର৅
  30. #jawsug #jawsugkgirls ⻻ㅁҦ • log_output = TABLE Ͱར༻͍ͯ͠Δ৔߹ɺgeneral logɺslow query

    ͷอଘظؒͷ੍ݶ͕ͳ͍ • ݱঢ়ɺϩʔςʔτΛ࣮ࢪ͢Δํ๏͕ͳ͍ঢ়ଶ • ͜ͷڍಈ͸কདྷमਖ਼༧ఆͱͷ͜ͱ ※2016೥7݄ݱࡏ • ϩάग़ྗΛ࣮ࢪ͢Δࡍ͸log_output = FILEʹมߋ
  31. #jawsug #jawsugkgirls ·ͱΊ • AWSͷετϨʔδ͸ศར • গ͠ϋϚϦϙΠϯτ͕͋Δ • ϋϚͬͯ͸͡Ίͯ෼͔Δ͜ͱ΋ •

    όουϊ΢ϋ΢ΛͲΜͲΜڞ༗͠Α͏
  32. #jawsug #jawsugkgirls ťƭůƋũŷŹŧơźƂĆ