Home / Companies / SingleStore / Blog / Post Details
Content Deep Dive

Investigating Linux Performance with Off-CPU Flame Graphs

Blog post from SingleStore

Post Details
Company
Date Published
Author
Alex Reece
Word Count
884
Company Posts That Month
6
Language
English
Hacker News Points
-
Post removed?
No
Summary

The author, a performance engineer at SingleStore, encountered an uncommon Linux performance issue while running a synthetic workload on a columnstore table. The workload was using 16 threads to execute a simple query against the table, but the CPU cores were spending about 50% of their time idle. Using `perf_events` and an `awk` script, the author created an off-cpu flamegraph that revealed that every `mmap` syscall was taking around 10-20ms due to contention on the `mm->mmap_sem` lock. The issue was caused by SingleStore's use of `mmap`, which was inadvertently benchmarking Linux's `mmap` functionality, leading to significant performance overhead. To resolve the issue, the author switched from using `mmap` to the traditional file `read` interface, resulting in nearly doubled throughput and becoming CPU bound as expected.

Trends Found in this Post

No tracked trend matches for this post yet.

Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.