Stop applications on idle after timer to conserve resources #28

Closed
opened 2026-05-06 15:54:02 +00:00 by Mark · 9 comments
Owner

Problem

Applications running on Nodehub stay alive indefinitely even when idle, consuming memory and CPU resources unnecessarily. On a shared-resource tailnet, this adds up quickly.

Proposed Solution

Add a configurable idle timeout per application that triggers a graceful stop after a period of inactivity. Key considerations:

  • Configurable per-app — different apps have different idle tolerance (e.g., an API server might want 30m, while a batch worker could be 5m)
  • Graceful shutdown — send SIGTERM first, wait for graceful period, then SIGKILL
  • Health check awareness — don't stop if the app is still processing something (check health endpoint or recent log activity)
  • Restart on demand — accessing the app or a new request should spin it back up (lazy start / wake on use)
  • Default timeout — sensible default (e.g., 15 minutes) to avoid surprises

Implementation Ideas

  • Timer tracking per container/process based on last activity timestamp
  • Webhook or event-based reset of the idle timer (on request received, file write, etc.)
  • Dashboard visibility into which apps are idle vs active vs hibernated

Acceptance Criteria

  • Configurable idle timeout per application
  • Graceful stop with configurable grace period
  • App restarts on next access request
  • Dashboard shows idle/active state per app
  • Metrics: resource savings tracked (optional)

Open to discussion on approach.

## Problem Applications running on Nodehub stay alive indefinitely even when idle, consuming memory and CPU resources unnecessarily. On a shared-resource tailnet, this adds up quickly. ## Proposed Solution Add a configurable idle timeout per application that triggers a graceful stop after a period of inactivity. Key considerations: - **Configurable per-app** — different apps have different idle tolerance (e.g., an API server might want 30m, while a batch worker could be 5m) - **Graceful shutdown** — send SIGTERM first, wait for graceful period, then SIGKILL - **Health check awareness** — don't stop if the app is still processing something (check health endpoint or recent log activity) - **Restart on demand** — accessing the app or a new request should spin it back up (lazy start / wake on use) - **Default timeout** — sensible default (e.g., 15 minutes) to avoid surprises ## Implementation Ideas - Timer tracking per container/process based on last activity timestamp - Webhook or event-based reset of the idle timer (on request received, file write, etc.) - Dashboard visibility into which apps are idle vs active vs hibernated ## Acceptance Criteria - [ ] Configurable idle timeout per application - [ ] Graceful stop with configurable grace period - [ ] App restarts on next access request - [ ] Dashboard shows idle/active state per app - [ ] Metrics: resource savings tracked (optional) Open to discussion on approach.
Author
Owner

🤖 Claimed by gsd-issue-fixer-node_hub-28 — starting work

🤖 Claimed by `gsd-issue-fixer-node_hub-28` — starting work
Author
Owner

🤖 [gsd-issue-fixer-node_hub-28] still working — claimed — starting pipeline

🤖 [`gsd-issue-fixer-node_hub-28`] still working — claimed — starting pipeline
Author
Owner

🤖 [gsd-issue-fixer-node_hub-28] still working — research

🤖 [`gsd-issue-fixer-node_hub-28`] still working — research
Author
Owner

🤖 [gsd-issue-fixer-node_hub-28] still working — plan

🤖 [`gsd-issue-fixer-node_hub-28`] still working — plan
Author
Owner

🤖 [gsd-issue-fixer-node_hub-28] still working — implement attempt 1

🤖 [`gsd-issue-fixer-node_hub-28`] still working — implement attempt 1
Author
Owner

GSD VERIFY phase found no changes after implementation.
Worker output: ]11;?\API call failed after 3 retries: HTTP 404: 404 page not found

GSD VERIFY phase found no changes after implementation. Worker output: ]11;?\API call failed after 3 retries: HTTP 404: 404 page not found
Author
Owner

Pipeline retry: Previous attempt failed with HTTP 404 — agent couldn't find a required resource. Pipeline state cleared for retry.

Pipeline retry: Previous attempt failed with HTTP 404 — agent couldn't find a required resource. Pipeline state cleared for retry.
Author
Owner

⏸ Needs Decision

Blocking factors:

  • Didn't meet auto-approve criteria — scope=medium, risk=medium, spec=partial

Scope: medium Risk: medium Spec: partial Type: feature
Summary: Stop applications on idle after timer to conserve resources
Suggestion: needs investigation
Rationale:

Action: Review each blocking factor above. Remove blocked:needs-decision label to route back to triage.

## ⏸ Needs Decision **Blocking factors:** - **Didn't meet auto-approve criteria** — scope=medium, risk=medium, spec=partial --- **Scope:** medium **Risk:** medium **Spec:** partial **Type:** feature **Summary:** Stop applications on idle after timer to conserve resources **Suggestion:** needs investigation **Rationale:** **Action:** Review each blocking factor above. Remove `blocked:needs-decision` label to route back to triage.
Author
Owner

GSD PLAN: response missing GATE: line.

GSD PLAN: response missing GATE: line.
Mark 2026-06-08 00:27:58 +00:00
Sign in to join this conversation.
No description provided.