Hacker News new | ask | show | jobs
by antirez 5632 days ago
I've no clue about MongoDB performances, and which of Redis and MongoDB is faster incrementing integers, but for sure this benchmark is completely useless, as it is actually measuring a mix of client library latency and round trip time, being it single threaded, making no assumptions about the durability requirements, and so forth.

For sure it seems like that MongoDB client library you are using has a smaller latency, perhaps it is a C library? As Redis-rb is instead written in Ruby itself.

Another huge problem of this benchmark is that it should try to increment a random key per every iteration, out of a dataset with a few millions of keys, as this is realistically what you need. You'll see how Redis with 50 clients will increment this counters 100k times per second or more without any performance degradation as the number of keys grows.

1 comments

I wouldn't say it's completely useless as it shows that Mongo is faster in a single threaded process, using the most popular ruby client of each system.

If I were writing a high-concurrency multi-threaded system to handle millions of keys at a time, Ruby would not be my first choice by far.

> it shows that Mongo is faster in a single threaded process, using the most popular ruby client of each system.

No, it doesn't. You ran 100k increments on one key and divided by time ONCE and printed the result.

Plus this was on your Macbook Pro, which is probably running a mail client, Twitter client, web browser, and hundreds of other things that could have affected the times.

Graphing the response times for each increment would be a good way to start looking at what the data really shows, instead of going by a single opaque, fairly useless number.

I have to agree with antirez here and call shenanigans. "WOW, MongoDB is almost a full 40% faster at incrementing than Redis" is simply a false statement. The correct conclusion for your post is "WOW, incrementing the same key 100k times with the mongo ruby gem in a very specific, single-threaded ruby application is 40% faster than incrementing one key 100k times with the redis ruby gem the in that same ruby application." If anyone makes a decision about a real world application based on your post, they will be making a huge mistake.
Check this comment: http://news.ycombinator.com/item?id=2103945

it could even be a dummy server just replying +OK and the result will not change.

You should try this against MySQL too, and you'll see similar numbers, for sure not an order of magnitude different than that even if SQL involves much more query processing and so forth.

Ok, I agree with antriz's statement. My results are very specific. I will make note and be sure to be very thorough next time around.
Thanks for agreeing, however I must point out that since your blog post does not accept comments, nor you rectified the content, this is misleading information that will stay on the internet for virtually many years to come.