perf: max speed — 2s cooldown, 10s idle poll, 90s scaler, 10+5 workers

Hit rate limits, don't play it safe. Scale down only when forced.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Alexander Whitestone
2026-03-22 19:42:47 -04:00
parent edee9b8dcc
commit e64efd9185
2 changed files with 12 additions and 12 deletions

View File

@@ -8,15 +8,15 @@
set -euo pipefail
# === CONFIG ===
NUM_WORKERS="${1:-7}"
NUM_WORKERS="${1:-10}"
MAX_WORKERS=21 # absolute ceiling
WORKTREE_BASE="$HOME/worktrees"
GITEA_URL="http://143.198.27.163:3000"
GITEA_TOKEN=$(cat "$HOME/.hermes/claude_token")
CLAUDE_TIMEOUT=900 # 15 min per issue
COOLDOWN=5 # seconds between issues (fast cycle)
RATE_LIMIT_SLEEP=60 # initial sleep on rate limit
MAX_RATE_SLEEP=300 # max backoff on rate limit
COOLDOWN=2 # seconds between issues — max speed
RATE_LIMIT_SLEEP=30 # initial sleep on rate limit
MAX_RATE_SLEEP=120 # max backoff on rate limit
LOG_DIR="$HOME/.hermes/logs"
SKIP_FILE="$LOG_DIR/claude-skip-list.json"
LOCK_DIR="$LOG_DIR/claude-locks"
@@ -282,7 +282,7 @@ run_worker() {
if [ "$issue_json" = "null" ] || [ -z "$issue_json" ]; then
update_active "$worker_id" "" "" "idle"
sleep 60
sleep 10
continue
fi
@@ -436,7 +436,7 @@ done
# Every 3 minutes: check health, scale up if no rate limits, scale down if hitting limits
CURRENT_WORKERS="$NUM_WORKERS"
while true; do
sleep 180
sleep 90
# Reap dead workers and relaunch
for pidfile in "$PID_DIR"/*.pid; do

View File

@@ -8,15 +8,15 @@
set -euo pipefail
# === CONFIG ===
NUM_WORKERS="${1:-3}"
NUM_WORKERS="${1:-5}"
MAX_WORKERS=12
WORKTREE_BASE="$HOME/worktrees"
GITEA_URL="http://143.198.27.163:3000"
GITEA_TOKEN=$(cat "$HOME/.hermes/gemini_token")
GEMINI_TIMEOUT=600 # 10 min per issue
COOLDOWN=5 # seconds between issues
RATE_LIMIT_SLEEP=60
MAX_RATE_SLEEP=300
COOLDOWN=2 # seconds between issues — max speed
RATE_LIMIT_SLEEP=30
MAX_RATE_SLEEP=120
LOG_DIR="$HOME/.hermes/logs"
SKIP_FILE="$LOG_DIR/gemini-skip-list.json"
LOCK_DIR="$LOG_DIR/gemini-locks"
@@ -263,7 +263,7 @@ run_worker() {
if [ "$issue_json" = "null" ] || [ -z "$issue_json" ]; then
update_active "$worker_id" "" "" "idle"
sleep 60
sleep 10
continue
fi
@@ -406,7 +406,7 @@ done
# Dynamic scaler — every 3 minutes
CURRENT_WORKERS="$NUM_WORKERS"
while true; do
sleep 180
sleep 90
# Reap dead workers
for pidfile in "$PID_DIR"/*.pid; do