[Architecting on AWS] Load Balancer

Created
November 17, 2023
Created by
D
DaEun Kim
Tags
AWS
Property

ELB (Elastic Load Balancer)

ALB (Application Load Balancer)

  • application layer (HTTP, HTTPS) ์—์„œ ์ž‘๋™ํ•œ๋‹ค.
  • HTTP ํ—ค๋” ์ •๋ณด๋ฅผ ๊ฐ€์ง€๊ณ  ํŠธ๋ž˜ํ”ฝ์„ ๋ถ„์‚ฐํ•œ๋‹ค. (๋ถ„์‚ฐ ์•Œ๊ณ ๋ฆฌ์ฆ˜์€ ๊ธฐ๋ณธ์ ์œผ๋กœ ๋ผ์šด๋“œ ๋กœ๋นˆ ์‚ฌ์šฉ. ์•Œ๊ณ ๋ฆฌ์ฆ˜์€ target group ์—์„œ ๋ณ€๊ฒฝ ๊ฐ€๋Šฅ.)
  • SSL ์ธ์ฆ์„œ๋ฅผ ํƒ‘์žฌํ•˜์—ฌ ์ปดํ“จํŒ… ๋ฆฌ์†Œ์Šค ๋Œ€์‹ ์— ์š”์ฒญ์˜ ๋ณตํ˜ธํ™” / ์‘๋‹ต์˜ ์•”ํ˜ธํ™”๋ฅผ ์ˆ˜ํ–‰ํ•  ์ˆ˜ ์žˆ๋‹ค.

NLB (Network Load Balancer)

  • transport layer ์—์„œ ์ž‘๋™ํ•œ๋‹ค.
  • HTTP ํ—ค๋”๋ฅผ ํ•ด์„ํ•˜์ง€ ๋ชปํ•˜๊ณ  ํด๋ผ์ด์–ธํŠธ ์•„๋ž˜ ์ •๋ณด๋ฅผ ํ•ด์‹ฑํ•œ ๊ฒฐ๊ณผ๋กœ ํŠธ๋ž˜ํ”ฝ์„ ๋ถ„์‚ฐํ•œ๋‹ค. โ†’ ๋™์ผํ•œ ํด๋ผ์ด์–ธํŠธ์—์„œ ์˜จ ์š”์ฒญ์ด๋ผ๊ณ  ํ•ด๋„ ํด๋ผ์ด์–ธํŠธ์—์„œ ์—ด๋ฆฐ TCP socket ์˜ ํฌํŠธ๋ฒˆํ˜ธ๊ฐ€ ๋‹ฌ๋ผ์ง€๊ธฐ ๋•Œ๋ฌธ์— ๋งค๋ฒˆ ์š”์ฒญ์ด ๋‹ค๋ฅธ target ์œผ๋กœ ๊ฐˆ ์ˆ˜ ์žˆ๋‹ค.
    • ํด๋ผ์ด์–ธํŠธ IP
    • ํด๋ผ์ด์–ธํŠธ์—์„œ ์—ด๋ฆฐ TCP socket ํฌํŠธ๋ฒˆํ˜ธ
    • ๋กœ๋“œ๋ฐธ๋Ÿฐ์„œ IP
    • ๋กœ๋“œ๋ฐธ๋Ÿฐ์„œ์—์„œ ์—ด๋ฆฐ TCP socket ํฌํŠธ๋ฒˆํ˜ธ
    • TCP ํŒจํ‚ท์˜ sequence number
  • ์ง€์—ฐ์‹œ๊ฐ„์ด ALB ์— ๋น„ํ•ด ์งง๋‹ค.
  • internal ์„œ๋น„์Šค๋ฅผ ํด๋ผ์ด์–ธํŠธ๋กœ ํ•˜๋ฉด์„œ ๋Œ€์šฉ๋Ÿ‰ ํŠธ๋ž˜ํ”ฝ ์ฒ˜๋ฆฌ ํ•„์š”ํ•˜๋ฉด NLB ์œผ๋กœ ๋ถ„์‚ฐ์ฒ˜๋ฆฌ..
  • ํƒ€๊ฒŸ์˜ ํ—ฌ์Šค์ฒดํฌ๋ฅผ ํฌํŠธ๋ฒˆํ˜ธ๊ฐ€ ์—ด๋ ค ์žˆ๋Š”์ง€ ํ™•์ธ ํ•˜๋Š” ๋ฐฉ์‹์œผ๋กœ๋งŒ ๊ฐ€๋Šฅ.

Gateway LB

  • network layer ์—์„œ ์ž‘๋™
  • ํŒจํ‚ท ์บก์ณ & ๋ถ„์„์— ์ฃผ๋กœ ์‚ฌ์šฉ

Auto Scaling

auth-scaling ์— ํ•„์š”ํ•œ ๊ฒƒ

  • launch template (ํŠธ๋ž˜ํ”ฝ์ด ๋Š˜์–ด๋‚˜์„œ ์ปดํ“จํŒ… ๋ฆฌ์†Œ์Šค๋ฅผ ์ƒˆ๋กœ ๋งŒ๋“ค์–ด์•ผ ํ•  ๋•Œ ํ…œํ”Œ๋ฆฟ์„ ๊ฐ€์ง€๊ณ  ๋ฆฌ์†Œ์Šค ์ƒ์„ฑ.)