← 返回
数据分析 中文

OpenClaw Session Cleanup

Diagnose and stabilize long-running OpenClaw deployments that accumulate stale sessions, unreaped agents, browser-control timeouts, gateway websocket 1006 cl...
诊断并稳定长期运行的OpenClaw部署中出现的陈旧会话堆积、未回收代理、浏览器控制超时及网关WebSocket 1006异常断开等问题
neoch3n
数据分析 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 754
下载
💾 11
安装
1
版本
#latest#openclaw#ops

概述

OpenClaw Session Cleanup

Use this skill when the runtime becomes unstable after long uptime, especially on small hosts such as 1 vCPU / 2 GB RAM.

Trigger Pattern

Treat these as the main signals:

  • Sessions: 10+ active
  • Agents: 5+
  • browser control service timeout
  • gateway 1006 abnormal closure
  • repeated gateway disconnects or slow recovery after idle periods

What To Do

  1. Inspect the current runtime state.
  2. Prune stale sessions first.
  3. If the runtime stays unhealthy, clear sessions.
  4. Reduce runtime ceilings for sessions, agents, and browsers.
  5. Add recurring cleanup and a watchdog when the host is expected to run for days.

Immediate Commands

Run:

openclaw sessions
openclaw sessions prune
openclaw status

If the runtime is still unhealthy, escalate to:

openclaw sessions clear
openclaw status

Healthy target after cleanup:

  • Sessions: 1-3
  • Agents: 3
  • Gateway reachable
  • browser running

Safe Runtime Defaults

For 1 vCPU / 2 GB RAM, prefer:

  • maxSessions = 5
  • sessionTTL = 30m
  • maxAgents = 3
  • maxBrowsers = 1
  • swap = 2G

Use the starter config at {baseDir}/templates/openclaw.json.

Automation

Install periodic pruning:

bash "{baseDir}/scripts/install-cron-prune.sh"

Install watchdog unit files:

bash "{baseDir}/scripts/install-watchdog.sh"

Render a tuned runtime config:

bash "{baseDir}/scripts/render-openclaw-config.sh"

Browser Constraint

Treat browser control as the heaviest resource consumer on a small VPS.

Recommended mode:

openclaw browser start --single

Swap

If the host has no swap, add 2G:

fallocate -l 2G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
free -h

References

  • Detailed runbook: {baseDir}/docs/openclaw.session_cleanup_v1.md
  • Runtime template: {baseDir}/templates/openclaw.json
  • Watchdog service: {baseDir}/templates/openclaw-watchdog.service
  • Watchdog timer: {baseDir}/templates/openclaw-watchdog.timer

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-30 12:58 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

data-analysis

Excel / XLSX

ivangdavila
创建、检查和编辑 Microsoft Excel 工作簿及 XLSX 文件,支持可靠的公式、日期、类型、格式、重算及模板保留功能。
★ 368 📥 140,669
data-analysis

Stock Analysis

udiedrichsen
{"answer":"基于雅虎财经数据,分析股票与加密货币。支持投资组合管理、自选股预警、股息分析、8维评分、热门趋势扫描及传闻/早期信号探测。适用于股票分析、持仓追踪、财报异动、加密监控、热门股追踪或提前发掘非主流传闻。"}
★ 270 📥 57,007
data-analysis

Data Analysis

ivangdavila
{"answer":"数据分析与可视化。查询数据库、生成报告、自动化电子表格,将原始数据转化为清晰可行的见解。适用于:(1) 您……"}
★ 199 📥 65,199