[Code 개선] #19. [Async] 무거운 작업을 백그라운드 스레드로 위임하는 비동기 래퍼 구현 #27
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
1. 목표
LLM 호출 등 시간이 오래 걸리는 작업을 백그라운드 스레드에서 실행하고, 사용자의 HTTP 요청에는 즉시 응답을 반환하는 비동기 처리 구조를 구현합니다.
2. 상세 원인 및 배경
/generateAPI는 LLM 응답이 올 때까지 수십 초간 브라우저를 잡아둡니다. 이는 동시 접속자가 많을 때 서버 리소스를 고갈시키고 타임아웃 장애를 유발합니다.Original: Kyeongmin/test#49