Skip to content

Performance: chain of issues causing excessive CPU/event-loop saturation on low-power hosts #76188

@DBOYttt

Description

@DBOYttt

Overview

This issue documents a chain of compounding performance problems that collectively make OpenClaw unusable on low-power hardware (Pi, NUC, homelab mini-PCs). Each issue is independently harmful, but together they cause full CPU saturation and event-loop delays of 30+ seconds.

Related to: #76096 (node.list blocks event loop when orphaned agent directories exist)


Issue Chain

1. 69 plugins enabled by default — all loaded into every agent run

All stock provider plugins are enabled out-of-the-box, including dozens of providers with no credentials configured (alibaba, amazon-bedrock, arcee, byteplus, cerebras, chutes, deepinfra, deepseek, fireworks, groq, kimi, litellm, lmstudio, minimax, mistral, moonshot, nvidia, ollama, qianfan, qwen, tencent, together, venice, vllm, volcengine, xai, xiaomi, zai, and more).

Impact: The core-plugin-tools prep stage takes ~40 seconds on every single agent invocation because it loads tools from all 69 plugins. Measured on a Celeron N4000 with eMMC:

core-plugin-tools:39657ms@39688ms   # every agent run
core-plugin-tools:39759ms@40570ms

After manually disabling 57 unused plugins (leaving 13 active), this stage dropped to near-zero.

Fix: Either lazy-load plugin tools on first use, or do not enable provider plugins that have no credentials/config. A provider with no API key configured contributes zero value to the agent context.


2. Plugin runtime deps re-staged on every config hot-reload

Plugin staging ([plugins] acpx staging bundled runtime deps (45 specs)) fires not only on startup but on every config hot-reload. On a gateway that hot-reloads frequently (e.g. due to active config management), this repeatedly hammers slow storage.

Impact: Each staging round causes a liveness warning burst:

[WARN] liveness warning: reasons=event_loop_delay eventLoopDelayMaxMs=36641.4 eventLoopUtilization=0.864

Fix: Skip staging if the runtime-deps snapshot hash matches the current version.


3. Workspace directory scanned on every sessions.list / node.list call

The workspace directory (~/.openclaw/workspace/) is scanned recursively on every sessions.list and node.list RPC call. If the workspace contains large projects (e.g. a Python venv, Node.js project with node_modules, build artifacts), the I/O cost is enormous on slow eMMC/SD storage.

Measured:

Workspace contained: a 2.8 GB Python project with .venv, an 828 MB Node.js project, and several other large dirs — totalling 4.3 GB. After moving them out, workspace dropped to 9 MB and call times normalized.

Fix: Do not recurse into workspace project subdirectories when listing sessions/nodes. Only index the top-level session metadata, not full directory trees.


4. No low-power host defaults

The doctor command recommends NODE_COMPILE_CACHE and OPENCLAW_NO_RESPAWN=1 for "small hosts (Pi/VM)" — but only after the fact. The default config ships with subagents.maxConcurrent: 8 and agents.defaults.maxConcurrent: 4, which spawns up to 12 concurrent Node processes on a 2-core 1.1 GHz machine.

Impact: Instant CPU saturation when any multi-step task runs.

Fix: Ship a low-power profile, or detect core count at startup and cap concurrency accordingly.


Environment

  • OpenClaw: 2026.4.29 (a448042)
  • OS: Ubuntu, Linux 6.8.0-111-generic x86_64
  • CPU: Intel Celeron N4000 @ 1.10GHz, 2 cores
  • Storage: eMMC (mmcblk0)
  • Node.js: 25.5.0

Before / After (all mitigations applied)

Metric Before After
Plugins loaded 69 13
Workspace size 4.3 GB 9 MB
eventLoopDelayMaxMs 36,000 ms ~1,700 ms
Event loop utilization 100% ~7%
Gateway CPU at idle 85–100% ~13%
System load average 3.5 0.59
core-plugin-tools stage ~40,000 ms ~0 ms
node.list RPC 7–48 s <300 ms

Suggested priority

  1. Do not enable provider plugins with no credentials (highest impact, trivial fix)
  2. Skip plugin staging when version hash unchanged (reduces reload cost)
  3. Do not recurse workspace subdirs in session/node listing (correctness + perf)
  4. Cap default concurrency based on detected core count (prevents new-user foot-gun)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions