Skip to content

High resource usage of AgentServer in Docker limits concurrent rooms on single-core 2GB container #4483

@echo1248

Description

@echo1248

Feature Type

Nice to have

Feature Description

Environment

  • Deployment: Docker container
  • Container specs: 1 CPU core, 2 GB RAM
  • OS / Base image: [ ghcr.io/astral-sh/uv:python3.13-bookworm-slim ]
  • Python Agent / Node.js Agent: Python
  • Default start command: uv run src/agent.py start

Description

When running the AgentServer in a single-core, 2GB RAM Docker container with default multiprocessing setup:

  • Each new Job spawns a separate process (forkserver/spawn)
  • CPU and memory usage quickly saturates
  • Only ~4-5 concurrent rooms can be handled before new jobs are rejected due to load or OOM

Steps to Reproduce

  1. Start AgentServer in Docker with single core, 2GB RAM
  2. Dispatch multiple rooms/jobs simultaneously
  3. Observe no servers available errors after 4-5 rooms

Current Behavior

  • High memory footprint per Job
  • Multiple Python processes are spawned per Job (observed via ps -ef | grep python)
  • Default load_threshold in production (0.7) triggers job rejection quickly

Expected Behavior

  • Support more concurrent rooms on low-resource environments
  • Optionally provide guidance or configuration options to optimize memory/CPU usage for small containers

Questions / Suggestions

  1. Can the AgentServer use async-only execution without separate process per Job, for low-resource deployments?
  2. Are there config flags to reduce per-Job memory usage or limit multiprocessing overhead?
  3. Is it possible to tune process pool / job executor / idle processes to better fit single-core, 2GB environments?

Workarounds / Alternatives

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions