-
Notifications
You must be signed in to change notification settings - Fork 0
๐Docs: README ์คํ ๊ฒฐ๊ณผ ์ค๋ช ์์ #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,20 @@ | ||
| # [์ฑ๋ฅ ๊ฐ์ ๋ณด๊ณ ์] ํ ํ๋ฉด API ๋จ๊ณ๋ณ ์ต์ ํ ๋ฐ 1,000 VUs ๊ฐ์ฉ์ฑ ๊ฒ์ฆ | ||
| # ๐พ UMC 7th FarmON BackEnd | ||
|  | ||
| **๋์ ์ ์ฐ๊ฒฐ ๊ณ ๋ฆฌ** **FarmON**์ UMC 7๊ธฐ์์ ์งํ๋ ํ๋ก์ ํธ ๋ฐ ๋์ ์ ํ์ ์ ์ด๋๋ ๋์งํธ ์๋ฃจ์ ์ผ๋ก, <br> | ||
| **๋์งํธ ์ปค๋ฎค๋ํฐ**๋ฅผ ํตํด ์๊ท๋ชจ ์์ธ๋์ ์ **๊ณต๋๋์ ์ ํ์ฑํ**ํ๊ณ , ํ๋ซํผ์ ํ์ฉํ์ฌ **์ ๊ตญ์ ๋์ ์ ๋ฌธ๊ฐ๋ฅผ ์ฐ๊ฒฐ**ํ๋ฉฐ, **๋์ ๋ฐ์ดํฐ**๋ฅผ ๊ธฐ๋ฐ์ผ๋ก **์ฒด๊ณ์ ์ธ ๋์ ์๋น์ค**๋ฅผ ์ ๊ณตํฉ๋๋ค. | ||
|
|
||
| ๋ณธ ๋ณด๊ณ ์๋ ํ ํ๋ฉด์ ์ปค๋ฎค๋ํฐ ๊ฒ์๊ธ ์กฐํ API๋ฅผ ๋์์ผ๋ก, ์ด๊ธฐ ์ฑ๋ฅ ์ธก์ ๋ถํฐ ๋ก์ง/์ธํ๋ผ/์ํคํ ์ฒ ์ต์ ํ์ ๋ฐ๋ฅธ ์์คํ ์๊ณ์น ๋ณํ๋ฅผ ์ ๋์ ์ผ๋ก ๋ถ์ํ ๊ธฐ๋ก์ ๋๋ค. | ||
| | ||
| # ๐ ๋ถํ ํ ์คํธ ๋ฐ ์ฑ๋ฅ ์ต์ ํ | ||
| ## ํ ํ๋ฉด API ๋จ๊ณ๋ณ ์ต์ ํ ๋ฐ ๋์ ์ฌ์ฉ์ 1,000 VUs ๊ฐ์ฉ์ฑ ๊ฒ์ฆ | ||
|
|
||
| --- | ||
| ๋ณธ ๋ฌธ์๋ ํ ํ๋ฉด ์ปค๋ฎค๋ํฐ ๊ฒ์๊ธ ์กฐํ API๋ฅผ ๋์์ผ๋ก k6๋ฅผ ํ์ฉํด **๋์ ์ฌ์ฉ์ 1,000๋ช ๊ท๋ชจ์ ๋ถํ ํ ์คํธ**๋ฅผ ์ํํ๊ณ , | ||
| Prometheus์ Grafana๋ฅผ ํตํด ์ฃผ์ ์ฑ๋ฅ ์งํ๋ฅผ ๋ชจ๋ํฐ๋งํ๋ฉฐ **์์คํ ์ ์ฑ๋ฅ ํ๊ณ**์ **๋ณ๋ชฉ ์ง์ **์ ๋ถ์ํ์ฌ ๊ฐ์ ํ ๊ณผ์ ์ ์ ๋ฆฌํ์ต๋๋ค. | ||
|
|
||
| ## 1. ์คํ ๊ฐ์ ๋ฐ ํ๊ฒฝ | ||
|
|
||
| ### 1.1 ์คํ ํ๊ฒฝ ๋ฐ ์๋๋ฆฌ์ค | ||
| - **ํ ์คํธ ๋๊ตฌ**: k6 (ramping-vus) | ||
| - **ํ ์คํธ ์๋๋ฆฌ์ค**: 32๋ถ๊ฐ ๊ฐ์ ์ฌ์ฉ์(VU)๋ฅผ 1์์ 1,000๊น์ง 13๋จ๊ณ์ ๊ฑธ์ณ ์ ์ง์ ์ฆ๊ฐ | ||
| - **ํ ์คํธ ์๋๋ฆฌ์ค**: 32๋ถ๊ฐ ๊ฐ์ ์ฌ์ฉ์(VU)๋ฅผ 1 -> 1,000๊น์ง 13๋จ๊ณ์ ๊ฑธ์ณ ์ ์ง์ ์ฆ๊ฐ | ||
| - **๋์ API**: ํ ํ๋ฉด ์นดํ ๊ณ ๋ฆฌ๋ณ ๊ฒ์๋ฌผ ์ ๋ณด ๋ฐํ API (์ข์์/๋๊ธ ์ ํฌํจ) | ||
| - **๋ชจ๋ํฐ๋ง**: Prometheus, Grafana | ||
| - **๋ฐฑ์๋**: Spring Boot(3.0.0), Java(17) | ||
|
|
@@ -34,6 +40,8 @@ | |
|
|
||
| <img width="1280" height="675" alt="v1_result_1" src="https://github.com/user-attachments/assets/d045e6f8-4323-4782-acf0-0a24ae35b3da" /> | ||
| <img width="1280" height="989" alt="v1_result_2" src="https://github.com/user-attachments/assets/4ea13c6b-080b-4892-b88d-4475ffbbf03f" /> | ||
| <img width="1280" height="851" alt="image" src="https://github.com/user-attachments/assets/1f1e09a6-9b11-4819-97f3-fdd3c2a5b437" /> | ||
|
|
||
|
|
||
| ### 2.2 ์คํ ๊ฒฐ๊ณผ (1,000 VUs) | ||
| | ์งํ ํญ๋ชฉ | ์ธก์ ๊ฒฐ๊ณผ | ํ์ ๋ฐ ์๋ฏธ | | ||
|
|
@@ -47,7 +55,7 @@ | |
|
|
||
| ## 3. [v2] 1์ฐจ ๊ฐ์ : QueryDSL ๊ธฐ๋ฐ ๋จ์ผ ์กฐํ (N+1 ์ ๊ฑฐ) | ||
|
|
||
| ### โ ๋ณ๊ฒฝ ์ฌํญ (What was changed?) | ||
| ### โ ๋ณ๊ฒฝ ์ฌํญ | ||
| - **์ฟผ๋ฆฌ ํตํฉ**: QueryDSL์ ์ด์ฉํด `JOIN` ๋ฐ `GROUP BY`๋ฅผ ํ์ฉํ **๋จ์ผ ์ง๊ณ ์ฟผ๋ฆฌ**๋ก ๋ฆฌํฉํ ๋ง | ||
| - **์ต์ ํ ๊ธฐ๋ฒ**: `COUNT(DISTINCT ...)`๋ฅผ ์ ์ฉํ์ฌ ์กฐ์ธ ์ ์ค๋ณต ์ง๊ณ ๋ฐฉ์ง | ||
| - **DTO Projection**: Entity ๋์ ์กฐํ ์ ์ฉ DTO(**HomePostRow**)๋ฅผ ์ฌ์ฉํ์ฌ ์์์ฑ ์ปจํ ์คํธ ๋ถํ ์ ๊ฐ | ||
|
|
@@ -59,6 +67,8 @@ | |
|
|
||
| <img width="1280" height="716" alt="v2_result_1" src="https://github.com/user-attachments/assets/23708d85-d470-4123-b3c8-b7e1b36b4a21" /> | ||
| <img width="1280" height="933" alt="v2_result_2" src="https://github.com/user-attachments/assets/914a33b3-17ee-44ec-b4be-3f14a6f38450" /> | ||
| <img width="1280" height="336" alt="image" src="https://github.com/user-attachments/assets/c6ed97a4-3618-4b71-a6a4-e46e9ce719a3" /> | ||
|
|
||
|
|
||
| ### 3.2 ์ฑ๋ฅ ์งํ ๋น๊ต (v1 vs v2) | ||
| | ์งํ ํญ๋ชฉ | v1 (Baseline) | v2 (๋ก์ง ์ต์ ํ) | ์ฑ๊ณผ | | ||
|
|
@@ -71,7 +81,7 @@ | |
|
|
||
| ## 4. [v3] 2์ฐจ ๊ฐ์ : ์ธํ๋ผ ์ค์ ์ต์ ํ (WAS/DB ํ๋) | ||
|
|
||
| ### โ ๋ณ๊ฒฝ ์ฌํญ (What was changed?) | ||
| ### โ ๋ณ๊ฒฝ ์ฌํญ | ||
| - **HikariCP**: `maximum-pool-size: 30`, `connection-timeout: 30000` (์ปค๋ฅ์ ๋ถ์กฑ ํด์) | ||
| - **Tomcat**: `threads.max: 400`, `max-connections: 8192` (๋์ ์์ฒญ ์์ฉ๋ ์ฆ๋) | ||
| - **RDS**: DB ํ๋ผ๋ฏธํฐ ๊ทธ๋ฃน ์์ ์ ํตํด `max_connections: 300` ํ๋ณด | ||
|
|
@@ -82,13 +92,14 @@ | |
| - **โข [๋ฌผ๋ฆฌ ์๊ณ์ ์๋ณ]**: ์ค์ ์ ํ์ฅํ์์๋ p(95)๊ฐ **3.30s**์์ ์ ์ฒด๋จ. ํ์ฌ ๊ตฌ์กฐ์ **๋ฌผ๋ฆฌ์ Disk I/O ํฌํ**๋ก ํ๋จ๋จ. | ||
|
|
||
| <img width="1280" height="717" alt="v3_result_1" src="https://github.com/user-attachments/assets/cc0ab432-26e8-43e1-b355-80ed0748dd11" /> | ||
| <img width="1280" height="915" alt="image" src="https://github.com/user-attachments/assets/a4ac54aa-83a8-4295-8f7f-ce8b78b7de56" /> | ||
| <img width="1280" height="322" alt="v3_result_3" src="https://github.com/user-attachments/assets/08322a78-6dff-40aa-8f83-371ab8de1951" /> | ||
|
|
||
| --- | ||
|
|
||
| ## 5. [v4] ๊ฐ์ : Redis ์บ์ ๋์ (In-memory ์ํคํ ์ฒ) | ||
|
|
||
| ### โ ๋ณ๊ฒฝ ์ฌํญ (What was changed?) | ||
| ### โ ๋ณ๊ฒฝ ์ฌํญ | ||
| - **์บ์ฑ ์ ๋ต**: ํ ์ปค๋ฎค๋ํฐ ๋ฐ์ดํฐ๋ฅผ `category:{PostType}` ํค ๊ตฌ์กฐ๋ก **Redis**์ ์ ์ฅ (In-memory) | ||
| - **์ ํจ ์ ์ฑ **: `TTL 60์ด` ์ ์ฉ ๋ฐ ์ข์์/๋๊ธ ๋ณ๊ฒฝ ์ `afterCommit` ์์ ์ **์ ํ์ ์บ์ ๋ฌดํจํ(Evict)** | ||
| - **์ง๋ ฌํ**: `GenericJackson2JsonRedisSerializer`๋ฅผ ํตํ DTO ์ง๋ ฌํ | ||
|
|
@@ -99,7 +110,9 @@ | |
| - **โข [์์ ์ฑ ์ ์ง]**: ์ด ์์ฒญ ์ **77.3๋ง ๊ฑด**์ผ๋ก ํญ์ฆํ์ผ๋, ์๋ฌ์จ **0.009%**๋ก ์ ๋ขฐ์ฑ ์๋ ์๋ต ์ ์ง. | ||
|
|
||
| <img width="1280" height="706" alt="v4_result_1" src="https://github.com/user-attachments/assets/560b66db-4e21-47fa-bfdc-7e07f844d14f" /> | ||
| <img width="1280" height="584" alt="v4_result_3" src="https://github.com/user-attachments/assets/9678d362-afd9-4005-a415-46f93f8c07bb" /> | ||
| <img width="1280" height="896" alt="image" src="https://github.com/user-attachments/assets/05a7555e-e7b8-478b-879b-143b3e2ba44b" /> | ||
| <img width="1280" height="584" alt="image" src="https://github.com/user-attachments/assets/b68da464-c7ca-4602-92a0-2acaed73759d" /> | ||
|
|
||
|
|
||
| ### 5.2 ์ฑ๋ฅ ์งํ ๋น๊ต (v1 ~ v4) | ||
| | ์งํ ํญ๋ชฉ | v1 (Baseline) | v2 (๋ก์ง) | v3 (์ค์ ) | v4 (Redis) | ์ฑ๊ณผ (v1 vs v4) | | ||
|
|
@@ -120,4 +133,56 @@ | |
| | **Error Rate** | **1.0% ๋ฏธ๋ง** | 0.005% | **0.009%** | **ํต๊ณผ** | | ||
|
|
||
| **ํฅํ ๋ชฉํ**: | ||
| ๋ก์ง, ์ธํ๋ผ, ์บ์ฑ ์ต์ ํ๋ฅผ ํตํด ๋น์ฝ์ ์ธ ์ฑ๋ฅ ํฅ์์ ๊ฑฐ๋์์ผ๋, 1,000 VU ํ๊ฒฝ์์ ๋จ์ผ ์ธ์คํด์ค์ CPU ๋ถํ๋ก ์ธํด p(95) 2.0s ๋ชฉํ์๋ ๋ฏธ๋ฌํ์ต๋๋ค. ํฅํ **์ธ์คํด์ค ํ์ฅ(Scale-out)** ๋ฐ **๋ก๋๋ฐธ๋ฐ์(ALB)** ์ ์ฉ์ ํตํด ์์ ๋ถํ๋ฅผ ๋ถ์ฐํ๊ณ ์ต์ข ๋ชฉํ ์งํ๋ฅผ ๋ฌ์ฑํ ์์ ์ ๋๋ค. | ||
| ๋ก์ง, ์ธํ๋ผ, ์บ์ฑ ์ต์ ํ๋ฅผ ํตํด ๋น์ฝ์ ์ธ ์ฑ๋ฅ ํฅ์์ ๊ฑฐ๋์์ผ๋, 1,000 VU ํ๊ฒฝ์์ ๋จ์ผ ์ธ์คํด์ค์ CPU ๋ถํ๋ก ์ธํด p(95) 2.0s ๋ชฉํ์๋ ๋ฏธ๋ฌํ์ต๋๋ค. ํฅํ **์ธ์คํด์ค ํ์ฅ(Scale-out)** ๋ฐ **๋ก๋๋ฐธ๋ฐ์(ALB)** ์ ์ฉ์ ํตํด ์์ ๋ถํ๋ฅผ ๋ถ์ฐํ๊ณ ์ต์ข ๋ชฉํ ์งํ๋ฅผ ๋ฌ์ฑํ ์์ ์ ๋๋ค. | ||
|
|
||
| --- | ||
|
|
||
| ## ๐ง Tech Stack | ||
| <p> | ||
| <img src="https://img.shields.io/badge/SpringBoot-6DB33F?style=for-the-badge&logo=springboot&logoColor=white"> | ||
| <img src="https://img.shields.io/badge/Java-007396?style=for-the-badge&logo=openjdk&logoColor=white"> | ||
| <img src="https://img.shields.io/badge/JWT-000000?style=for-the-badge&logo=jsonwebtokens&logoColor=white"> | ||
| <img src="https://img.shields.io/badge/MySQL-4479A1?style=for-the-badge&logo=mysql&logoColor=white"> | ||
| <img src="https://img.shields.io/badge/Redis-DC382D?style=for-the-badge&logo=redis&logoColor=white"> | ||
| <img src="https://img.shields.io/badge/STOMP-6E4C13?style=for-the-badge&logo=apachekafka&logoColor=white"> | ||
| <img src="https://img.shields.io/badge/RabbitMQ-FF6600?style=for-the-badge&logo=rabbitmq&logoColor=white"> | ||
|
|
||
| </p> | ||
|
|
||
| <p> | ||
| <img src="https://img.shields.io/badge/Docker-2496ED?style=for-the-badge&logo=docker&logoColor=white"> | ||
| <img src="https://img.shields.io/badge/Nginx-009639?style=for-the-badge&logo=nginx&logoColor=white"> | ||
| <img src="https://img.shields.io/badge/AWS-232F3E?style=for-the-badge&logo=amazonaws&logoColor=white"> | ||
| <img src="https://img.shields.io/badge/github-181717?style=for-the-badge&logo=github&logoColor=white"> | ||
| <img src="https://img.shields.io/badge/GitHub_Actions-2088FF?style=for-the-badge&logo=githubactions&logoColor=white"> | ||
| <img src="https://img.shields.io/badge/Swagger-85EA2D?style=for-the-badge&logo=swagger&logoColor=white"> | ||
| </p> | ||
|
|
||
| <p> | ||
| <img src="https://img.shields.io/badge/k6-7D64FF?style=for-the-badge&logo=k6&logoColor=white"> | ||
| <img src="https://img.shields.io/badge/Prometheus-E6522C?style=for-the-badge&logo=prometheus&logoColor=white"> | ||
| <img src="https://img.shields.io/badge/Grafana-F46800?style=for-the-badge&logo=grafana&logoColor=white"> | ||
| </p> | ||
|
|
||
| | ||
| ## ๐ Backend Architecture | ||
| <img width="3002" height="2376" alt="image" src="https://github.com/user-attachments/assets/0faefea2-ad94-4a9c-b423-4f8fa49fbf27" /> | ||
|
|
||
| | ||
| ## ๐ ERD | ||
| <img width="972" alt="Image" src="https://github.com/user-attachments/assets/f6805244-44b5-45b1-9e47-c47521d8d53a" /> | ||
|
|
||
| | ||
| ## ๐ git flow | ||
| - `main` | ||
| - ํ๋ก์ ํธ ์ต์ข merge | ||
| - ๊ธฐ๋ณธ ํ๋ก์ ํธ ์ธํ , ๋ฐฐํฌ ๊ฐ๋ฅํ ๋ธ๋์น, ํญ์ ๋ฐฐํฌ ๊ฐ๋ฅํ ์ํ๋ฅผ ์ ์ง | ||
| - `develop` | ||
| - ๋ฐ๋ชจ๋ฐ์ด ์ ๊น์ง ์์ฑํ ๊ธฐ๋ฅ๋ค์ ๊ณ์ํด์ merge | ||
| - ๋ฐฐํฌ ๊ฐ๋ฅํ ๋ธ๋์น, ํญ์ ๋ฐฐํฌ ๊ฐ๋ฅํ ์ํ๋ฅผ ์ ์ง | ||
| - `{type}/{description}`: ๊ฐ๋ฐ ๋ธ๋์น | ||
| - ์:ย `feat/login`, `fix/login-token` | ||
|
|
||
| | ||
| ## ๐ฉโ๐ป๐จโ๐ป Organization Repository | ||
| https://github.com/Farm-On/BE | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ๐งน Nitpick | ๐ต Trivial URL ๋งํฌ ํฌ๋งทํ ๋ฐ ํ์ผ ๋ ๊ฐํ ์ถ๊ฐ ๋ ๊ฐ์ง ๋งํฌ๋ค์ด ํฌ๋งท ๊ฐ์ ์ด ํ์ํฉ๋๋ค:
๐ ํฌ๋งทํ ๊ฐ์ ์ ์-https://github.com/Farm-On/BE
+[https://github.com/Farm-On/BE](https://github.com/Farm-On/BE)
+๐งฐ Tools๐ช markdownlint-cli2 (0.18.1)188-188: Bare URL used (MD034, no-bare-urls) 188-188: Files should end with a single newline character (MD047, single-trailing-newline) ๐ค Prompt for AI Agents |
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ฐฐ์ง ์ด๋ฏธ์ง์ ๋์ฒด ํ ์คํธ(alt text) ์ถ๊ฐ ํ์
๊ธฐ์ ์คํ ๋ฐฐ์ง ์ด๋ฏธ์ง๋ค์ ๋์ฒด ํ ์คํธ๊ฐ ๋๋ฝ๋์ด ์์ด ์ ๊ทผ์ฑ(accessibility) ๋ฌธ์ ๊ฐ ๋ฐ์ํฉ๋๋ค. ์คํฌ๋ฆฐ ๋ฆฌ๋ ์ฌ์ฉ์๋ค์ด ์ด๋ค ๊ธฐ์ ์ด ์ฌ์ฉ๋์๋์ง ํ์ ํ ์ ์์ต๋๋ค.
๊ฐ ๋ฐฐ์ง์ ํด๋น ๊ธฐ์ ๋ช ์ alt text๋ก ์ถ๊ฐํด์ฃผ์ธ์.
โฟ ์ ๊ทผ์ฑ ๊ฐ์ ์ ์ํ ์์ ์ ์
๋๋จธ์ง ๋ฐฐ์ง๋ค๋ ๋์ผํ ๋ฐฉ์์ผ๋ก alt ์์ฑ์ ์ถ๊ฐํด์ฃผ์ธ์.
๐งฐ Tools
๐ช markdownlint-cli2 (0.18.1)
142-142: Images should have alternate text (alt text)
(MD045, no-alt-text)
143-143: Images should have alternate text (alt text)
(MD045, no-alt-text)
144-144: Images should have alternate text (alt text)
(MD045, no-alt-text)
145-145: Images should have alternate text (alt text)
(MD045, no-alt-text)
146-146: Images should have alternate text (alt text)
(MD045, no-alt-text)
147-147: Images should have alternate text (alt text)
(MD045, no-alt-text)
148-148: Images should have alternate text (alt text)
(MD045, no-alt-text)
153-153: Images should have alternate text (alt text)
(MD045, no-alt-text)
154-154: Images should have alternate text (alt text)
(MD045, no-alt-text)
155-155: Images should have alternate text (alt text)
(MD045, no-alt-text)
156-156: Images should have alternate text (alt text)
(MD045, no-alt-text)
157-157: Images should have alternate text (alt text)
(MD045, no-alt-text)
158-158: Images should have alternate text (alt text)
(MD045, no-alt-text)
162-162: Images should have alternate text (alt text)
(MD045, no-alt-text)
163-163: Images should have alternate text (alt text)
(MD045, no-alt-text)
164-164: Images should have alternate text (alt text)
(MD045, no-alt-text)