-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nsqd: Use Klaus Post's compression libraries #1484
Comments
At a glance, I don't see any fundamental problem with improving performance by swapping out the dependency. Should we also expose the other compression algorithms, too? |
I think that's an excellent idea. zstd in particular has a strong appeal to it. It's especially appealing with NSQ as it seems like a common pattern is for a topic to have messages with a single, well-defined schema—variations on a theme. Dictionaries (as generated by |
Fabulous. I'll put together a PR for the dependency swap. |
Hmm, I think our original testing must have been flawed when looking at Snappy. The Klaus Post version of this seems to be slower than the Google version, and the Klaus Post Deflate doesn't reach the speed of Snappy at any level. This is what I'm getting comparing replacing Snappy & Deflate in both NSQD and the Go NSQ library
There's also an added complication that the Klaus Post Deflate compresses a little less at most levels.
I still think it's worth replacing the Deflate library, but the motivation is much less than I previously believed. WDYT? |
Meh, doesn't seem worth it? It sounds like we're saying "just use snappy"? We should land all the benchmark code improvements (I've pushed a few more up to your PR), and nsqio/go-nsq#362 though. |
We would quite like to use compression with NSQ to save on data transfer costs, but the CPU impact is higher than we'd like. Our experiments have shown that Klaus Post's compression libraries perform much better than the standard library Deflate and Google's Snappy, with the sweet spot appearing to be level 3 flate compressing our traffic to about 25% of its original size, but only incurring a CPU cost equivalent to Snappy.
Would there be any interest in taking a PR that makes this change?
The text was updated successfully, but these errors were encountered: