Loadbalance using internal_elb

C786d7772602b488a7972c38c143f61c?s=47 con_mame
February 18, 2013

Loadbalance using internal_elb

2013/2/18 cookapdで行われたAWS勉強会のスライドです
http://techlife.cookpad.com/2013/01/23/awspad/

C786d7772602b488a7972c38c143f61c?s=128

con_mame

February 18, 2013
Tweet

Transcript

  1. *OUFSOBM&-# Λ࢖ͬͨෛՙ෼ࢄ 13೥2݄18೔݄༵೔

  2. ੕໺๛ !DPO@NBNF ΫοΫύουגࣜձࣾΠϯϑϥετϥΫνϟʔ෦ IUUQEDPONBNF IUUQGBDFCPPLDPNDPONBNF DPONBNF!DPPLQBEDPN 13೥2݄18೔݄༵೔

  3. ޷͖ͳ$%1 $BDIF%JTUSJCVUJPOύλʔϯ 13೥2݄18೔݄༵೔

  4. ޷͖ͳαʔϏε &MBTUJD5SBOTDPEFS IUUQEDPONBNFFOUSZ  13೥2݄18೔݄༵೔

  5. ఏڙ 13೥2݄18೔݄༵೔

  6. 1$ɺϞόΠϧ߹Θͤͯ ݄ؒར༻ऀ਺͸ ສਓҎ্ Ϩγϐ਺ສҎ্ 1$ɺϞόΠϧ߹Θͤͯ 17ԯ݄Ҏ্ 1$TNBSUQIPOFNPCJMF J04"OESPJE 3VCZPO3BJMT ೥݄"84׬શҠߦ

    ೥݄71$Ҡߦ ΠϯελϯεҎ্Քಇ &$&-#$MPVE'SPOU4 (MBDJFS3&*1&/*FUD 13೥2݄18೔݄༵೔
  7. ͱ͜ΖͰ 13೥2݄18೔݄༵೔

  8. *OUFSOBM&-# ஌ͬͯ·͔͢ 13೥2݄18೔݄༵೔

  9. *OUFSOBM&-# ࢖ͬͯ·͔͢ 13೥2݄18೔݄༵೔

  10. ͜Ε 13೥2݄18೔݄༵೔

  11. 71$಺෦༻-PBE#BMBODFS جຊతʹ֎޲͚&-#ͱಉ͡ 71$಺෦ͷΠϯελϯεؒͷ௨৴Λϩʔυ όϥϯε ΞϓϦέʔγϣϯαʔό%# $BDIF ΞϓϦέʔγϣϯαʔό಺෦༻"1* 13೥2݄18೔݄༵೔

  12. %#ͱ͔$BDIFͷ৑௕Խ Ͳ͏ͯ͠·͔͢ʁ 13೥2݄18೔݄༵೔

  13. ΞϓϦέʔγϣϯͷઃఆϑΝΠϧʹෳ਺ αʔόΛฒ΂Δ IBQSPYZͱ͔QSPYZΛ࢖͏ 'MPBUJOH*1QBUUFSO 13೥2݄18೔݄༵೔

  14. ΞϓϦέʔγϣϯͷઃఆʹෳ਺αʔόΛฒ΂Δ αʔό୆਺ଟ͍ͱઃఆͷ഑෍ʹ͕͔͔࣌ؒΔ IBQSPYZͱ͔QSPYZΛ࢖͏ IBQSPYZࣗମͷ৑௕ԽͲ͏͠Α͏ NVMUJDBTU࢖͍ ͍ͨ 1BDFNBLFS IFBSUCFBU $PSPTZOD 'MPBUJOH*1QBUUFSO

    4MBWFܥ ಺෦"1* 13೥2݄18೔݄༵೔
  15. ͦ͜Ͱɺ*OUFSOBM&-# 13೥2݄18೔݄༵೔

  16. 13೥2݄18೔݄༵೔

  17. Λ 13೥2݄18೔݄༵೔

  18. 13೥2݄18೔݄༵೔

  19. ͖ͬ͢Γ 13೥2݄18೔݄༵೔

  20. ϝϦοτ ΞϓϦέʔγϣϯͷઃఆϑΝΠϧʹෳ ਺αʔόΛฒ΂ͳͯ͘΋͍͍ ੾Γ཭͠ɾαʔϏεΠϯ͕खܰ ଞͷϛυϧ΢ΣΞΛ࢖Θͳ͍͍ͯ͘ ؅ཧίετͷܰݮ ίωΫγϣϯͷू໿ .VMUJ"; 13೥2݄18೔݄༵೔

  21. 6TF$BTF 13೥2݄18೔݄༵೔

  22. %# 3306 DB slave 13೥2݄18೔݄༵೔

  23. ஫ҙ &-#ͷϔϧενΣοΫͰɺUDQΛνΣοΫ͍ͯ͠Δ ͱ CMPDLFECFDBVTFPGNBOZDPOOFDUJPOFSSPST NZTRMBENJOqVTIIPTUT NBY@DPOOFDU@FSSPST .Z42-Λ؂ࢹ͢ΔεΫϦϓτΛYJOFUEܦ༝Ͱొ࿥ͯ͠ɺ IUUQͷΑ͏ʹ؂ࢹ ਖ਼ৗͳΒ .Z42-͕ବ໨ͳײ͡ͳΒͱ͔

    13೥2݄18೔݄༵೔
  24. ಺෦"1* 80 API 13೥2݄18೔݄༵೔

  25. $BDIF 22121 twemproxy haproxy 11211 ElastiCache or Memcached / Redis

    on EC2 13೥2݄18೔݄༵೔
  26. 5*14 Protocol: http Port: 80 Path: / 13೥2݄18೔݄༵೔

  27. 5*14 .BTUFS4MBWFQSPDFTT%PXO &/*ͷҠಈ΍&-#͔Βͷ੾Γ཭͠Λߦ͏Α ͏ͳεΫϦϓτΛ௥Ճ .BTUFSͷGBJMPWFSઌΛ&-#഑ԼͷTMBWFʹ &/*ͷҠಈͱ&-# ΞϓϦέʔγϣϯͷઃఆมߋͳ͠ 13೥2݄18೔݄༵೔

  28. .VMUJ"; AZ-a AZ-b application server mail server proxy server mail

    relay server 13೥2݄18೔݄༵೔
  29. .VMUJ"; AZ-a AZ-b application server mail server proxy server mail

    relay server 13೥2݄18೔݄༵೔
  30. .VMUJ"; AZ-a AZ-b application server mail server proxy server mail

    relay server 13೥2݄18೔݄༵೔
  31. .VMUJ"; AZ-a AZ-b application server mail server proxy server mail

    relay server 13೥2݄18೔݄༵೔
  32. .VMUJ"; AZ-a AZ-b application server mail server proxy server mail

    relay server 13೥2݄18೔݄༵೔
  33. 1FSGPSNBODF 13೥2݄18೔݄༵೔

  34. %#ฤ σʔλ਺໿ԯ DPOOFDUJPO ࢼߦճ਺ &-#഑Լʹ୆ͷ.Z42- NYMBSHF connection DIRECT ELB 100

    1897.5 1703.5 200 2075.1 1696.3 300 2286.7 1897.3 400 3098.5 2033.9 500 3255.8 2110.2 600 3341.2 2687.9 700 3923.7 2886.3 800 4812.3 3224.3 qps 0 1250 2500 3750 5000 100 200 300 400 500 600 700 800 DIRECT ELB http:/ /bit.ly/12CetAx 13೥2݄18೔݄༵೔
  35. %#ฤ σʔλ਺໿ԯ DPOOFDUJPO ࢼߦճ਺ &-#഑Լʹ୆ͷ.Z42- NYMBSHF connection DIRECT ELB 100

    1897.5 1703.5 200 2075.1 1696.3 300 2286.7 1897.3 400 3098.5 2033.9 500 3255.8 2110.2 600 3341.2 2687.9 700 3923.7 2886.3 800 4812.3 3224.3 qps 0 1250 2500 3750 5000 100 200 300 400 500 600 700 800 DIRECT ELB 33% http:/ /bit.ly/12CetAx 13೥2݄18೔݄༵೔
  36. &MBTUJ$BDIF UXFNQSPYZฤ σʔλ਺ສ DPOOFDUJPO ࢼߦճ਺ LFZTJ[FCZUFTWBMVFCZUFT UXFNQSPYZ഑Լʹ୆ͷ&MBTUJ$BDIF/PEF DBDIFNMBSHF NMBSHF *OUFSOBM&-#΢ΥʔϜΞοϓແ͠

    13೥2݄18೔݄༵೔
  37. 0" 10000" 20000" 30000" 40000" 50000" 60000" 2" 3" 4"

    Sec$ only$twemproxy$(cmd/sec) twemproxy1" twemproxy2" twemproxy3" twemproxy4" twemproxy0" 3000# 3100# 3200# 3300# 3400# 3500# 3600# 3700# 3800# 3900# 4000# 4100# 4200# 2# 3# 4# Sec$ ELB+twemproxy(cmd/sec) twemproxy2# twemproxy3# twemproxy4# 13೥2݄18೔݄༵೔
  38. 13೥2݄18೔݄༵೔

  39. ྼԽ  TFDͷΞΫηε͕΢ΥʔϜΞοϓແ͠ͷ *OUFSOBM&-#ͷੑೳݶքͰ͸ &-#͸ΞΫηεྔʹԠͯ͡εέʔϧΞοϓ͢Δʂ ࣄલ΢ΥʔϜΞοϓ΋Մೳ IUUQCJUMZ6IMS 13೥2݄18೔݄༵೔

  40. ஫ҙ &-#ͷ*1ΞυϨε͸มΘΔ͜ͱ͕͋Δ %/4ͷ໰͍߹Θͤ݁ՌΛΩϟογϡͨ͠Γɺ IPTUTϑΝΠϧʹॻ͍͓͍ͯͨΓ͢ΔͱΞΫη εͰ͖ͳ͘ͳΔ͜ͱ΋ IBQSPYZͳͲͷىಈ࣌ͷ%/4ͷ݁ՌΛ Ωϟογϡ͢ΔΑ͏ͳ࡞Γʹͳ͍ͬͯΔ΋ ͷ͸ɺ*1ΞυϨεͷมߋΛݕ஌ͤͨ͞Γɺ ఆظతͳSFMPBEΛ 13೥2݄18೔݄༵೔

  41. $PODMVTJPO 13೥2݄18೔݄༵೔

  42. &-#͸উखʹεέʔϧΞοϓ͢Δ͚Ͳ ࣄલͷύϑΥʔϚϯεଌఆ ਺෼ͱ͔Ͱ͸ͳ͘௕࣌ؒτϥϑΟοΫΛྲྀ ͯ͠εέʔϧΞοϓͷঢ়ଶΛݟͨΓ 13೥2݄18೔݄༵೔

  43. &-#͸উखʹεέʔϧΞοϓ͢Δ͚Ͳ ࣄલͷύϑΥʔϚϯεଌఆ ਺෼ͱ͔Ͱ͸ͳ͘௕࣌ؒτϥϑΟοΫΛྲྀ ͯ͠εέʔϧΞοϓͷঢ়ଶΛݟͨΓ     ∧_̲∧   ⊂(#・ω・)  仕様書はない!     /      ノ∪

        し―-‐‑‒J  |l|  |                     ⼈人ペシッ!!                 __                 \    \                      ̄ ̄ 13೥2݄18೔݄༵೔
  44. *OUFSOBM&-#Ͱؾܰʹෛՙ෼ࢄɾ৑௕Խ 'MPBUJOH*1ύλʔϯͱ૊ͷ૊Έ߹ΘͤͰ ָʹ'BJMPWFS &-#ͷ*1ΞυϨεͷมߋʹ͝஫ҙΛʂ 13೥2݄18೔݄༵೔

  45. *NQPSUBOU 13೥2݄18೔݄༵೔

  46. ืूதʂʂ Ұॹʹຖ೔ͷྉཧΛࢧ͑·ͤΜ͔ʁ 13೥2݄18೔݄༵೔

  47. Q and A 13೥2݄18೔݄༵೔