Profile picture
, 7 tweets, 2 min read Read on Twitter
Redis threaded I/O small (sic) thread. So results confirmed, works great in the write side, I'll have to implement it in the read side as well. Using 4 threads it is simple to get 2x the performances of single-threaded Redis (even if yet the reading part is not threaded).
So, what's the idea here? Some people say that Redis should be threaded, a few created forks that are quite more complex. But the reality is that Redis uses a lot of time just in the reading/writing part (to the socket and in the client structure).
So... 1.5 years ago I started this project (first commit 2d546a79 is Oct 24 2017!) with this idea: Instead of making Redis threaded I just "fan out" to N threads once I need to write to (or read from) N clients.
No complexity, but most of the advantages, because the *majority* of time Redis spends is there. However the tricky part is: don't lose the advantage in threads synchronization. But with _Atomic it is possible to do many magics.
However initially (1.5 years ago) I used trivial synchronization primitives and gave up for lack of time. I tried again this time more motivated and now it works great. Next step? Threading the read part.
I'll explain it all at Redis Conf in San Francisco, 2nd of April in my keynote, together with the other news about Redis 6 (ACLs and so forth). The code is in the threaded-io branch, and will be maintained there. Have fun improving / testing it :-D
One thing to note: to see the benefits make sure to A) make distclean; make; ./redis-server --io-threads <count>. B) also use the new threaded redis-benchmark. ./redis-benchmark --threads 8 -t get -n 10000000 or alike.
Missing some Tweet in this thread?
You can try to force a refresh.

Like this thread? Get email updates or save it to PDF!

Subscribe to ANTIREZ
Profile picture

Get real-time email alerts when new unrolls are available from this author!

This content may be removed anytime!

Twitter may remove this content at anytime, convert it as a PDF, save and print for later use!

Try unrolling a thread yourself!

how to unroll video

1) Follow Thread Reader App on Twitter so you can easily mention us!

2) Go to a Twitter thread (series of Tweets by the same owner) and mention us with a keyword "unroll" @threadreaderapp unroll

You can practice here first or read more on our help page!

Follow Us on Twitter!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just three indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3.00/month or $30.00/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!