Home /Network/ ๐Ÿ’ฌ Load Balancing
Post
Cancel

/Network/ ๐Ÿ’ฌ Load Balancing



๋กœ๋“œ๋ฐธ๋Ÿฐ์‹ฑ ์•Œ๊ณ ๋ฆฌ์ฆ˜


1. ์ •์  ๋กœ๋“œ ๋ฐธ๋Ÿฐ์‹ฑ


1-1. ๋ผ์šด๋“œ ๋กœ๋นˆ ๋ฐฉ์‹


(Round Robin Method)

  • ํด๋ผ์ด์–ธํŠธ์˜ ์š”์ฒญ์„ ์—ฌ๋Ÿฌ ๋Œ€์˜ ์„œ๋ฒ„์— ์ˆœ์ฐจ์ ์œผ๋กœ ๋ถ„๋ฐฐํ•˜๋Š” ๋ฐฉ์‹
  • ํด๋ผ์ด์–ธํŠธ์˜ ์š”์ฒญ์„ ์ˆœ์„œ๋Œ€๋กœ ๋ถ„๋ฐฐํ•˜๊ธฐ ๋•Œ๋ฌธ์— ์„œ๋ฒ„๋“ค์ด ๋™์ผ ์ŠคํŽ™์„ ๊ฐ€์ง
  • ์„œ๋ฒ„์™€์˜ ์—ฐ๊ฒฐ(์„ธ์…˜)์ด ์˜ค๋ž˜ ์ง€์†๋˜์ง€ ์•Š๋Š” ๊ฒฝ์šฐ ํ™œ์šฉํ•˜๋Š” ๊ณณ์— ์ ํ•ฉ

A, B, C์˜ ์„œ๋ฒ„๋ฅผ ๊ฐ€์ง€๊ณ  ์žˆ์„ ๊ฒฝ์šฐ
A โ†’ B โ†’ C โ†’ A ์ˆœ์„œ๋Œ€๋กœ ์ˆœํšŒํ•œ๋‹ค.


1-2. ๊ฐ€์ค‘์น˜ ๊ธฐ๋ฐ˜ ๋ผ์šด๋“œ ๋กœ๋นˆ ๋ฐฉ์‹


(Weighted Round Robin Method)

  • ๊ฐ๊ฐ์˜ ์„œ๋ฒ„๋งˆ๋‹ค ๊ฐ€์ค‘์น˜(Weight)๋ฅผ ๋งค๊ธฐ๊ณ  ๊ฐ€์ค‘์น˜๊ฐ€ ๋†’์€ ์„œ๋ฒ„์— ํด๋ผ์ด์–ธํŠธ์˜ ์š”์ฒญ์„ ๋จผ์ € ๋ฐฐ๋ถ„
  • ์—ฌ๋Ÿฌ ์„œ๋ฒ„ ์ค‘, ํŠน์ • ์„œ๋ฒ„์˜ ์ŠคํŽ™์ด ๋” ์ข‹์€ ๊ฒฝ์šฐ ํ•ด๋‹น ์„œ๋ฒ„์˜ ๊ฐ€์ค‘์น˜๋ฅผ ๋†’๊ฒŒ ๋งค๊ฒจ ํŠธ๋ž˜ํ”ฝ ์ฒ˜๋ฆฌ๋Ÿ‰์„ ๋Š˜๋ฆด ์ˆ˜ ์žˆ์Œ

์„œ๋ฒ„ A์˜ ๊ฐ€์ค‘์น˜=8, ์„œ๋ฒ„ B์˜ ๊ฐ€์ค‘์น˜=2, ์„œ๋ฒ„ C์˜ ๊ฐ€์ค‘์น˜=3
โ†’ ์„œ๋ฒ„ A์— 8๊ฐœ, ์„œ๋ฒ„ B์— 2๊ฐœ, ์„œ๋ฒ„ C์— 3๊ฐœ์˜ Request๋ฅผ ํ• ๋‹นํ•œ๋‹ค.


1-3.IP ํ•ด์‹œ ๋ฐฉ์‹


(IP Hash Method)

  • ํด๋ผ์ด์–ธํŠธ IP ์ฃผ์†Œ์— ๋Œ€ํ•ด ํ•ด์‹ฑ์ด๋ผ๊ณ  ํ•˜๋Š” ์ˆ˜ํ•™์ ์ธ ๊ณ„์‚ฐ์„ ์ˆ˜ํ–‰
  • ํด๋ผ์ด์–ธํŠธ IP ์ฃผ์†Œ๋ฅผ ์ˆซ์ž๋กœ ๋ณ€ํ™˜ํ•œ ๋‹ค์Œ ๊ฐœ๋ณ„ ์„œ๋ฒ„์— ๋งคํ•‘
  • ์‚ฌ์šฉ์ž IP๋ฅผ ํ•ด์‹ฑํ•˜์—ฌ ๋ถ€ํ•˜๋ฅผ ๋ถ„์‚ฐํ•˜๊ธฐ ๋•Œ๋ฌธ์— ์‚ฌ์šฉ์ž๊ฐ€ ํ•ญ์ƒ ๋™์ผํ•œ ์„œ๋ฒ„๋กœ ์—ฐ๊ฒฐ๋˜๋Š” ๊ฒƒ์„ ๋ณด์žฅ




2. ๋™์  ๋กœ๋“œ ๋ฐธ๋Ÿฐ์‹ฑ


2-1. ์ตœ์†Œ ์—ฐ๊ฒฐ ๋ฐฉ๋ฒ•


(Least Connection Method)

  • ํ™œ์„ฑ ์—ฐ๊ฒฐ์ด ๊ฐ€์žฅ ์ ์€ ์„œ๋ฒ„๋ฅผ ํ™•์ธํ•˜๊ณ  ํ•ด๋‹น ์„œ๋ฒ„๋กœ ํŠธ๋ž˜ํ”ฝ์„ ์ „์†ก
  • ๋ชจ๋“  ์—ฐ๊ฒฐ์— ๋ชจ๋“  ์„œ๋ฒ„์— ๋Œ€ํ•ด ๋™์ผํ•œ ์ฒ˜๋ฆฌ ๋Šฅ๋ ฅ์ด ํ•„์š”ํ•˜๋‹ค๊ณ  ๊ฐ€์ •


2-2.์ตœ์†Œ ์‘๋‹ต ์‹œ๊ฐ„ ๋ฐฉ๋ฒ•


(Least Response Time Method)

  • ์„œ๋ฒ„์˜ ํ˜„์žฌ ์—ฐ๊ฒฐ ์ƒํƒœ์™€ ์‘๋‹ต ์‹œ๊ฐ„์„ ๋ชจ๋‘ ๊ณ ๋ คํ•˜์—ฌ, ๊ฐ€์žฅ ์งง์€ ์‘๋‹ต ์‹œ๊ฐ„์„ ๋ณด๋‚ด๋Š” ์„œ๋ฒ„๋กœ ํŠธ๋ž˜ํ”ฝ์„ ํ• ๋‹น
  • ๊ฐ ์„œ๋ฒ„์˜ ๊ฐ€์šฉ ๊ฐ€๋Šฅํ•œ ๋ฆฌ์†Œ์Šค์™€ ์„ฑ๋Šฅ, ์ฒ˜๋ฆฌ ์ค‘์ธ ๋ฐ์ดํ„ฐ์–‘ ๋“ฑ์ด ์ƒ์ดํ•  ๊ฒฝ์šฐ ์ ํ•ฉ
  • ์กฐ๊ฑด์— ์ž˜ ๋“ค์–ด๋งž๋Š” ์„œ๋ฒ„๊ฐ€ ์žˆ์„ ์‹œ (>) ์—ฌ์œ  ์žˆ๋Š” ์„œ๋ฒ„๋ณด๋‹ค ๋จผ์ € ํ• ๋‹น๋จ
  • ๋ชจ๋“  ์‚ฌ์šฉ์ž์—๊ฒŒ ๋” ๋น ๋ฅธ ์„œ๋น„์Šค๋ฅผ ๋ณด์žฅ







(์ฐธ๊ณ )



๊ณต๋ถ€ํ•œ ๋‚ด์šฉ์„ ์—ฌ๋Ÿฌ๊ธ€๊ณผ ์ฑ… ์ฝ์€ ๋‚ด์šฉ์„ ๋ฐ”ํƒ•์œผ๋กœ ์ •๋ฆฌํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.
์ข‹์€ ๊ธ€๋กœ ์ €์˜ ๊ณต๋ถ€์— ๋„์›€์„ ์ฃผ์‹œ๋Š” ๋ถ„๋“ค๊ป˜ ๊ฐ์‚ฌ๋“œ๋ฆฝ๋‹ˆ๋‹ค.

This post is licensed under CC BY 4.0 by the author.

/Java/ ๐Ÿ’ฌ @Autowired

/Database/ ๐Ÿ’ฌ sqld ์ค€๋น„ 1