Skip to content

perf: tune healthcheck intervals for squid and api-proxy containers#1803

Merged
Mossaka merged 2 commits intomainfrom
copilot/tune-healthcheck-intervals-squid-api-proxy
Apr 8, 2026
Merged

perf: tune healthcheck intervals for squid and api-proxy containers#1803
Mossaka merged 2 commits intomainfrom
copilot/tune-healthcheck-intervals-squid-api-proxy

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 8, 2026

Squid and api-proxy healthchecks use conservative intervals (5s interval, 5-10s start_period) that add ~6-8s idle wait to every sandbox invocation. Both services typically become healthy in 1-2s.

  • src/docker-manager.ts: Set interval: '1s', start_period: '2s', timeout: '1s' for both squid and api-proxy healthchecks. retries: 5 unchanged.
  • docs/api-proxy-sidecar.md, src/types.ts: Update docs/examples to match.
Service interval start_period timeout
Squid 5s → 1s 10s → 2s 3s → 1s
API Proxy 5s → 1s 5s → 2s 3s → 1s

Copilot AI changed the title [WIP] Tune healthcheck intervals for squid and api-proxy containers perf: tune healthcheck intervals for squid and api-proxy containers Apr 8, 2026
Copilot AI requested a review from Mossaka April 8, 2026 18:57
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

Documentation Preview

Documentation build failed for this PR. View logs.

Built from commit c43877c

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 86.22% 86.31% 📈 +0.09%
Statements 86.08% 86.17% 📈 +0.09%
Functions 87.50% 87.50% ➡️ +0.00%
Branches 78.81% 78.86% 📈 +0.05%
📁 Per-file Coverage Changes (1 files)
File Lines (Before → After) Statements (Before → After)
src/docker-manager.ts 86.6% → 86.9% (+0.36%) 86.0% → 86.4% (+0.35%)

Coverage comparison generated by scripts/ci/compare-coverage.ts

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

Smoke test results — PASS ✅

  • ✅ GitHub MCP: "chore: upgrade smoke-copilot workflow to gh-aw v0.67.3" / "fix: normalize API target env vars to bare hostnames via URL parsing"
  • ✅ Playwright: github.com title contains "GitHub"
  • ✅ File write: /tmp/gh-aw/agent/smoke-test-claude-24152900341.txt created
  • ✅ Bash: file content verified

💥 [THE END] — Illustrated by Smoke Claude

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

Smoke Test Results

PR titles: "fix: normalize API target env vars to bare hostnames via URL parsing"; "feat: forward OIDC env vars into agent container"
GitHub MCP (last 2 merged PRs): ✅
SafeInputs GH CLI (safeinputs-gh): ❌ (tool not available in this run)
Playwright (github.com title contains GitHub): ❌ (EACCES writing Playwright log output)
Tavily search: ❌ (Tavily MCP tool not available)
File write + bash cat verify: ✅
Discussion query/comment: ❌ (github-discussion-query tool not available)
Build (npm ci && npm run build): ✅
Overall status: FAIL

🔮 The oracle has spoken through Smoke Codex

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

Smoke Test: GitHub Actions Services Connectivity ✅

All checks passed:

Service Check Result
Redis host.docker.internal:6379 PING +PONG
PostgreSQL host.docker.internal:5432 pg_isready accepting connections ✅
PostgreSQL smoketest DB SELECT 1 returned 1

🔌 Service connectivity validated by Smoke Services

@github-actions github-actions bot mentioned this pull request Apr 8, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

Smoke Test Results — PR #1803

Test Result
GitHub MCP connectivity
GitHub.com HTTP connectivity
File write/read

PR: perf: tune healthcheck intervals for squid and api-proxy containers
Author: @Copilot | Assignees: @Mossaka, @Copilot

Overall: PASS

📰 BREAKING: Report filed by Smoke Copilot

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

Chroot Version Comparison Results

Runtime Host Version Chroot Version Match?
Python Python 3.12.13 Python 3.12.3
Node.js v24.14.1 v20.20.2
Go go1.22.12 go1.22.12

Overall: ❌ Not all tests passed — Python and Node.js versions differ between host and chroot environments.

Tested by Smoke Chroot

@Mossaka
Copy link
Copy Markdown
Collaborator

Mossaka commented Apr 8, 2026

@copilot what are the implications of the new healthcheck intervals, both good and bad sides?

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 8, 2026

@copilot what are the implications of the new healthcheck intervals, both good and bad sides?

Benefits:

  • ~6-8s faster startup per sandbox invocation — docker compose up --wait polls healthchecks before proceeding, so 1s interval detects healthy containers much sooner than 5s.
  • Shorter start_period (10s/5s → 2s) — both services become healthy in 1-2s, so the old 5-10s grace period was pure idle wait.
  • Faster failure detection — unhealthy services are flagged sooner with 1s polling.

Risks/tradeoffs:

  • Slightly more frequent healthcheck commands — but nc -z (Squid) and curl -f /health (API Proxy) are extremely lightweight, so the overhead is negligible.
  • Shorter timeout (3s → 1s) — on a very loaded system the check command could time out. Mitigated by keeping retries: 5, so transient slowness won't cause a false unhealthy.
  • Reduced total tolerance window — old Squid config allowed up to ~35s total (10s start_period + 5×5s retries); new config allows ~7s (2s + 5×1s). For API Proxy: ~30s → ~7s. In practice both services start in 1-2s, so 7s is still generous. If we ever see flakiness on very slow machines, we can bump retries without reverting the interval/start_period gains.

@Mossaka Mossaka marked this pull request as ready for review April 8, 2026 20:45
Copilot AI review requested due to automatic review settings April 8, 2026 20:45
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reduces per-invocation startup latency by tuning Docker healthcheck timings for the Squid proxy and api-proxy sidecar, aligning code and documentation with faster readiness expectations.

Changes:

  • Updated Squid service healthcheck timing in generated Docker Compose (interval/timeout/start_period).
  • Updated api-proxy service healthcheck timing in generated Docker Compose (interval/timeout/start_period).
  • Refreshed TypeScript/docs examples to match the new healthcheck configuration.
Show a summary per file
File Description
src/docker-manager.ts Lowers Squid and api-proxy healthcheck interval/timeout/start_period to reduce sandbox idle wait before services are marked healthy.
src/types.ts Updates the DockerService healthcheck example values to reflect the tuned timings (and retries=5).
docs/api-proxy-sidecar.md Updates documented api-proxy healthcheck parameters to match the implementation.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 3/3 changed files
  • Comments generated: 0

@Mossaka Mossaka merged commit ffd2946 into main Apr 8, 2026
72 of 74 checks passed
@Mossaka Mossaka deleted the copilot/tune-healthcheck-intervals-squid-api-proxy branch April 8, 2026 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

perf: tune healthcheck intervals for squid and api-proxy containers

3 participants