Unexpectedly Slow: A Simple Socket Benchmark Shows Linux Lagging Behind OpenBSD

2025-08-16

A simple C program creating threads and opening 256 sockets reveals a surprising performance disparity between Linux and OpenBSD. On Linux, execution times fluctuate between 17 and 26 milliseconds; on OpenBSD, they're a mere 2 to 6 milliseconds. Adding to the intrigue, OpenBSD initially threw a "too many open files" error, hinting at differences in resource management. The author notes the discrepancy isn't related to networking code and challenges readers to find a Linux system that outperforms OpenBSD in this benchmark.

Development OS Performance