Skip to content

๐Ÿงช MVP1: ์„œ๋ฒ„ ์ตœ์ ํ™”

KyungMin Lee edited this page Sep 1, 2024 · 1 revision

ํ…Œ์ŠคํŠธ ๊ณ„ํš

  1. ์›๋ณธ ์ƒํƒœ
  2. Connection Pool Size ๋ณ€๊ฒฝ

ํ…Œ์ŠคํŠธ ํ™˜๊ฒฝ

  1. Lambda Test
  2. 10๊ฐœ์˜ Lambda์—์„œ 1000๋ฒˆ ์š”์ฒญ ๋ฐ˜๋ณต

1. ์›๋ณธ์ƒํƒœ

image

๊ฒฐ๊ณผ

  • Hikari Pool Connection Timeout ๋ฐœ์ƒ

์›์ธ ๋ถ„์„

  • htop ํ™œ์šฉ CPU ํŠธ๋ž˜ํ‚น ๊ฒฐ๊ณผ CPU ํ”ผํฌ ํ•œ๋ฒˆ ์ดํ›„ DB ์ปค๋„ฅ์…˜ ๋ถ€์กฑ ๋ฐœ์ƒ
  • RDS ๋ฆฌ์†Œ์Šค๋Š” ์ด์ƒ ์—†์Œ

Hikari Pool Connection ๊ฐฏ์ˆ˜ ๋ถ€์กฑ์œผ๋กœ ๊ฒฐ๋ก 

2. Connection Pool Size ๋ณ€๊ฒฝ

๊ฐœ์„ 

DB Connection ์ˆ˜ ์ฆ๊ฐ€

hikari:
      maximum-pool-size: 20
      minimum-idle: 10
      idle-timeout: 30000
      max-lifetime: 1800000
      connection-timeout: 30000
๊ฐ’
ํ‰๊ท  ์‘๋‹ต ์‹œ๊ฐ„(ms) 40.12268775099935
์ตœ๋Œ€ ์‘๋‹ต ์‹œ๊ฐ„(ms) 682.5488730000216
์ตœ์†Œ ์‘๋‹ต ์‹œ๊ฐ„(ms) 8.207655999984127
image 2

๊ฒฐ๊ณผ

ํ‰๊ท  ์‘๋‹ต ์‹œ๊ฐ„์€ ์ค€์ˆ˜ํ•˜๋‚˜ ์ตœ๋Œ€ ์‘๋‹ต์‹œ๊ฐ„์ด 200ms ์ดˆ๊ณผ๋ผ๋Š” ๋‹จ์  ์กด์žฌ

๊ฐœ์„  ๊ตฌ์ƒ

  1. ๋น„๋™๊ธฐ Bulk Insert ๋„์ž…
  • Bulk Insert๋ฅผ ํ™œ์šฉํ•œ DB ์‘๋‹ต ์ตœ์ ํ™”
  1. Application Local Cache๋ฅผ ํ™œ์šฉํ•œ AppKey ๊ฒ€์‚ฌ
  • AppKey ๊ฒ€์‚ฌ ๊ณผ์ •์—์„œ Cache๋ฅผ ํ™œ์šฉํ•ด DB ์ปค๋„ฅ์…˜ ํ™œ์šฉ ์ตœ์†Œํ™”

๐Ÿงซ ํŒ€ ๋ฌธํ™”

โš™๏ธ ๊ตฌ์„ฑ

๐Ÿ”จ ๊ฐœ๋ฐœ ์œ„ํ‚ค

๐Ÿž Bug Report

๐Ÿงช Test Logs

Clone this wiki locally