News for hackers. Stuff that matters.
Re:Memcached 1.6 by haolez on Sunday March 08, 2020 @09:38PM (#22522154)
I have a trading bot that consolidates a lot of price information in order to make decisions. I'm currently using Redis due to data structures (lists and scores) and Pub/Sub.

I wonder if memcached would give me performance benefits and lower my CPU costs.

Re:Memcached 1.6 by jasonwatkinspdx on Monday March 09, 2020 @04:04AM (#22523765)
You'll get a bunch of garbage answers here to be frank, from people who never put more than trivial load through both.

Memcache blows redis out of the water in terms of raw throughput and latency, like it's not even remotely close on modern lots of cores and big memory machines.

Redis has a more feature rich api, but has fundamentally hobbled itself on a root hash table and concurrency implementation that is circa 1990.

Give memcached a try, even if it means you implement some stuff you currently defer to redis ops. Measure it. Look at the code bases. Make up your own mind about performance and which actually makes your code simpler.

Re:Memcached 1.6 by haolez on Monday March 09, 2020 @08:42AM (#22524886)
Thanks. I'll make sure to create a PoC and post back here.
Re:Memcached 1.6 by dijit on Monday March 09, 2020 @07:16AM (#22524473)
http://antirez.com/news/94

TL;DR: Redis is just doing different things, and the slab allocator is pretty efficient in regards to performance but not memory usage.

Re:Memcached 1.6 by dormando on Monday March 09, 2020 @04:34PM (#22529462)
Fwiw this post comparison is pretty old. The memory usage should be the same or better these days (automatic slab rebalancing, LRU expired item crawler, chunked items, etc).
Re:Memcached 1.6 by manigandham on Sunday March 08, 2020 @10:03PM (#22522276)
CPU is cheap and memcached has no advanced data structures. If you're using them then you'll probably have to reimplement everything yourself in memcached with less efficiency.
Re:Memcached 1.6 by henriquez on Sunday March 08, 2020 @10:33PM (#22522435)
You can always just JSON-encode whatever you’re putting in there and decode on the way out. Though I couldn’t imagine using it for pub/sub like the parent commenter is doing with redis.
Re:Memcached 1.6 by manigandham on Sunday March 08, 2020 @11:36PM (#22522782)
Which is inefficient and pointless compared to just using Redis with data structures that you can manipulate directly.
Re:Memcached 1.6 by dormando on Sunday March 08, 2020 @11:15PM (#22522684)
Mind giving some examples in more detail about how you make use of lists/scores?
Re:Memcached 1.6 by haolez on Monday March 09, 2020 @09:31AM (#22525182)
Pub/Sub is easily replaceable. I use lists and scores to store orders from orderbooks, where the prices are the scores. Then I can order by price.

It's simple, but I have like 400 updates per second.