CatBench v0.3: Postgres Vector Search App Now with Performance Monitoring

2025-05-30

CatBench, a demo app using Postgres and PgVector with 25k pet photos, now features instance-wide throughput and query latency charts. Previously, users could explore a recommendation engine, view cat photos and product recommendations based on similar cat purchases, and see backend SQL query execution metrics. v0.3 adds a monitoring section displaying overall Postgres instance activity and SQL latency. Future plans include code cleanup, expanding the photo dataset to 9 million images, adding recall quality monitoring for fraud detection, and supporting other databases.

Read more

pg_test_fsync: Benchmarking Disk Write Performance for Databases

2025-05-28

This article introduces `pg_test_fsync`, a tool for quickly benchmarking disk or cloud storage write performance, particularly useful for database WAL logs and other low-latency write workloads. The author tests a consumer-grade Samsung 990 Pro SSD and an enterprise-grade Micron 7400 SSD, revealing significantly faster synchronous write speeds on the enterprise SSD due to its controller DRAM cache and power-loss protection. `fdatasync` proves faster than `fsync` or `O_SYNC`, but even `fdatasync` takes 1.6 milliseconds for a single 8kB write. The article notes that multiple small writes degrade performance, suggesting batching writes for efficiency.

Read more
Development

lsds: A One-Stop Shop for Linux Block Device Settings

2025-05-09

Managing disks and I/O on Linux often involves running multiple commands like lsblk, lsscsi, and nvme list, then manually correlating their output. To streamline this, a Python program called `lsds` was created. It directly reads information from the `/sys/class/blocks/...` directories, consolidating key disk details into a single, easy-to-read output. This includes device name, size, type, scheduler, rotational flag, model, queue depth, number of requests, and write cache settings. `lsds` is highly customizable, allowing users to specify which columns to display and providing a verbose mode for tracing information sources. This tool significantly simplifies the complexity of managing Linux disks.

Read more

11M IOPS & 66 GiB/s IO on a Single ThreadRipper Workstation: A Deep Dive

2025-05-06

This article details the configuration of an AMD ThreadRipper Pro workstation with 10 PCIe 4.0 SSDs to achieve 11M IOPS for 4kB random reads and 66 GiB/s throughput for larger IOs. The author tackles bottlenecks like RAM access and CPU limitations, delving into Linux block I/O internals and their interaction with modern hardware. The process includes hardware selection, I/O configuration (direct I/O and I/O schedulers), multi-disk testing, and BIOS settings, ultimately achieving remarkable performance.

Read more
Hardware

eBPF Pitfall: The FRED in Linux Kernel 6.9+

2025-03-01

The Linux kernel 6.9+ introduces CONFIG_X86_FRED on x86_64, adding 16 bytes of padding to the bottom of a task's kernel stack. This breaks eBPF programs directly accessing the kernel stack and pt_regs, returning garbage. The author encountered this issue with their xcapture-next eBPF tool after upgrading to kernel 6.11. Analysis revealed FRED's stack offset as the culprit. A dynamic FRED detection mechanism is presented to adjust stack address calculations, resolving the problem. This article is crucial for eBPF developers, especially those working with raw kernel stack manipulation.

Read more
Development

TracepointArgs: Unlocking Linux Kernel Tracepoints

2025-02-04

Tired of hunting through Linux kernel source code for tracepoint metadata and struct layouts? Meet tracepointargs, a new command-line tool that lists all available Linux kernel tracepoints, their arguments, datatypes, and related structs. It even parses kernel struct layouts, allowing you to understand tracepoint details without digging through source files. Combined with bpftool to generate a vmlinux.h file, you can easily inspect the internals of structures, even recursively expanding nested ones. A must-have for eBPF developers and kernel explorers!

Read more
Development