←back to thread

39 points nubskr | 1 comments | | HN request time: 0.258s | source

not able to post the link in url for some reason, here it is: https://github.com/nubskr/nubmq
Show context
pmjoe ◴[] No.43372688[source]
Is Redis using all cores or you're comparing a multi threaded implementation in Go with a single threaded one in Redis?
replies(2): >>43372749 #>>43374997 #
1. nubskr ◴[] No.43372749[source]
Redis is single-threaded for dataset-modifying commands (SET, DEL, etc.), but multi-threaded for networking and I/O. nubmq, on the other hand, is fully multi-threaded—distributing reads and writes across all cores. So yes, this is fundamentally a comparison between Go’s concurrency model and Redis’s single-threaded event loop.

For benchmarking, I used the same test script (included in the repo) for both Redis and nubmq—100 concurrent clients hammering the server with requests. The core execution models remain unchanged; only the endpoints differ. So if you're asking whether the comparison reflects actual engine throughput rather than just connection handling—yes, it does.

The real ‘secret sauce’ is how nubmq prevents bottlenecks under load. When per-shard contention spikes, it spins up a larger store in the background, shifts new writes to it, and lazily migrates keys over. No pauses, no blocking. Meanwhile, Redis has no way to redistribute the load—it just starts choking when contention builds.

Also, Redis carries Lua scripting overhead in some cases. nubmq skips all that—pure Golang, no dependencies, no interpreter overhead