-
Notifications
You must be signed in to change notification settings - Fork 8
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
[BE] 깃허브 API 비동기 작업시 ThreadPoolExecutor 주입(#764) #775
base: develop
Are you sure you want to change the base?
Conversation
Test Results 67 files 67 suites 8s ⏱️ Results for commit 6ca2bc3. |
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.
신기하네용
고생하셨습니당~~!!
import java.util.function.Supplier; | ||
|
||
public class FutureUtil { | ||
|
||
public static <T> CompletableFuture<T> supplyAsync(Supplier<T> supplier) { | ||
return CompletableFuture.supplyAsync(supplier); | ||
} | ||
|
||
public static <T> CompletableFuture<T> supplyAsync(final Supplier<T> supplier, final Executor executor) { |
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.
파라미터에 final
붙어 있는 이유가 있나요? ㅇ.ㅇ
없으면 빼도 괜찮을 것 같습니다!
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.
기본 제공 스레드가 병렬 연산 최적화인 줄 몰랐네요..ㅎㅎ
덕분에 많은 걸 알아갑니당
구현하고 테스트하느라 고생했어요!!
executor.setCorePoolSize(100); | ||
executor.setMaxPoolSize(200); | ||
executor.setQueueCapacity(50); |
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.
적절한 세팅인 것 같아요 👍
지금 상황에서 말한것처럼 큰 부하는 없을 것 같아 좋은 것 같습니다
고생했어용!!
📌 관련 이슈
✨ PR 세부 내용
이슈에 설명한 내용과 비슷하며
FutureUtil
테스트를 통해 검증했습니다.스레드 사용 설정은
t2.micro
사양인 CPU 1 core, Memory 1G 로 해도Core 1000, Max 2000, �Queue 500
해당 값에 대해 잘 작동하는걸 확인했습니다.( DB 및 다른 의존성 제거하고 스레드 부분만 진행 )
당장 이렇게 TPS 가 나오지 않을거라 생각해서 부하가 크게 없고, 요청이 많이 와도 문제없을 100 200 50 으로 설정했습니다.