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

仮想化基盤のリソース最適化 / Resource optimization on virtua...

仮想化基盤のリソース最適化 / Resource optimization on virtualization platform

ペパボ・はてな技術大会@福岡の発表資料です。

Taketo Sasaki

July 09, 2016
Tweet

More Decks by Taketo Sasaki

Other Decks in Technology

Transcript

  1. Ծ૝Խαʔόͷߏங@͸ͯͳ • ϋʔυ΢ΣΞϦιʔεͷར༻཰ͷ޲্ • ϩʔϧ͝ͱʹඞཁͳϦιʔε͸
 ͍͍ܾͩͨ·ͬͯΔ • ྫ͑͹ɼ • CPU͕ۭ͍͍ͯΔˠWebαʔό

    • IO͕ۭ͍͍ͯΔˠDBαʔό • ಉډΛආ͚Δ૊Έ߹Θͤ • ෛՙͷߴ͍΋ͷಉ࢜͸ආ͚Δ • ಉ͡༻్ͷ΋ͷ͸ආ͚Δ • ॏཁͳϗετ͸͚͞Δ %PN ϋʔυ΢ΣΞ %PN6 8FCαʔό %PN6 %#αʔό %PN6 Ωϟογϡαʔό
  2. Ծ૝ԽपΓͷΦϖϨʔγϣϯ • Ծ૝ԽपΓͷΦϖϨʔγϣϯ • ৽ن࡞੒ • ෛՙରࡦ • Ҿͬӽ͠ •

    ϋʔυ΢ΣΞނো • ࡟আ • αʔϏεఫୀ • ৽ن࡞੒ɺҾͬӽ͠ͷࡍʹ͸ • DomU࡞੒ઌͷDom0Λબఆ͠ͳ͍ͱ͍͚ͳ͍
  3. ήετ࡞੒࣌ʹؾʹ͔͚Δ͜ͱʢϦιʔεฤʣ • CPU࢖༻཰ɺDiskIOɺফඅిྗΛؾʹ͔͚Δ • ϩʔϧ͸Կͳͷ͔ • ͦͷϩʔϧ͸Ͳͷ͘Β͍ͷϦιʔεΛফඅ͢Δͷ͔ • ϥοΫͷফඅిྗ͸େৎ෉͔ʁ •

    ৑௕ੑΛ࣋ͨͤΔ • ిݯ͕མͪͨ৔߹ • Dom0͝ͱࢮΜͩ৔߹ • εΠον͕ࢮΜͩ৔߹ • ਌ͷϝϞϦͱσΟεΫ༰ྔʹ༨༟͸͋Δ͔
  4. ໰୊ͷ֓ཁ • εϖοΫ͕ܾ·ͬͨDomUΛͲ͜ʹೖΕΔͷ͕࠷ద͔ ˠ૊Έ߹Θͤ࠷దԽ໰୊ʢࠞ߹੔਺ܭը໰୊ʣ %PN ϋʔυ΢ΣΞ $16 .FN /FU %JTL

    %PN ϋʔυ΢ΣΞ $16 .FN /FU %JTL %PN ϋʔυ΢ΣΞ $16 .FN /FU %JTL %PN6 8FCαʔό $16 .FN /FU %JTL %PN6 %#αʔό $16 .FN /FU %JTL %PN6 1SPYZαʔό $16 .FN /FU %JTL … … ʁ ʁ ʁ
  5. ϏϯύοΩϯά໰୊ͷΠϝʔδ ॏ͞ɿ33 ॏ͞ɿ61 ॏ͞ɿ58 ॏ͞ɿ41 ॏ͞ɿ50 ॏ͞ɿ21 ॏ͞ɿ60 ॏ͞ɿ64 ༰ྔɿ120

    ༰ྔɿ120 1 2 3 4 5 6 7 8 1 2 xi,j 2 {0 , 1} 8 i, j yj 2 {0, 1} 8j X j xij = 1 8 i ☓ X i wixij  c 8 j c=120
  6. ϏϯύοΩϯά໰୊ͷఆࣜԽ X i yi xi,j 2 {0 , 1} 8

    i, j yj 2 {0, 1} 8j X j xij = 1 8 i X i wixij  c 8 j xi,j  yj 8 i, j ໨తؔ਺ ม਺ ੍໿ →࠷খԽ͢Δ
  7. DomUׂ౰໰୊ͷΠϝʔδ %PN6 $16 .FN %JTL 1 %PN6 $16 .FN %JTL

    2 %PN6 $16 .FN %JTL 3 %PN6 $16 .FN %JTL 4 %PN6 $16 .FN %JTL 5 %PN6 $16 .FN %JTL 6 %PN $16 .FN %JTL %PN $16 .FN %JTL 1 2 DomU͸Կ୆ඞཁͳͷ͔ʁ
  8. DomUׂ౰໰୊ͷΠϝʔδ %PN6 $16 .FN %JTL 1 %PN6 $16 .FN %JTL

    2 %PN6 $16 .FN %JTL 3 %PN6 $16 .FN %JTL 4 %PN6 $16 .FN %JTL 5 %PN6 $16 .FN %JTL 6 %PN $16 .FN %JTL %PN $16 .FN %JTL 1 2 Xi,j 2 {0, 1} 8i, j Yimemi X j mem0 j Xi,j 8i Yicpui X j cpu0 j Xi,j 8i Yidiski X j disk0 j Xi,j 8i Yi 2 {0, 1}8i ☓ X i Xi,j = 1 8j
  9. ಉډͷ૊Έ߹ΘͤΛߟྀ %PN6 $16 .FN %JTL 1 %PN6 $16 .FN %JTL

    2 %PN6 $16 .FN %JTL 3 %PN6 $16 .FN %JTL 4 %PN6 $16 .FN %JTL 5 %PN6 $16 .FN %JTL 6 %PN $16 .FN %JTL %PN $16 .FN %JTL 1 2 Xi,j 2 {0, 1} 8i, j Yimemi X j mem0 j Xi,j 8i Yicpui X j cpu0 j Xi,j 8i Yidiski X j disk0 j Xi,j 8i Yi 2 {0, 1}8i X j2W ebservers Xi,j  1 8i 8FC 8FC ☓ αʔϏεʹ͍ͭͯ΋ಉ༷ͷ੍໿ͰදݱͰ͖Δ
  10. ࣾ಺ͷӡ༻ࣄ৘Λߟྀ %PN6 $16 .FN %JTL 1 %PN6 $16 .FN %JTL

    2 %PN6 $16 .FN %JTL 3 %PN6 $16 .FN %JTL 4 %PN6 $16 .FN %JTL 5 %PN6 $16 .FN %JTL 6 %PN $16 .FN %JTL %PN $16 .FN %JTL 1 2 Xi,j 2 {0, 1} 8i, j Yimemi X j mem0 j Xi,j 8i Yicpui X j cpu0 j Xi,j 8i Yidiski X j disk0 j Xi,j 8i Yi 2 {0, 1}8i Xi,j = 0 9i, j 1SPYZ ☓ 1SPYZ༻
  11. DomUׂ౰໰୊ͷఆࣜԽ Xi,j 2 {0, 1} 8i, j Yimemi X j

    mem0 j Xi,j 8i Yicpui X j cpu0 j Xi,j 8i Yidiski X j disk0 j Xi,j 8i Yi 2 {0, 1}8i X i Xi,j = 1 8j ໨తؔ਺ ม਺ ੍໿ X i Yi →࠷খԽ͢Δ Yi Xi,j 8i, j X j2W ebservers Xi,j  1 8i Xi,j = 0 9i, j X j2DBservers Xi,j  1 8i ಉډͷ૊Έ߹Θͤ ӡ༻ࣄ৘
  12. ࣮૷ • Python 2.7 • PuLPΛ࢖ͬͨ • શମͷྲྀΕ • DomUͱDom0ͷσʔλΛఆٛ

    • ม਺ͷఆٛʢࠓճ͸2͚ͭͩʣ
 • ໨తؔ਺ͱ੍໿৚݅Λॻ͖Լ͍ͯ͘͠ X = LpVariable.dicts('X', (range(M), range(N)), 0, 1, LpBinary) Y = LpVariable.dicts('Y', range(M), 0, 1, LpBinary) for i in range(M): m += Y[i] * dom0s[i]["mem"] * 0.8 >= lpSum([domus[j]["mem"] * X[i][j] for j in range(N)])
  13. খ͍͞σʔληοτͰݕূ • ن໛ײ • Dom0 73୆ • DomU 284୆ •

    ࣮ߦ࣌ؒ
 21.537sec • ݁Ռ
 ௚ײతʹ͸ਖ਼͍݁͠Ռɺվળͷ༨஍͸͋Δ
  14. ࣮ݱͰ͖Δ͜ͱ • શମͷ഑ஔͷ࠷దԽ • ࠓ·Ͱͷ͸ͬͪ͜ • DCҠసͱ͔͠ͳ͍͔͗Γ͸ग़൪͕ͳ͍ • ཧ૝తͳ഑ஔʹ͠Α͏ͱ͢Δͱॱ൪ʹਓ͕ࢮ͵ •

    ৽ن௥Ճ࣌ͷDom0બఆͷࣗಈԽ • ੍໿͸ͦͷ··࢖͍·ΘͤΔ • DomU͕1୆ • Dom0͕ঢ়ଶΛ΋ͬͨঢ়ଶͰ։࢝
  15. ʢ৽ଔ͕ʣֶੜʹ఻͍͑ͨ͜ͱ • ݚڀྖҬͰ͸༷ʑͳݚڀ͕ͳ͞Ε͍ͯΔ • େ఍ͷ৔߹Ԡ༻ݚڀͷࣄྫͱ͔΋͋Δ • ࠓճѻͬͨ໰୊΋݁ߏݚڀ͞Εͯͨ • ࣮຿ͷݱ৔ͩͱ •

    ۩ମతͳ໰୊ɾधཁͱσʔλ͸͋Δ • ద੾ͳख๏Λબ୒ͯ͠ɺࣗ෼ͷ؀ڥʹద༻Ͱ͖Δྗ • جૅతͳ஌ࣝ͸େࣄ • ঢ়گΛద੾ʹϞσϦϯάͰ͖Δྗ • υϝΠϯಛ༗ͷ஌ࣝΛ׆͔ͯ͠໰୊ղܾ
  16. ׬