跳到正文
AI NEWS JOURNAL
Hacker News Show HNAI NEWS / JOURNAL

Show HN: 4K fsync tail latency and SQLite WAL lock failures on a $4/mo VPS

Article URL: https://nodebudget.dev/guides/why-cheap-vps-benchmarks-lie/ Comments URL: https://news.ycombinator.com/item?id=50662422 Points: 1 # Comments: 0

翻译服务暂未运行,当前显示原文。

Almost every cheap-VPS review prints a cached sequential `dd` number and recommends SQLite on 1–2 GB RAM. On our live 3-vCPU Xeon E5-2680 v4 KVM node (measured 2026-11-26 UTC), real 4K random fsync latency averaged 0.70 ms (P50 0.659 ms, P99 1.289 ms) with a 7.692 ms noisy-neighbor tail spike—and a modest 12-worker webhook burst triggered 21.3% SQLITE_BUSY failures in default mode and STILL 10.7% failures in WAL mode. Pair a $48/yr 4 GB KVM node with PostgreSQL 16 (31 MB RSS), and never buy an older Xeon if you need CPU LLM inference. 1. The Dirty Secret of VPS Review Blogs: Cached dd Is Theater Open ten "Best VPS for Self-Hosting n8n in 2026" posts and nine of them will show you the same screenshot: a 1 GB dd if=/dev/zero of=test bs=64k count=16k run reporting 750 MB/s or 1.4 GB/s. That number tells you almost nothing about how n8n, PostgreSQL, or an AI agent will behave at 2:00 AM when twelve webhooks hit at once. Without fsync or O_DIRECT, Linux simply copies zeroes into host page cache RAM and declares victory before a single byte hits physical flash. Meanwhile, a real automation engine commits hundreds of tiny 4 KB–16 KB JSON state updates and database WAL frames that must flush durably to disk. What kills responsiveness on budget multi-tenant KVM nodes is never sequential throughput—it is tail latency on durable 4K random writes when another tenant on the same physical hypervisor runs a backup or compaction. 2. Two Measurements on the Exact Same Node: Quiet Hours vs Multi-Tenant Load To prove why single-shot blog benchmarks mislead buyers, I ran our exact same Python 4K random pwrite + fsync probe on our live 3-vCPU Intel Xeon E5-2680 v4 KVM node (Linux 6.8.0-147-generic, 3.8 GiB RAM, 4.0 GiB swap) during two separate windows. During a quiet off-peak window, the node pushed 2,502.5 sustained 4K fsync IOPS (0.40 ms average). During an active multi-tenant evening window on 2026-11-26 at 14:26 UTC, throughput dropped to 1,429.1 IOPS with a 0.659 ms median (P50), 0.964 ms P95, 1.289 ms P99—and a single 7.692 ms noisy-neighbor spike (11.7× the median). Both numbers are real, and showing both is the difference between engineering telemetry and marketing copy. 3. Busting the "Just Turn On SQLite WAL Mode" Myth Every Reddit thread on self-hosting n8n has a confident commenter saying: "You do not need PostgreSQL for a solo setup, just keep SQLite and enable WAL mode." I used to repeat that advice too—until webhook bursts from Telegram, Stripe, and multi-agent sub-workflows started dropping silently under lock contention. On the exact same Linux 6.8 KVM node, I fired 12 concurrent worker threads writing 25 rows each (300 total 4 KB JSON payloads, 50 ms busy timeout—simulating a bursty agent fan-out or batch webhook replay). Default SQLite (DELETE journal) failed 64 of 300 writes (21.3% SQLITE_BUSY error rate) in 572.8 ms. Switching to WAL mode cut duration nearly in half (311.2 ms), yet STILL failed 32 of 300 writes—a 10.7% failure rate! Why? Because SQLite allows only ONE writer at a time regardless of WAL; combine a single-writer lock with an occasional 7.69 ms KVM fsync spike and concurrent webhooks collide. Meanwhile, look at the ps -eo comm,rss output from that exact same machine: our live PostgreSQL 16 instance occupies just 31 MB primary RSS (with lightweight helper workers around 10–25 MB) and swallows 12+ concurrent writers with zero lock failures. Saving 31 MB of RAM on a 4,096 MB server is not minimalism—it is self-sabotage. 4. The Honest Broadwell Xeon Trade-Off (Where $4/mo VPS Fails) Budget lifetime Black Friday KVM deals—like RackNerd’s $47.98/yr 4 GB tier—are inexpensive for a real engineering reason: providers amortize proven dual-socket Intel Xeon E5-2680 v4 (Broadwell) chassis with abundant ECC RAM rather than paying 2026 retail rates for EPYC Genoa. Our live single-core OpenSSL SHA-256 test on that CPU clocked 282.4 MB/s. For Docker orchestration, HTTPS reverse proxying via Caddy, PostgreSQL 16 indexing, and calling external LLM APIs (OpenAI, Claude, ElevenLabs), 282.4 MB/s is 5× more CPU than you will ever saturate—your bottleneck is 99% network wait on the LLM API. However, if your goal is running local Whisper transcription, local BGE embeddings, or quantized Ollama models on CPU, a 2016 Broadwell vCPU will crawl at unusable speeds. For local inference, skip cheap VPS nodes entirely and put that money toward a Mac mini M4 or a dedicated GPU. Buy a $48/yr 4 GB KVM VPS when your stack is I/O-bound glue: n8n + Postgres 16 + OpenClaw + external LLM APIs + Caddy TLS. Pay extra for Hetzner CX22 (~$4.50/mo, neutral non-affiliate) or DigitalOcean ($24/mo flat) when you want modern EPYC/Xeon Gold IPC, hourly billing, or private VPCs. Buy local Apple Silicon (Mac mini M4, 120 GB/s unified memory) ONLY when local 8B–14B inference or Whisper replaces recurring token bills. 5. Run This 15-Second Probe on Your Own VPS Before Trusting Anyone Never take my numbers—or any host’s marketing table—on faith. SSH into whatever VPS you are testing and run this zero-dependency Python 3 probe. It writes 500 uncached 4 KB random blocks with os.fsync, prints P50/P95/P99/Max latency, and executes the exact 12-worker SQLite burst test before cleaning up /tmp. python3 - <<'PY' import os, time, random, statistics, sqlite3, threading p = "/tmp/nb_4k_probe.bin"; sz = 16*1024*1024 fd = os.open(p, os.O_CREAT|os.O_RDWR, 0o600); os.ftruncate(fd, sz) blk = os.urandom(4096); rng = random.Random(42); lats = [] for _ in range(500): off = rng.randrange(0, sz-4096, 4096) t0 = time.perf_counter(); os.pwrite(fd, blk, off); os.fsync(fd) lats.append((time.perf_counter()-t0)*1000) os.close(fd); os.unlink(p); s = sorted(lats) print(f"4K fsync: avg={statistics.mean(s):.3f}ms p50={s[250]:.3f}ms p95={s[475]:.3f}ms p99={s[495]:.3f}ms max={s[-1]:.3f}ms iops={500/(sum(s)/1000):.1f}") PY Interactive Stack Cost & Blueprint Generator Related Engineering Deep-Dives OpenClaw vs Hermes Agent vs NanoClaw vs ZeroClaw (Nov 2026): Security Blast Radius, Real RAM Footprint & the 24/7 Heartbeat Tax Deep technical comparison of late-2026 autonomous agent harnesses (OpenClaw 2.0, Nous Hermes Agent, NanoClaw, ZeroClaw): CVE-2026-25253 lessons, real memory floors from 28 MB to 1.85 GB, and 24/7 heartbeat token burn math. Strix Halo 128GB vs Mac mini M4 Pro 48GB vs Cloud AI (Nov 2026): The 48GB 70B Trap, Context Compaction & Honest 24-Month Math Unfiltered November 2026 hardware & TCO study comparing 128GB AMD Ryzen AI Max+ 395 (GMKtec EVO-X2 / Beelink GTR9 Pro) against 48GB Mac mini M4 Pro and $55–$200/mo cloud AI stacks. The AI Agent Billing Trap: Why One Multi-Step Agent Destroys Zapier & Make Budgets (And 3 Cases Where Self-Hosting Is a Mistake) Deep financial analysis of per-step vs per-execution billing meters across Zapier, Make, n8n Cloud, Hetzner, PikaPods, RackNerd, and local Mini PCs—plus 3 real scenarios where you should NOT self-host. Anatomy of a 03:14 UTC Exit Code 137 Crash: How V8 Heaps, Binary Payloads & Default Swappiness Silently Kill AI Agents Kernel-level postmortem of why Docker restart: unless-stopped hides OOM kills, how n8n memory binary mode + V8 heap trigger SIGKILL (137), why Ubuntu vm.swappiness=60 misbehaves, and the 5-line Compose fix.

资料来源

阅读原文 ↗

相关主题

← 继续阅读全部动态