#Very high CPU usage when running openclaw CLI
1 messages · Page 1 of 1 (latest)
I’m checking the docs/source for any known high-CPU regressions or common causes, then I’ll give you the shortest useful triage path.
That sounds abnormal.
First, can you paste:
openclaw --version
Then please try these two exact checks:
time openclaw --help >/dev/null
OPENCLAW_RUNNER_LOG=1 openclaw --help >/dev/null
A couple reasons I’m asking for those specifically:
- current builds have a lightweight root
--helpfast path, so if that still spikes CPU, something in startup is off - if you’re running from a git/source checkout, the wrapper can rebuild
diston any CLI invocation when it thinks the tree is stale, which would explain high CPU even for help
If the second command prints something like dist is stale with reasons such as dirty_watched_tree, git_head_changed, config_newer, or source_mtime_newer, we’ve probably found it.
Also tell me whether this is:
- a normal installed package, or
- a repo/source checkout
Docs:
- FAQ: https://docs.openclaw.ai/help/faq
- Troubleshooting: https://docs.openclaw.ai/gateway/troubleshooting
Paste those outputs and I’ll narrow it down with you.
ok i was wrong --help is fast. running things like "gateway status" is causing high cpu usage.
OpenClaw 2026.4.15 (041266a)
Got it, that’s a much better signal. I’m checking what gateway status actually does in this build so I can point you at the likely hot path instead of guessing.
Nice, that narrows it a lot.
I checked the current code path, and openclaw gateway status is not a cheap command. On your build it does roughly:
- service/runtime inspection
- config audit
- port-owner inspection via
lsoforss - extra
pslookups for the listener PID(s) - a live gateway probe
- and, when probing is on, an extra restart-health check that inspects the port again
So --help being fast but gateway status being hot actually makes sense.
Can you compare these two:
time openclaw gateway status --no-probe
time openclaw gateway status
Interpretation:
- if
--no-probeis much cheaper, the expensive part is the live probe / restart-health path - if both are hot, the likely culprit is the local port inspection path (
lsof/ss/ps)
If both are hot, also try:
time ss -H -ltnp 'sport = :18789'
and if ss is missing:
time lsof -nP -iTCP:18789 -sTCP:LISTEN -FpFcn
If you just want a lighter “is the gateway alive?” check for now, use:
openclaw health --json
Docs:
Paste the timings and I can tell you which branch is actually burning the CPU.
--no-probe behaves exactly the same. extremely high CPU usage
real 0m0.039s
user 0m0.000s
sys 0m0.009s
openclaw@openclaw:~$ time openclaw gateway status --no-probe
Port 18789 is already in use.
- pid 813 openclaw: openclaw-gateway (127.0.0.1:18789)
- Gateway already running locally. Stop it (openclaw gateway stop) or use a different port.
real 0m14.394s
user 0m21.052s
sys 0m0.983s```
That output is weird, and actually really helpful. I’m searching the exact message in source, because gateway status --no-probe should not be trying to bind the port at all.
Ah, that’s the smoking gun.
I checked the exact error text in source, and that output is from the gateway start/run path, not the gateway status handler.
So openclaw gateway status --no-probe is almost certainly not hitting the right command surface on your machine. That also explains the huge CPU use.
Please paste these:
which openclaw
readlink -f "$(command -v openclaw)"
openclaw gateway --help
What I expect:
openclaw gateway --helpshould liststatus,start,stop,restart, etc.- if it does not, you likely have a stale/mismatched wrapper or dist build on PATH
If this is a git/source checkout install, I’d rebuild first:
pnpm build
pnpm ui:build
If it’s a normal installed package, I’d do an update/reinstall next:
Temporary workaround, if you just need a health check:
openclaw health --json