4 ms·
I stopped using memcached a decade a go in favour of Redis and now use valkey. Never felt the need to go back to memcached except when a legacy dependency need
by tempest_ 3mo ago
I stopped using memcached a decade a go in favour of Redis and now use valkey.
Never felt the need to go back to memcached except when a legacy dependency needed it.
- jimbokun 3mo agoOK. What do you think of the argument made in the article?
- tempest_ 3mo agoI don't want my cache to silently fail. Clustering redis is not that hard even if you do it manually and I have only had to do it once. I never use redis persistence and have a max size set with LRU or whatever the application requires. With memcached I remember having to mess around the LD_LIBRARY path to link whatever python module I was using at the time
- crabmusket 3mo ago> silently fail Mature ops would be tracking cache hit ratios right? It sounds like memcached would be really good in a use case where you really just need an optional stateless pure cache with absolutely zero rope to hang yourself on. A use case where "cache hit ratio" is the goal, not "fiddly in-memory data store".
- tempest_ 3mo ago> Mature ops would be tracking cache hit ratios right? Sure, and sentry integrates well with redis in python which is what I use primarily with redis. I don't think memcached is bad, I just think its old and industry has moved to redis because it offers more while covering the previous use case. Calling redis fiddly is a mischaracterization. For many use cases I have not had to think more than 30s to setup redis. (also when I say redis I mean Valkey at this point, even if they are starting to diverge)
- hparadiz 3mo agoThere's basically zero reason to use redis. Pretty much every rdbms like mariadb, postgres, etc is just as fast. So then why redis? It's basically needless complexity in your system.
- imp0cat 3mo agoSecurity. More precisely, the ability to secure access to redis with a password.
- hparadiz 3mo agoOkay but I can do that with any rdbms and I can secure memcached too lol. So what? How is redis better than a fixed length table in MySQL?
- robotresearcher 3mo agoPostgres etc are more complex than Redis, are they not? Does your argument assume you already have a database, so you might as well use it for your cache mechanism?
- hparadiz 3mo agoModern rdbms databases already have an in-memory cache. For 99% of projects there's no actual difference. The round trip will end up around 12-22 ms in all best possible cases.
- nchmy 3mo agoIf you're getting 12-22ms latency for your cache reads, the network is your bottleneck. If stored locally, you would get many orders of magnitude faster than that.
- hparadiz 3mo agoThe network IS your bottleneck. That's exactly what I'm saying. APCu count=1000 min=0.000290 avg=0.000318 p50=0.000320 p95=0.000331 max=0.000992 ms Memcached count=1000 min=0.032422 avg=0.039714 p50=0.037211 p95=0.053261 max=0.091343 ms MariaDB count=1000 min=0.015680 avg=0.019541 p50=0.018485 p95=0.023855 max=0.103867 ms Don't even start a socket if possible. Now then do a traceroute. Even to my router it costs 0.547 ms but that's only 1 direction. And a cloud space is hosting many servers, many routers, many switches, with lots of moving pieces so you're realistically adding 1.1 ms per subnet hop and in pretty much every data center that's probably 3-5 hops inside the LAN.
- foobarian 3mo ago> absolutely zero rope to hang yourself on Yeah I thought so too. Google "memcache slab starvation" if you want the long story