fix: reduce rate limit from 10 to 5 RPS to avoid API errors (issue #43) #47

Merged
jihoson merged 1 commits from feature/issue-43-reduce-rate-limit into main 2026-02-05 00:17:16 +09:00
Collaborator

Summary

  • Reduce RATE_LIMIT_RPS from 10.0 to 5.0
  • Prevent "초당 거래건수 초과" errors (EGW00201)
  • Add explanatory comments to config

Problem

Docker logs showed rate limit errors as most frequent failure (70%):

"초당 거래건수를 초과하였습니다" (EGW00201)
get_overseas_price failed (500)

KIS API's actual rate limit appears lower than 10 RPS when scanning multiple stocks.

Solution

# src/config.py
RATE_LIMIT_RPS: float = 5.0  # was 10.0

More conservative rate limiting to stay within API constraints.

Files Changed

  • src/config.py: Default value 10.0 → 5.0
  • .env.example: Update default and add comment

Trade-offs

  • Pro: Fewer API errors, more reliable operation
  • Con: Slower throughput (10 stocks/sec → 5 stocks/sec)
  • Note: Can be tuned per deployment via .env file

Test Coverage

  • All existing tests pass (277 total)
  • Coverage maintained at 80%
  • No functional changes, only configuration

Closes

Closes #43

🤖 Generated with Claude Code

## Summary - Reduce `RATE_LIMIT_RPS` from 10.0 to 5.0 - Prevent "초당 거래건수 초과" errors (EGW00201) - Add explanatory comments to config ## Problem Docker logs showed rate limit errors as most frequent failure (70%): ``` "초당 거래건수를 초과하였습니다" (EGW00201) get_overseas_price failed (500) ``` KIS API's actual rate limit appears lower than 10 RPS when scanning multiple stocks. ## Solution ```python # src/config.py RATE_LIMIT_RPS: float = 5.0 # was 10.0 ``` More conservative rate limiting to stay within API constraints. ## Files Changed - `src/config.py`: Default value 10.0 → 5.0 - `.env.example`: Update default and add comment ## Trade-offs - **Pro**: Fewer API errors, more reliable operation - **Con**: Slower throughput (10 stocks/sec → 5 stocks/sec) - **Note**: Can be tuned per deployment via `.env` file ## Test Coverage - ✅ All existing tests pass (277 total) - ✅ Coverage maintained at 80% - ✅ No functional changes, only configuration ## Closes Closes #43 🤖 Generated with [Claude Code](https://claude.com/claude-code)
agentson added 1 commit 2026-02-05 00:13:15 +09:00
fix: reduce rate limit from 10 to 5 RPS to avoid API errors (issue #43)
Some checks failed
CI / test (pull_request) Has been cancelled
cb2e3fae57
Reduce RATE_LIMIT_RPS from 10.0 to 5.0 to prevent "초당 거래건수를
초과하였습니다" (EGW00201) errors from KIS API.

Docker logs showed this was the most frequent error (70% of failures),
occurring when multiple stocks are scanned rapidly.

Changes:
- src/config.py: RATE_LIMIT_RPS 10.0 → 5.0
- .env.example: Update default and add explanation comment

Trade-off: Slower API throughput, but more reliable operation.
Can be tuned per deployment via environment variable.

Fixes: #43

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
jihoson merged commit 3923d03650 into main 2026-02-05 00:17:16 +09:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: jihoson/The-Ouroboros#47