2026 年自託管 n8n 與 AI Agent 基準測試:非快取 4K fsync IOPS、計費比較及避免 Exit Code 137
2026 Self-Hosted n8n & AI Agent Benchmarks: Non-Cached 4K fsync IOPS, Billing Meters & Preventing Exit Code 137
作者在自託管 n8n 使用的 Linux 6.8 KVM 節點上測得,非快取 4K 隨機 pwrite 加 fsync 達 2,502.5 IOPS,平均延遲 0.40 ms。
Most "cheapest VPS for n8n" articles hide two things: how per-task billing explodes once an AI agent runs 8–15 steps per conversation, and why 64 MB dd if=/dev/zero benchmarks lie about real PostgreSQL 16 disk I/O.
Here is the reproducible telemetry from our live Linux 6.8 KVM node, the exact billing-meter math across Zapier / Make / n8n Cloud / Hetzner / PikaPods / RackNerd, and the 4 environment variables that stopped Exit Code 137 OOM kills completely.
1. Real Non-Cached 4K Random fsync Telemetry (Not Cached dd)
Measured on a live 3 vCPU Intel Xeon E5-2680 v4 node (Linux 6.8.0-147-generic, 3,915 MB RAM, 4,095 MB swap):
| Metric | Live Result | Operational Takeaway |
|---|---|---|
Non-cached 4K random pwrite + fsync (500 ops / 16 MB) |
2,502.5 IOPS (0.40 ms avg) | Fast enough for concurrent PostgreSQL 16 WAL commits |
| Single-core SHA-256 throughput | 282.4 MB/s | Honest trade-off: older Broadwell CPU; great for Docker/webhooks, unsuitable for CPU LLM inference |
PostgreSQL 16 idle RSS |
31 MB | Eliminates SQLITE_BUSY with negligible RAM overhead |
dockerd + containerd combined RSS |
138 MB | Baseline container runtime footprint |
cloudflared tunnel RSS |
39 MB | Exposes local Mac mini M4 / Beelink N100 safely without port forwarding |
Full machine-readable JSON dataset & reproduction script: https://nodebudget.dev/benchmarks/2026-11-telemetry.json
2. Billing Meter Math: 15,000 Runs × 8 Steps/Run
-
Zapier (bills per action step):
15,000 × 7 = 105,000 tasks→ $899+/mo -
Make.com (bills per module + empty polls):
15,000 × 8 = 120,000 ops→ $116.47/mo -
n8n Cloud Pro (bills whole executions):
15,000 runs→ $105/mo - PikaPods Managed n8n (neutral reference): ~$3.70–$8/mo
- Hetzner CX22 4GB (neutral reference): ~$4.50/mo
- RackNerd 4GB KVM BF: $4.00/mo ($47.98/yr locked)
- Interactive 6-Way Cost & 1-Click Script Builder: https://nodebudget.dev/
3. Stopping n8n Exit Code 137 (OOMKilled) Permanently
Add these 4 variables to your docker-compose.yml alongside a 2 GB Linux swapfile:
environment:
- N8N_DEFAULT_BINARY_DATA_MODE=filesystem
- EXECUTIONS_DATA_PRUNE=true
- EXECUTIONS_DATA_MAX_AGE=168
- EXECUTIONS_DATA_PRUNE_MAX_COUNT=25000
- NODE_OPTIONS=--max-old-space-size=2048
mem_limit: 3g
- Full Exit Code 137 diagnostic guide: https://nodebudget.dev/errors/n8n-exit-code-137-oom-fix/
- Open-source Docker Compose templates (MIT): https://github.com/a895047059/stackpilot-ai-docker-templates
來源:DEV Community · dev.to