๐Ÿ•ธ๏ธ ์„œ๋ฒ„ to ์„œ๋ฒ„ ์š”์ฒญ ์‹œ ๋ฐœ์ƒํ•œ DNS ๋ ˆ์ดํ„ด์‹œ
LG์•ผ ํž˜๋‚ด

๋ฐฐ๊ฒฝ

  • ์•ฝ 200ms ์‘๋‹ต ์†๋„๊ฐ€ ์˜ˆ์ƒ๋˜๋Š” API๊ฐ€ ๋ถˆ๊ทœ์น™์ ์œผ๋กœ 2s๊นŒ์ง€ ์ŠคํŒŒ์ดํฌ๊ฐ€ ๋ฐœ์ƒํ•จ.
    • ํ•ด๋‹น API์—๋Š” ์„œ๋ฒ„ to ์„œ๋ฒ„๋กœ ์š”์ฒญํ•˜๋Š” ๊ธฐ๋Šฅ์ด ์—ฌ๋Ÿฌ ๊ฐœ ํฌํ•จ๋˜์–ด ์žˆ์Œ.
  • ํ™˜๊ฒฝ: On-Premise(IDC) ํ™˜๊ฒฝ์— ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ์„œ๋ฒ„๋Š” ์ปจํ…Œ์ด๋„ˆ๊ฐ€ ์•„๋‹Œ ์Šคํƒ ๋“œ์–ผ๋ก  ํ˜ธ์ŠคํŠธ๋กœ ์‹คํ–‰๋จ.

๋ถ„์„: dig ์œผ๋กœ ํ…Œ์ŠคํŠธ

nameserver 8.8.8.8 ๋กœ ์ง€์ •

dig @8.8.8.8 api.example.com

์ฒซ๋ฒˆ์งธ ์š”์ฒญ 292 msec

;; Query time: 292 msec
;; SERVER: 8.8.8.8#53(8.8.8.8) (UDP)
;; WHEN: Tue Jun 11 11:00:54 KST 2024
;; MSG SIZE  rcvd: 154

2๋ฒˆ์งธ ์š”์ฒญ 36 msec

;; Query time: 36 msec
;; SERVER: 8.8.8.8#53(8.8.8.8) (UDP)
;; WHEN: Tue Jun 11 11:00:57 KST 2024
;; MSG SIZE  rcvd: 154

nameserver๋Š” resolv.conf ์„ค์ •์„ ๋”ฐ๋ฆ„

# /etc/resolv.conf
# LG ๋ฉ”์ธ ๋„ค์ž„ ์„œ๋ฒ„
nameserver 164.124.101.2
# LG ๋ณด์กฐ ๋„ค์ž„ ์„œ๋ฒ„
nameserver 203.248.252.2
dig api.example.com

์ฒซ๋ฒˆ์งธ ์‹œ๋„

;; Query time: 17 msec
;; SERVER: 164.124.101.2#53(164.124.101.2)
;; WHEN: ํ™”  6์›” 11 17:14:45 KST 2024
;; MSG SIZE  rcvd: 154

๋‘๋ฒˆ์งธ ์‹œ๋„: ๊ฐ„ํ—์ ์œผ๋กœ ํŠ€๋Š” ๊ฑธ ํ™•์ธํ•  ์ˆ˜ ์žˆ์—ˆ์Œ.

;; Query time: 230 msec
;; SERVER: 164.124.101.2#53(164.124.101.2)
;; WHEN: ํ™”  6์›” 11 17:25:41 KST 2024
;; MSG SIZE  rcvd: 154

๋น„๊ต

LG DNS๋Š” ์บ์‹œ๊ฐ€ ๋˜๋Š” ๊ฒƒ ๊ฐ™์€๋ฐ 200~300 msec ์‘๋‹ต ์†๋„๊ฐ€ ๋ถˆ๊ทœ์น™์ ์œผ๋กœ ์ž์ฃผ ๋ฐœ์ƒํ•จ. (ํ˜„์žฌ ์„œ๋ฒ„๊ฐ€ ์œ„์น˜ํ•œ IDC ํšŒ์„ ์ด LG๋ผ์„œ LG DNS ์‚ฌ์šฉ)

watch -n 1 "dig @164.124.101.2 api.example.com | grep \"Query time\""
# ;; Query time: 3 msec
# ;; Query time: 227 msec
# ;; Query time: 5 msec
# ;; Query time: 5 msec
# ;; Query time: 4 msec
# ;; Query time: 5 msec
# ;; Query time: 7 msec
# ;; Query time: 228 msec
# ;; Query time: 4 msec
# ;; Query time: 14 msec
# ;; Query time: 3 msec
# ;; Query time: 5 msec
# ;; Query time: 3 msec
# ;; Query time: 10 msec
# ...

8.8.8.8 ์€ ๋” ์‹ฌํ•จ.

watch -n 1 "dig @8.8.8.8 api.example.com | grep \"Query time\""
# ;; Query time: 303 msec
# ;; Query time: 121 msec
# ;; Query time: 342 msec
# ;; Query time: 49 msec
# ;; Query time: 239 msec
# ;; Query time: 305 msec
# ;; Query time: 49 msec
# ;; Query time: 239 msec
# ;; Query time: 129 msec
# ;; Query time: 120 msec
# ;; Query time: 50 msec
# ;; Query time: 39 msec
# ;; Query time: 162 msec
# ;; Query time: 48 msec
# ;; Query time: 37 msec
# ;; Query time: 37 msec
# ;; Query time: 277 msec
# ;; Query time: 173 msec
# ;; Query time: 50 msec
# ;; Query time: 334 msec
# ...

ํ•ด๊ฒฐ: ํ˜ธ์ŠคํŠธ ํŒŒ์ผ ์ˆ˜์ •

server -> L4 Switch -> server๋Š” ํ”„๋ก์‹œ ์—†์ด ์„ค์ •ํ•  ์ˆ˜ ์—†๋‹ค๊ณ  ํ•จ. ์‹ค์ œ๋กœ ํ˜ธ์ŠคํŠธ ํŒŒ์ผ(/etc/hosts)์— ์•„๋ž˜์™€ ๊ฐ™์ด ์„ค์ •ํ•˜๋ฉด Connection๋„ ์–ป์ง€ ๋ชปํ•˜๊ณ  ํƒ€์ž„์•„์›ƒ ๋ฐœ์ƒํ•จ.

# <L4_IP_ADDRESS> api.example.com

์•„๋ž˜์™€ ๊ฐ™์ด ์„ค์ •ํ•ด์„œ ๊ฐ ๋…ธ๋“œ์— ์žˆ๋Š” web server์—์„œ ์„œ๋ฒ„ A, B๋กœ ๋กœ๋“œ ๋ฐธ๋Ÿฐ์‹ฑ ๋˜๋„๋ก ์„ค์ •ํ•จ.

127.0.0.1 api.example.com

Datadog Timeseries

  • ์ฒ˜์Œ์— ์„œ๋ฒ„ A(๋นจ๊ฐ„์ƒ‰) ๋จผ์ € ์ˆ˜์ • ํ›„ ์‘๋‹ต ์†๋„๊ฐ€ ์ค„์–ด๋“  ๊ฒƒ์„ ํ™•์ธํ•จ.
  • ์ดํ›„ ์„œ๋ฒ„ B(์ดˆ๋ก์ƒ‰)๋„ ์ˆ˜์ • ํ›„ ์‘๋‹ต ์†๋„ ์ค„์–ด๋“ฆ.

Last modified on 2024-06-13