惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

IT之家
IT之家
The GitHub Blog
The GitHub Blog
F
Fortinet All Blogs
Last Week in AI
Last Week in AI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
L
LangChain Blog
爱范儿
爱范儿
博客园_首页
Stack Overflow Blog
Stack Overflow Blog
MongoDB | Blog
MongoDB | Blog
博客园 - 三生石上(FineUI控件)
大猫的无限游戏
大猫的无限游戏
宝玉的分享
宝玉的分享
GbyAI
GbyAI
H
Help Net Security
A
About on SuperTechFans
Recent Announcements
Recent Announcements
Hugging Face - Blog
Hugging Face - Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
雷峰网
雷峰网
D
Docker
博客园 - Franky
有赞技术团队
有赞技术团队
G
Google Developers Blog

Hacker News: Show HN

PurrrrrFocus: Pomodoro Timer App - App Store Workflow Engine — Multi-Step Orchestration for Bun RapidPhoto: Pro Photo Editor App - App Store GitHub - DheerG/swarms: Achieve extraordinary results with claude code across a variety of tasks SPICE simulation → oscilloscope → verification with Claude Code — Lucas Gerads Show HN: VCoding – A 5 MB native Windows IDE with no dynamic dependencies Show HN: LLMs don't hallucinate because they're bad at math, it's the format GitHub - Agent-FM/agentfm-core: AgentFM is a peer-to-peer network that turns everyday computers into a decentralized AI supercomputer. AgentFM lets you run massive AI workloads directly across a global mesh of idle CPUs and GPUs. Show HN: Tracking Top US Science Olympiad Alumni over Last 25 Years GitHub - Potarix/agent-hub: One place to talk to all your agents Show HN: Runtime security for AI agents(injection,tool abuse, data exfiltration) GitHub - dubeyKartikay/lazyspotify: Terminal Spotify client for macOS and Linux GitHub - the-banana-tool/king-louie: Easy to use GUI Personal AI Assistant. Win/Linux/Mac. Show HN I made my vacation rental bookable by AI agents–no Airbnb, 0% commission GitHub - basteez/jsf-autoreload: maven plugin to enable hot reload on jsf projects uvm32/hosts/host-gdbstub at main · ringtailsoftware/uvm32 GitHub - labsai/EDDI: Config-driven engine that turns JSON into production-grade AI agents. Multi-agent orchestration, 12+ LLM providers, MCP/A2A protocols, RAG, persistent memory, and enterprise compliance (EU AI Act, GDPR, HIPAA). Built on Quarkus. GitHub - glitchnsec/fortyone-oss: AI Executive Assistant Platform Quickstart | Alien GitHub - muxshed/shed: One stream in, or many. Every destination, simultaneously. No cloud middleman, no per-channel fees, no limits. GitHub - ocrbase-hq/ocrbase: 📄 PDF/IMG ->.MD/JSON Document OCR API for PaddleOCR and GLMOCR. Self-hostable. GitHub - impactjo/home-memory: MCP server that lets your AI assistant remember everything about your home. GitHub - Sets88/dbcls: DbCls is a powerful terminal database client that supports various databases GitHub - neptun2000/heor-agent-mcp GitHub - SeanFDZ/macmind: Single-layer transformer in HyperTalk for the classic Macintosh RollQuation: Math Puzzles - Apps on Google Play GitHub - dropbox/witchcraft Show HN: Agent-cache – Multi-tier LLM/tool/session caching for Valkey and Redis GitHub - opentalon/opentalon: OpenTalon is an open-source platform built from the ground up in Go as a robust alternative to OpenClaw LinkedIn™ 职位抓取工具 - Chrome 应用商店
Real-workload SQLite benchmark on a $5 VPS
s13k · 2026-05-09 · via Hacker News: Show HN

← s13k.dev

2026-05-09 · s13k

I ordered the cheapest Hetzner CX23 ($4.99/mo, shared-resources tier) and ran a real-workload SQLite benchmark on it. Not a microbenchmark — a 6 GB database on a box with 3.7 GB of RAM, so reads actually have to touch disk.

The box

Shared vCPUs with noisy neighbors:

  • 2 vCPU Intel Xeon Skylake @ 2.1 GHz
  • 3.7 GiB RAM, no swap
  • 38 GB ext4 (noatime), scheduler=none
  • Debian 13

Latest SQLite 3.53.1, statically linked into a C bench.

SQLite config

Production-realistic pragmas — not turned-up-to-eleven:

journal_mode   = WAL
synchronous    = NORMAL      -- safe, not strict-ACID durable
page_size      = 8192
cache_size     = 256 MiB
mmap_size      = 256 MiB
temp_store     = MEMORY
busy_timeout   = 5000

One caveat worth being explicit about: synchronous=NORMAL is not durable in the strict ACID sense. A power loss can roll back the last few committed transactions — whatever was in the WAL but not yet fsync'd to the main DB file. The database file itself will not corrupt — corruption is what synchronous=OFF risks; FULL avoids the loss entirely; NORMAL only loses the tail. For most apps that's a fine trade for the speedup. If you can't afford to lose any committed write — payments, audit logs — use synchronous=FULL.

WAL also matters for the concurrency numbers below: readers don't block the writer and the writer doesn't block readers, which is why concurrent reads scale almost linearly across cores while writes still serialize.

The workload

  • Schema: PK + 2 indexed int columns + 500 B text payload
  • 10M rows ≈ 6 GB DB > 3.7 GB RAM → real disk I/O
  • 8 phases (incl. concurrent 4R + 1W), 4 samples each, medians reported
  • Shared CPU = 15–30% noise floor

Disk-bound results (~6 GB DB > RAM)

Phase Throughput p50 p95 p99 p999
BULK INSERT 10M × 500B 61,300/s 8 µs 58 µs 80 µs 143 µs
SELECT random PK 3,609/s 265 µs 476 µs 715 µs 2.3 ms
SELECT indexed range scan 3,477/s 290 µs 599 µs 895 µs 2.9 ms
UPDATE per-row, 1-txn 2,986/s 257 µs 473 µs 706 µs 2.2 ms
MIXED 70R/25U/5I (OLTP) 3,915/s 257 µs 455 µs 710 µs 2.2 ms
CONCURRENT reads (4 threads, 5s) 14,396/s 162 µs 790 µs 2.2 ms 4.4 ms
CONCURRENT writes (1 thread, 5s) 3,305/s 180 µs 690 µs 1.3 ms 6.0 ms

Working set spills past RAM — every random read pays for I/O.

When the DB fits in RAM

1M rows × 200 B ≈ 246 MB — comfortably cached. This is the engine ceiling on a $5 VPS:

Phase Throughput
INSERT 1-txn (prepared bind) 124,123/s
SELECT random PK 155,828/s
SELECT indexed range 58,239/s
UPDATE per-row 1-txn 89,642/s
UPDATE bulk-join (set-update) 57,519/s
MIXED 70R/25U/5I 53,284/s
CONCURRENT reads (4 threads) 103,894/s
CONCURRENT writes (1 thread) 1,055/s

Pure CPU+lock cost, no disk in the hot path.

In-RAM vs disk-bound

Random reads drop 43× the moment the working set outgrows RAM:

Phase In-RAM DB > RAM Δ
INSERT bulk 124k/s 61k/s 0.5×
SELECT random PK 156k/s 3.6k/s 43×
SELECT range 58k/s 3.5k/s 17×
UPDATE per-row 90k/s 3.0k/s 30×
MIXED OLTP 53k/s 3.9k/s 14×
CONCURRENT reads 104k/s 14k/s
CONCURRENT writes 1.0k/s 3.3k/s 0.3×

Reads collapse. Concurrent writes go the other way — see below.

Counterintuitive: writes are faster on disk

Concurrent writes ran 3.3k/s on disk vs 1.0k/s in RAM. That looked wrong, but here's what's going on:

  • SQLite serializes writers — only one at a time, the rest queue up.
  • On disk, each write is slow because of I/O, so the waiting is cheap relative to the actual work.
  • In RAM, each write finishes in microseconds, but the locking and thread-switching needed to pass the turn around stays the same. Suddenly that overhead is bigger than the write itself.

Making writes faster doesn't help when the bottleneck is taking turns, not doing the work.

Bottom line

SQLite on the cheapest shared-CPU Hetzner handles real production load.

Realistic OLTP mix (70R / 25U / 5I): 3.9k ops/s, p99 = 710 µs, p999 = 2.2 ms.

= 14 million ops/hour on a $5 VPS, with sub-3 ms tail latency.

SQLite is enough for most of us.

Discuss on Hacker News · Discuss on 𝕏 · @s13k_