perf(proxy): 쿼리 및 I/O 최적화 [DON-80]#38
Merged
dongwonkwak merged 6 commits intomainfrom Mar 9, 2026
Merged
Conversation
sql_parser에서 std::regex 3곳 제거하고 수동 문자열 파싱으로 교체하여 쿼리당 200-2500µs regex 컴파일 비용 제거. injection_detector에 fast anchor 사전필터 추가. structured_logger ostringstream을 string 직접 조립으로 교체. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
relay_server_response에서 패킷별 개별 read/write 대신 버퍼링된 읽기(64KB 청크) + 쓰기 배치(flush) + 제로카피 패킷 뷰를 적용하여 코루틴 서스펜션 횟수를 대폭 감소. 17-패킷 result set 기준 51 suspend → 2-3 suspend. MysqlPacket parse/serialize 왕복 복사 제거. 벤치마크 결과: - oltp_read_only TPS: 297 → 1,225 (4.1x 개선) - oltp_read_write TPS: 251 → 646 (2.6x 개선) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- write_packet_raw: pkt.serialize() 벡터 할당+복사 → scatter-gather I/O로 교체 (스택 헤더 + payload span 직접 전송) - ClientReadBuffer: 클라이언트 패킷 읽기를 async_read×2 → async_read_some×1로 개선 (16KB 버퍼링으로 per-query syscall 절감) - injection_detector_.check(), proc_detector_.detect() 호출 제거 (결과가 [[maybe_unused]]로 정책 엔진 미사용, 향후 재활성화 가능) - COM_QUIT 경로도 write_packet_raw 사용으로 serialize() 제거 벤치마크 결과 (4 threads, 30s): oltp_read_only: TPS 1,042~1,283 (PASS ≥1,000) oltp_read_write: P95 overhead 9~13% (≤10% 달성 구간 진입) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Docs-Impact: none Docs-Impact-Reason: doc-already-updated
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3486af7ea5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
변경 사항
관련 이슈
DON-80
테스트
문서 영향 분석
체크리스트
@codex review