nodebudget-vps-bench 1.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,13 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Yuanqiang Leng (NodeBudget)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
@@ -0,0 +1,81 @@
1
+ Metadata-Version: 2.4
2
+ Name: nodebudget-vps-bench
3
+ Version: 1.1.0
4
+ Summary: Zero-dependency Linux VPS & mini PC benchmark CLI measuring non-cached 4K fsync tail latency (P50/P95/P99/Max) and 12-worker SQLite DELETE vs WAL concurrency for n8n, PostgreSQL, and AI agents.
5
+ Author-email: Yuanqiang Leng <hello@lyq705.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://nodebudget.dev/
8
+ Project-URL: Documentation, https://nodebudget.dev/benchmarks/
9
+ Project-URL: Repository, https://github.com/a895047059/nodebudget-vps-bench
10
+ Project-URL: Cost & Break-Even Calculator, https://nodebudget.dev/tools/llm-api-vs-local-vs-gpu/
11
+ Project-URL: VRAM & Mini PC Fit Checker, https://nodebudget.dev/tools/local-llm-vram-mini-pc-checker/
12
+ Project-URL: Bug Tracker, https://github.com/a895047059/nodebudget-vps-bench/issues
13
+ Keywords: vps,benchmark,fsync,sqlite,n8n,self-hosted,ai-agents,postgresql,homelab
14
+ Classifier: Development Status :: 5 - Production/Stable
15
+ Classifier: Environment :: Console
16
+ Classifier: Intended Audience :: Developers
17
+ Classifier: Intended Audience :: System Administrators
18
+ Classifier: Operating System :: POSIX :: Linux
19
+ Classifier: Operating System :: MacOS
20
+ Classifier: Programming Language :: Python :: 3
21
+ Classifier: Programming Language :: Python :: 3.9
22
+ Classifier: Programming Language :: Python :: 3.10
23
+ Classifier: Programming Language :: Python :: 3.11
24
+ Classifier: Programming Language :: Python :: 3.12
25
+ Classifier: Topic :: System :: Benchmark
26
+ Classifier: Topic :: System :: Systems Administration
27
+ Requires-Python: >=3.9
28
+ Description-Content-Type: text/markdown
29
+ License-File: LICENSE
30
+ Dynamic: license-file
31
+
32
+ # nodebudget-vps-bench
33
+
34
+ Zero-dependency Python 3 benchmark CLI built by [NodeBudget](https://nodebudget.dev/) to measure what **actually** matters for self-hosted **n8n**, **OpenClaw**, **LiteLLM**, **PostgreSQL 16**, and **24/7 AI Agents** on budget KVM VPS nodes and local mini PCs.
35
+
36
+ > Why? Because cached `dd if=/dev/zero` benchmarks measure RAM page cache, not durable PostgreSQL WAL commits or multi-tenant noisy-neighbor tail spikes.
37
+
38
+ ## Install & Quick Run (Zero Dependencies)
39
+
40
+ Install via pip (or run directly with Python 3):
41
+
42
+ ```bash
43
+ pip install nodebudget-vps-bench
44
+ nodebudget-bench --ops 500 --workers 12
45
+ ```
46
+
47
+ Or run directly in 15 seconds without installing anything:
48
+
49
+ ```bash
50
+ curl -fsSL https://raw.githubusercontent.com/a895047059/nodebudget-vps-bench/main/nb_bench.py | python3 -
51
+ ```
52
+
53
+ Machine-readable JSON output for CI or fleet audits:
54
+
55
+ ```bash
56
+ nodebudget-bench --ops 500 --workers 12 --json
57
+ ```
58
+
59
+ ## Reference Measurements (Live 3-vCPU Xeon E5-2680 v4 · Linux 6.8 KVM)
60
+
61
+ | Metric | Measured Result | Engineering Takeaway |
62
+ | --- | --- | --- |
63
+ | Non-cached 4K random `pwrite` + `fsync` (500 ops) | **P50 `0.659 ms` · P99 `1.289 ms` · Max `7.692 ms`** | Noisy-neighbor tail spike is 11.7× median; harmless to Postgres WAL, fatal to SQLite locks |
64
+ | 12-worker webhook burst — SQLite `DELETE` | **64 / 300 failed (`21.3%` `SQLITE_BUSY`)** | Silent webhook drops under modest concurrency |
65
+ | 12-worker webhook burst — SQLite `WAL` | **32 / 300 failed (`10.7%` `SQLITE_BUSY`)** | Even WAL fails >10% of concurrent 4 KB writes |
66
+ | Live PostgreSQL 16 (same node) | **0% lock failures · `31 MB` primary idle RSS** | Always use PostgreSQL 16 for self-hosted n8n & LiteLLM |
67
+
68
+ ## Interactive Engineering Tools & Decision Specs (NodeBudget)
69
+
70
+ - **Claude Max ($100/$200) Worth-It Calculator**: https://nodebudget.dev/tools/claude-max-worth-it-calculator/
71
+ - **Local LLM VRAM & Mini PC Fit Checker**: https://nodebudget.dev/tools/local-llm-vram-mini-pc-checker/
72
+ - **MCP Token Overhead & LiteLLM VPS Payback Calculator**: https://nodebudget.dev/tools/mcp-token-overhead-calculator/
73
+ - **LLM API vs On-Demand GPU Cloud vs Local AI Box Calculator**: https://nodebudget.dev/tools/llm-api-vs-local-vs-gpu/
74
+ - **10 Hardware & Agent VPS Decision Spec Sheets**: https://nodebudget.dev/specs/
75
+ - **Interactive 6-Way VPS Cost & 1-Click Docker Compose Builder**: https://nodebudget.dev/
76
+ - **Full 4K fsync Tail Latency & SQLite Lock Study**: https://nodebudget.dev/guides/why-cheap-vps-benchmarks-lie/
77
+ - **First-Party Linux 6.8 Telemetry JSON Dataset**: https://nodebudget.dev/benchmarks/2026-11-telemetry.json
78
+
79
+ ## License
80
+
81
+ MIT
@@ -0,0 +1,50 @@
1
+ # nodebudget-vps-bench
2
+
3
+ Zero-dependency Python 3 benchmark CLI built by [NodeBudget](https://nodebudget.dev/) to measure what **actually** matters for self-hosted **n8n**, **OpenClaw**, **LiteLLM**, **PostgreSQL 16**, and **24/7 AI Agents** on budget KVM VPS nodes and local mini PCs.
4
+
5
+ > Why? Because cached `dd if=/dev/zero` benchmarks measure RAM page cache, not durable PostgreSQL WAL commits or multi-tenant noisy-neighbor tail spikes.
6
+
7
+ ## Install & Quick Run (Zero Dependencies)
8
+
9
+ Install via pip (or run directly with Python 3):
10
+
11
+ ```bash
12
+ pip install nodebudget-vps-bench
13
+ nodebudget-bench --ops 500 --workers 12
14
+ ```
15
+
16
+ Or run directly in 15 seconds without installing anything:
17
+
18
+ ```bash
19
+ curl -fsSL https://raw.githubusercontent.com/a895047059/nodebudget-vps-bench/main/nb_bench.py | python3 -
20
+ ```
21
+
22
+ Machine-readable JSON output for CI or fleet audits:
23
+
24
+ ```bash
25
+ nodebudget-bench --ops 500 --workers 12 --json
26
+ ```
27
+
28
+ ## Reference Measurements (Live 3-vCPU Xeon E5-2680 v4 · Linux 6.8 KVM)
29
+
30
+ | Metric | Measured Result | Engineering Takeaway |
31
+ | --- | --- | --- |
32
+ | Non-cached 4K random `pwrite` + `fsync` (500 ops) | **P50 `0.659 ms` · P99 `1.289 ms` · Max `7.692 ms`** | Noisy-neighbor tail spike is 11.7× median; harmless to Postgres WAL, fatal to SQLite locks |
33
+ | 12-worker webhook burst — SQLite `DELETE` | **64 / 300 failed (`21.3%` `SQLITE_BUSY`)** | Silent webhook drops under modest concurrency |
34
+ | 12-worker webhook burst — SQLite `WAL` | **32 / 300 failed (`10.7%` `SQLITE_BUSY`)** | Even WAL fails >10% of concurrent 4 KB writes |
35
+ | Live PostgreSQL 16 (same node) | **0% lock failures · `31 MB` primary idle RSS** | Always use PostgreSQL 16 for self-hosted n8n & LiteLLM |
36
+
37
+ ## Interactive Engineering Tools & Decision Specs (NodeBudget)
38
+
39
+ - **Claude Max ($100/$200) Worth-It Calculator**: https://nodebudget.dev/tools/claude-max-worth-it-calculator/
40
+ - **Local LLM VRAM & Mini PC Fit Checker**: https://nodebudget.dev/tools/local-llm-vram-mini-pc-checker/
41
+ - **MCP Token Overhead & LiteLLM VPS Payback Calculator**: https://nodebudget.dev/tools/mcp-token-overhead-calculator/
42
+ - **LLM API vs On-Demand GPU Cloud vs Local AI Box Calculator**: https://nodebudget.dev/tools/llm-api-vs-local-vs-gpu/
43
+ - **10 Hardware & Agent VPS Decision Spec Sheets**: https://nodebudget.dev/specs/
44
+ - **Interactive 6-Way VPS Cost & 1-Click Docker Compose Builder**: https://nodebudget.dev/
45
+ - **Full 4K fsync Tail Latency & SQLite Lock Study**: https://nodebudget.dev/guides/why-cheap-vps-benchmarks-lie/
46
+ - **First-Party Linux 6.8 Telemetry JSON Dataset**: https://nodebudget.dev/benchmarks/2026-11-telemetry.json
47
+
48
+ ## License
49
+
50
+ MIT
@@ -0,0 +1,44 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "nodebudget-vps-bench"
7
+ version = "1.1.0"
8
+ description = "Zero-dependency Linux VPS & mini PC benchmark CLI measuring non-cached 4K fsync tail latency (P50/P95/P99/Max) and 12-worker SQLite DELETE vs WAL concurrency for n8n, PostgreSQL, and AI agents."
9
+ readme = "README.md"
10
+ license = "MIT"
11
+ license-files = ["LICENSE"]
12
+ authors = [{ name = "Yuanqiang Leng", email = "hello@lyq705.com" }]
13
+ requires-python = ">=3.9"
14
+ keywords = ["vps", "benchmark", "fsync", "sqlite", "n8n", "self-hosted", "ai-agents", "postgresql", "homelab"]
15
+ classifiers = [
16
+ "Development Status :: 5 - Production/Stable",
17
+ "Environment :: Console",
18
+ "Intended Audience :: Developers",
19
+ "Intended Audience :: System Administrators",
20
+ "Operating System :: POSIX :: Linux",
21
+ "Operating System :: MacOS",
22
+ "Programming Language :: Python :: 3",
23
+ "Programming Language :: Python :: 3.9",
24
+ "Programming Language :: Python :: 3.10",
25
+ "Programming Language :: Python :: 3.11",
26
+ "Programming Language :: Python :: 3.12",
27
+ "Topic :: System :: Benchmark",
28
+ "Topic :: System :: Systems Administration",
29
+ ]
30
+
31
+ [project.urls]
32
+ Homepage = "https://nodebudget.dev/"
33
+ Documentation = "https://nodebudget.dev/benchmarks/"
34
+ Repository = "https://github.com/a895047059/nodebudget-vps-bench"
35
+ "Cost & Break-Even Calculator" = "https://nodebudget.dev/tools/llm-api-vs-local-vs-gpu/"
36
+ "VRAM & Mini PC Fit Checker" = "https://nodebudget.dev/tools/local-llm-vram-mini-pc-checker/"
37
+ "Bug Tracker" = "https://github.com/a895047059/nodebudget-vps-bench/issues"
38
+
39
+ [project.scripts]
40
+ nodebudget-bench = "nodebudget_vps_bench.cli:main"
41
+ nb-bench = "nodebudget_vps_bench.cli:main"
42
+
43
+ [tool.setuptools.packages.find]
44
+ where = ["src"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,7 @@
1
+ """nodebudget-vps-bench: Zero-dependency VPS & mini PC 4K fsync + SQLite contention probe."""
2
+
3
+ __version__ = "1.1.0"
4
+
5
+ from .cli import bench_4k_fsync, bench_sqlite_burst, main
6
+
7
+ __all__ = ["__version__", "bench_4k_fsync", "bench_sqlite_burst", "main"]
@@ -0,0 +1,172 @@
1
+ """CLI entry point for nodebudget-vps-bench.
2
+
3
+ Zero-dependency Python 3 benchmark measuring:
4
+ 1) Non-cached 4K random pwrite + fsync tail latency (P50 / P95 / P99 / Max / IOPS)
5
+ 2) Concurrent multi-worker SQLite DELETE vs WAL webhook write failure rate (SQLITE_BUSY)
6
+
7
+ Reference Linux 6.8 telemetry & interactive calculators:
8
+ https://nodebudget.dev/benchmarks/
9
+ https://nodebudget.dev/guides/why-cheap-vps-benchmarks-lie/
10
+ """
11
+
12
+ from __future__ import annotations
13
+
14
+ import argparse
15
+ import json
16
+ import os
17
+ import platform
18
+ import random
19
+ import sqlite3
20
+ import statistics
21
+ import tempfile
22
+ import threading
23
+ import time
24
+ from typing import Any, Dict
25
+
26
+ __version__ = "1.1.0"
27
+
28
+
29
+ def bench_4k_fsync(ops: int = 500, size_mb: int = 16, work_dir: str | None = None) -> Dict[str, Any]:
30
+ if ops < 1:
31
+ raise ValueError("ops must be >= 1")
32
+ if size_mb < 1:
33
+ raise ValueError("size_mb must be >= 1")
34
+ target_dir = work_dir or tempfile.gettempdir()
35
+ fd, probe_path = tempfile.mkstemp(prefix="nodebudget_4k_", suffix=".bin", dir=target_dir)
36
+ size = size_mb * 1024 * 1024
37
+ os.ftruncate(fd, size)
38
+ block = os.urandom(4096)
39
+ rng = random.Random(20261126)
40
+ lats: list[float] = []
41
+ try:
42
+ for _ in range(ops):
43
+ off = rng.randrange(0, size - 4096, 4096)
44
+ t0 = time.perf_counter()
45
+ os.pwrite(fd, block, off)
46
+ os.fsync(fd)
47
+ lats.append((time.perf_counter() - t0) * 1000.0)
48
+ finally:
49
+ os.close(fd)
50
+ if os.path.exists(probe_path):
51
+ os.unlink(probe_path)
52
+
53
+ s = sorted(lats)
54
+ pct = lambda p: round(s[min(len(s) - 1, int(round((p / 100.0) * (len(s) - 1))))], 3)
55
+ total_sec = max(sum(s) / 1000.0, 1e-6)
56
+ return {
57
+ "ops": ops,
58
+ "avg_ms": round(statistics.mean(s), 3),
59
+ "p50_ms": pct(50),
60
+ "p95_ms": pct(95),
61
+ "p99_ms": pct(99),
62
+ "max_ms": round(s[-1], 3),
63
+ "iops": round(ops / total_sec, 1),
64
+ }
65
+
66
+
67
+ def bench_sqlite_burst(
68
+ mode: str = "WAL",
69
+ workers: int = 12,
70
+ writes_per_worker: int = 25,
71
+ work_dir: str | None = None,
72
+ ) -> Dict[str, Any]:
73
+ if mode not in ("DELETE", "WAL"):
74
+ raise ValueError("mode must be DELETE or WAL")
75
+ if workers < 1 or writes_per_worker < 1:
76
+ raise ValueError("workers and writes_per_worker must be >= 1")
77
+
78
+ target_dir = work_dir or tempfile.gettempdir()
79
+ fd, db_path = tempfile.mkstemp(prefix=f"nodebudget_sq_{mode}_", suffix=".db", dir=target_dir)
80
+ os.close(fd)
81
+ con = sqlite3.connect(db_path)
82
+ con.execute(f"PRAGMA journal_mode={mode}")
83
+ con.execute("CREATE TABLE execs (id INTEGER PRIMARY KEY AUTOINCREMENT, payload TEXT, ts REAL)")
84
+ con.commit()
85
+ con.close()
86
+
87
+ ok = 0
88
+ errors = 0
89
+ lock = threading.Lock()
90
+ t0 = time.perf_counter()
91
+
92
+ def run() -> None:
93
+ nonlocal ok, errors
94
+ payload = "x" * 4096
95
+ for _ in range(writes_per_worker):
96
+ try:
97
+ c = sqlite3.connect(db_path, timeout=0.05)
98
+ c.execute("INSERT INTO execs(payload, ts) VALUES (?, ?)", (payload, time.time()))
99
+ c.commit()
100
+ c.close()
101
+ with lock:
102
+ ok += 1
103
+ except sqlite3.OperationalError:
104
+ with lock:
105
+ errors += 1
106
+
107
+ threads = [threading.Thread(target=run) for _ in range(workers)]
108
+ for t in threads:
109
+ t.start()
110
+ for t in threads:
111
+ t.join()
112
+
113
+ dur_ms = round((time.perf_counter() - t0) * 1000.0, 1)
114
+ for ext in ("", "-wal", "-shm"):
115
+ if os.path.exists(db_path + ext):
116
+ os.unlink(db_path + ext)
117
+
118
+ total = workers * writes_per_worker
119
+ return {
120
+ "mode": mode,
121
+ "attempted": total,
122
+ "ok": ok,
123
+ "sqlite_busy_errors": errors,
124
+ "failure_pct": round(errors / total * 100.0, 1),
125
+ "duration_ms": dur_ms,
126
+ }
127
+
128
+
129
+ def main(argv: list[str] | None = None) -> int:
130
+ ap = argparse.ArgumentParser(
131
+ prog="nodebudget-bench",
132
+ description="NodeBudget Linux VPS & mini PC 4K fsync + SQLite contention probe",
133
+ )
134
+ ap.add_argument("--ops", type=int, default=500, help="4K random fsync ops (default: 500)")
135
+ ap.add_argument("--size-mb", type=int, default=16, help="Probe file size in MiB (default: 16)")
136
+ ap.add_argument("--workers", type=int, default=12, help="Concurrent SQLite webhook writers (default: 12)")
137
+ ap.add_argument("--writes", type=int, default=25, help="Writes per worker (default: 25)")
138
+ ap.add_argument("--dir", dest="work_dir", default=None, help="Directory for temporary probe files")
139
+ ap.add_argument("--json", action="store_true", help="Output machine-readable JSON")
140
+ ap.add_argument("--version", action="version", version=f"%(prog)s {__version__}")
141
+ args = ap.parse_args(argv)
142
+
143
+ result = {
144
+ "tool": "nodebudget-vps-bench",
145
+ "version": __version__,
146
+ "platform": f"{platform.system()} {platform.release()} ({platform.machine()})",
147
+ "reference": "https://nodebudget.dev/guides/why-cheap-vps-benchmarks-lie/",
148
+ "fsync_4k": bench_4k_fsync(args.ops, args.size_mb, args.work_dir),
149
+ "sqlite_delete": bench_sqlite_burst("DELETE", args.workers, args.writes, args.work_dir),
150
+ "sqlite_wal": bench_sqlite_burst("WAL", args.workers, args.writes, args.work_dir),
151
+ }
152
+ if args.json:
153
+ print(json.dumps(result, indent=2))
154
+ return 0
155
+
156
+ f = result["fsync_4k"]
157
+ print(
158
+ f"[4K-fsync] ops={f['ops']} avg={f['avg_ms']}ms p50={f['p50_ms']}ms "
159
+ f"p95={f['p95_ms']}ms p99={f['p99_ms']}ms max={f['max_ms']}ms iops={f['iops']}"
160
+ )
161
+ for k in ("sqlite_delete", "sqlite_wal"):
162
+ sq = result[k]
163
+ print(
164
+ f"[sqlite:{sq['mode']}] attempted={sq['attempted']} ok={sq['ok']} "
165
+ f"SQLITE_BUSY={sq['sqlite_busy_errors']} ({sq['failure_pct']}% failed) dur={sq['duration_ms']}ms"
166
+ )
167
+ print("Compare against live Linux 6.8 reference nodes & calculators -> https://nodebudget.dev/benchmarks/")
168
+ return 0
169
+
170
+
171
+ if __name__ == "__main__":
172
+ raise SystemExit(main())
@@ -0,0 +1,81 @@
1
+ Metadata-Version: 2.4
2
+ Name: nodebudget-vps-bench
3
+ Version: 1.1.0
4
+ Summary: Zero-dependency Linux VPS & mini PC benchmark CLI measuring non-cached 4K fsync tail latency (P50/P95/P99/Max) and 12-worker SQLite DELETE vs WAL concurrency for n8n, PostgreSQL, and AI agents.
5
+ Author-email: Yuanqiang Leng <hello@lyq705.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://nodebudget.dev/
8
+ Project-URL: Documentation, https://nodebudget.dev/benchmarks/
9
+ Project-URL: Repository, https://github.com/a895047059/nodebudget-vps-bench
10
+ Project-URL: Cost & Break-Even Calculator, https://nodebudget.dev/tools/llm-api-vs-local-vs-gpu/
11
+ Project-URL: VRAM & Mini PC Fit Checker, https://nodebudget.dev/tools/local-llm-vram-mini-pc-checker/
12
+ Project-URL: Bug Tracker, https://github.com/a895047059/nodebudget-vps-bench/issues
13
+ Keywords: vps,benchmark,fsync,sqlite,n8n,self-hosted,ai-agents,postgresql,homelab
14
+ Classifier: Development Status :: 5 - Production/Stable
15
+ Classifier: Environment :: Console
16
+ Classifier: Intended Audience :: Developers
17
+ Classifier: Intended Audience :: System Administrators
18
+ Classifier: Operating System :: POSIX :: Linux
19
+ Classifier: Operating System :: MacOS
20
+ Classifier: Programming Language :: Python :: 3
21
+ Classifier: Programming Language :: Python :: 3.9
22
+ Classifier: Programming Language :: Python :: 3.10
23
+ Classifier: Programming Language :: Python :: 3.11
24
+ Classifier: Programming Language :: Python :: 3.12
25
+ Classifier: Topic :: System :: Benchmark
26
+ Classifier: Topic :: System :: Systems Administration
27
+ Requires-Python: >=3.9
28
+ Description-Content-Type: text/markdown
29
+ License-File: LICENSE
30
+ Dynamic: license-file
31
+
32
+ # nodebudget-vps-bench
33
+
34
+ Zero-dependency Python 3 benchmark CLI built by [NodeBudget](https://nodebudget.dev/) to measure what **actually** matters for self-hosted **n8n**, **OpenClaw**, **LiteLLM**, **PostgreSQL 16**, and **24/7 AI Agents** on budget KVM VPS nodes and local mini PCs.
35
+
36
+ > Why? Because cached `dd if=/dev/zero` benchmarks measure RAM page cache, not durable PostgreSQL WAL commits or multi-tenant noisy-neighbor tail spikes.
37
+
38
+ ## Install & Quick Run (Zero Dependencies)
39
+
40
+ Install via pip (or run directly with Python 3):
41
+
42
+ ```bash
43
+ pip install nodebudget-vps-bench
44
+ nodebudget-bench --ops 500 --workers 12
45
+ ```
46
+
47
+ Or run directly in 15 seconds without installing anything:
48
+
49
+ ```bash
50
+ curl -fsSL https://raw.githubusercontent.com/a895047059/nodebudget-vps-bench/main/nb_bench.py | python3 -
51
+ ```
52
+
53
+ Machine-readable JSON output for CI or fleet audits:
54
+
55
+ ```bash
56
+ nodebudget-bench --ops 500 --workers 12 --json
57
+ ```
58
+
59
+ ## Reference Measurements (Live 3-vCPU Xeon E5-2680 v4 · Linux 6.8 KVM)
60
+
61
+ | Metric | Measured Result | Engineering Takeaway |
62
+ | --- | --- | --- |
63
+ | Non-cached 4K random `pwrite` + `fsync` (500 ops) | **P50 `0.659 ms` · P99 `1.289 ms` · Max `7.692 ms`** | Noisy-neighbor tail spike is 11.7× median; harmless to Postgres WAL, fatal to SQLite locks |
64
+ | 12-worker webhook burst — SQLite `DELETE` | **64 / 300 failed (`21.3%` `SQLITE_BUSY`)** | Silent webhook drops under modest concurrency |
65
+ | 12-worker webhook burst — SQLite `WAL` | **32 / 300 failed (`10.7%` `SQLITE_BUSY`)** | Even WAL fails >10% of concurrent 4 KB writes |
66
+ | Live PostgreSQL 16 (same node) | **0% lock failures · `31 MB` primary idle RSS** | Always use PostgreSQL 16 for self-hosted n8n & LiteLLM |
67
+
68
+ ## Interactive Engineering Tools & Decision Specs (NodeBudget)
69
+
70
+ - **Claude Max ($100/$200) Worth-It Calculator**: https://nodebudget.dev/tools/claude-max-worth-it-calculator/
71
+ - **Local LLM VRAM & Mini PC Fit Checker**: https://nodebudget.dev/tools/local-llm-vram-mini-pc-checker/
72
+ - **MCP Token Overhead & LiteLLM VPS Payback Calculator**: https://nodebudget.dev/tools/mcp-token-overhead-calculator/
73
+ - **LLM API vs On-Demand GPU Cloud vs Local AI Box Calculator**: https://nodebudget.dev/tools/llm-api-vs-local-vs-gpu/
74
+ - **10 Hardware & Agent VPS Decision Spec Sheets**: https://nodebudget.dev/specs/
75
+ - **Interactive 6-Way VPS Cost & 1-Click Docker Compose Builder**: https://nodebudget.dev/
76
+ - **Full 4K fsync Tail Latency & SQLite Lock Study**: https://nodebudget.dev/guides/why-cheap-vps-benchmarks-lie/
77
+ - **First-Party Linux 6.8 Telemetry JSON Dataset**: https://nodebudget.dev/benchmarks/2026-11-telemetry.json
78
+
79
+ ## License
80
+
81
+ MIT
@@ -0,0 +1,11 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ src/nodebudget_vps_bench/__init__.py
5
+ src/nodebudget_vps_bench/cli.py
6
+ src/nodebudget_vps_bench.egg-info/PKG-INFO
7
+ src/nodebudget_vps_bench.egg-info/SOURCES.txt
8
+ src/nodebudget_vps_bench.egg-info/dependency_links.txt
9
+ src/nodebudget_vps_bench.egg-info/entry_points.txt
10
+ src/nodebudget_vps_bench.egg-info/top_level.txt
11
+ tests/test_bench.py
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ nb-bench = nodebudget_vps_bench.cli:main
3
+ nodebudget-bench = nodebudget_vps_bench.cli:main
@@ -0,0 +1,37 @@
1
+ import json
2
+ import subprocess
3
+ import sys
4
+ from pathlib import Path
5
+
6
+ from nodebudget_vps_bench import __version__, bench_4k_fsync, bench_sqlite_burst
7
+
8
+
9
+ def test_4k_fsync_probe(tmp_path: Path) -> None:
10
+ res = bench_4k_fsync(ops=25, size_mb=2, work_dir=str(tmp_path))
11
+ assert res["ops"] == 25
12
+ assert res["p50_ms"] >= 0
13
+ assert res["p99_ms"] >= res["p50_ms"]
14
+ assert res["max_ms"] >= res["p99_ms"]
15
+ assert res["iops"] > 0
16
+
17
+
18
+ def test_sqlite_burst_modes(tmp_path: Path) -> None:
19
+ for mode in ("DELETE", "WAL"):
20
+ res = bench_sqlite_burst(mode=mode, workers=4, writes_per_worker=10, work_dir=str(tmp_path))
21
+ assert res["mode"] == mode
22
+ assert res["attempted"] == 40
23
+ assert res["ok"] + res["sqlite_busy_errors"] == 40
24
+
25
+
26
+ def test_cli_json_output(tmp_path: Path) -> None:
27
+ proc = subprocess.run(
28
+ [sys.executable, "-m", "nodebudget_vps_bench.cli", "--ops", "15", "--size-mb", "2", "--workers", "3", "--writes", "5", "--dir", str(tmp_path), "--json"],
29
+ check=True,
30
+ capture_output=True,
31
+ text=True,
32
+ )
33
+ data = json.loads(proc.stdout)
34
+ assert data["tool"] == "nodebudget-vps-bench"
35
+ assert data["version"] == __version__
36
+ assert data["fsync_4k"]["ops"] == 15
37
+ assert data["sqlite_wal"]["attempted"] == 15