Some minor points > Redis in its special case of memcached replacement, may be addressed executing multiple processes This is always less optimal to a single process. Simpler is better. > Redis is very very observable This has a cost...trashing your phenomenal read and write performance. Running a concurrent redis, just for monitoring, is a hack that I have used to continue leveraging the observability.
I agree that simpler is often better, but running multiple cache processes may be a requirement for either memcached or redis if you want to get consistent latency from them. I have observed a significant improvement in performance (at large scale) when binding memcached to a single NUMA zone. NUMA lets you address non-local memory, but memcached and redis don't utilize libnuma so they don't know whether the memory i…
Clarifications about Redis and Memcached
31–40 of 43 posts
Re: Clarifications about Redis and Memcached
#32For a post that attempts to compare Redis to memcached for caching, it's amazing how few actual numbers appear in the post.
Re: Clarifications about Redis and Memcached
#33For a post that attempts to compare Redis to memcached for caching, it's amazing how few actual numbers appear in the post.
"Actual numbers" for caching services only have meaning in the context of a particular application.
Re: Clarifications about Redis and Memcached
#34Earlier quoted context omitted.
The locks are becoming more fine-grained in memcached [1], so that should be less of a problem now. It is possible to remove lock contention on the read path [2] if a concurrent hash table is used. This can be done while using an O(1) eviction policy that outperforms LRU [3]. [1] https://github.com/memcached/memcached/pull/97 [2] https://github.com/ben-manes/caffeine/wiki/Design [3] https://github.com/ben-manes/caffe…
NovaX: thanks for the interesting references. The point is, is it worth for memcached to avoid the global interpreter lock in the hash table with the number of cores currently deployed machines have? I would expect to see very little contention. The concurrent hash table looks a good idea for memcached, for sure to have a mutex per key would be likely an overkill in terms of memory usage. I'll try to read with care t…
Re: Clarifications about Redis and Memcached
#35Earlier quoted context omitted.
The locks are becoming more fine-grained in memcached [1], so that should be less of a problem now. It is possible to remove lock contention on the read path [2] if a concurrent hash table is used. This can be done while using an O(1) eviction policy that outperforms LRU [3]. [1] https://github.com/memcached/memcached/pull/97 [2] https://github.com/ben-manes/caffeine/wiki/Design [3] https://github.com/ben-manes/caffe…
NovaX: thanks for the interesting references. The point is, is it worth for memcached to avoid the global interpreter lock in the hash table with the number of cores currently deployed machines have? I would expect to see very little contention. The concurrent hash table looks a good idea for memcached, for sure to have a mutex per key would be likely an overkill in terms of memory usage. I'll try to read with care t…
Re: Clarifications about Redis and Memcached
#36Earlier quoted context omitted.
In a networked server getting data from memory, the time required to access the data itself is negligible, so the real performance in mostly a factor of how much I/O a thread can sustain (Redis with heavy pipelining will handle at least 500k ops/sec in the same hardware it handles 100k ops/sec without pipelining). There is still the case of the load to be very biased towards, like, 5% of keys. But that 5% of keys are…
I think once you implement threaded i/o, requests for hot keys will hit in the cpu cache and you'll become NIC limited. At that point, read replicas is the best solution rather than shared memory since contention will move to NIC and adding more cpus won't help. Edit: Salvatore, you should also look at the Seastar/ScyllaDB design (if you haven't yet) - that architecture would work well for redis as well. And if user…
https://github.com/scylladb/seastar/wiki/Memcached-Benchmark
Re: Clarifications about Redis and Memcached
#37https://github.com/seamusabshere/lock_and_cache
(and lock too, with Redis Redlock)
Re: Clarifications about Redis and Memcached
#38Some minor points > Redis in its special case of memcached replacement, may be addressed executing multiple processes This is always less optimal to a single process. Simpler is better. > Redis is very very observable This has a cost...trashing your phenomenal read and write performance. Running a concurrent redis, just for monitoring, is a hack that I have used to continue leveraging the observability.
Re: Clarifications about Redis and Memcached
#39Earlier quoted context omitted.
I remember thredis very well! But it's different compared to what memcached does and Redis has plans for: memcached just threads the I/O part, not the access to the key space which is serialized via a mutex. However what you had in mind is also in our long term plans... and was addressed in another blog post here: http://antirez.com/news/93
The locks are becoming more fine-grained in memcached [1], so that should be less of a problem now. It is possible to remove lock contention on the read path [2] if a concurrent hash table is used. This can be done while using an O(1) eviction policy that outperforms LRU [3]. [1] https://github.com/memcached/memcached/pull/97 [2] https://github.com/ben-manes/caffeine/wiki/Design [3] https://github.com/ben-manes/caffe…
Re: Clarifications about Redis and Memcached
#40Many of the developers I work with are unfamiliar with Redis. Maybe they've heard of it and they install it to use Sidekiq and that's it. From the perspective of a newcomer, memcached is "safer" to run because it'll be memory limited automatically with literally zero config necessary. Redis does require the non-default LRU and memory tuning to be a safe cache.
It sounds like my performance concerns are primarily a thing of the past. Glad to hear it and I look forward to the threaded I/O coming after lazyfree.