4 ms·
Redis is probably the most useful tool powering the internet after nginx. It really is an amazing piece of engineering.
by nasalgoat 13y ago
Redis is probably the most useful tool powering the internet after nginx. It really is an amazing piece of engineering.
- smandou 13y agoYou forgot the JVM.
- herge 13y agoMemcache?
- nasalgoat 13y agoRedis is memcache only better.
- nahname 13y agoWhat's better about Redis? Many caching strategies require the storage to auto expire, memcache does this automatically. Redis does not do this (I believe). Is it significantly faster?
- est 13y agoA simple Google search defeats your belief http://redis.io/commands/set http://redis.io/commands/set > Options > EX seconds -- Set the specified expire time, in seconds. http://redis.io/commands/expireat http://redis.io/commands/expireat > EXPIREAT has the same effect and semantic as EXPIRE, but instead of specifying the number of seconds representing the TTL (time to live), it takes an absolute Unix timestamp (seconds since January 1, 1970)
- sheldoan 13y agoIn addition, the Redis config file allows you to specify an eviction policy when the maximum memory limit is reached: # volatile-lru -> remove the key with an expire set using an LRU algorithm # allkeys-lru -> remove any key accordingly to the LRU algorithm # volatile-random -> remove a random key with an expire set # allkeys-random -> remove a random key, any key # volatile-ttl -> remove the key with the nearest expire time (minor TTL) # noeviction -> don't expire at all, just return an error on write operations Source: https://raw.github.com/antirez/redis/2.6/redis.conf https://raw.github.com/antirez/redis/2.6/redis.conf
- nahname 13y agoI apologize for not being specific. Setting timed expiration is not what I meant. Memcache will fill the entire cache and auto select items to be destroyed, based on current resource availability and order of entry into the cache (FIFO). I want that behaviour. I do not want to set and manage the time things expire.
- est 13y agoThat's covered as well http://oldblog.antirez.com/post/redis-as-LRU-cache.html http://oldblog.antirez.com/post/redis-as-LRU-cache.html
- nasalgoat 13y agoIt's all the functionality of memcache, plus persistence and data types like lists or sorted sets. You have much more control of your data. It's the swiss army knife of in-memory data stores.
- spiffytech 13y agoThis[0] StackOverflow answer nicely lays this fact out. [0]: http://stackoverflow.com/a/11257333/191438 http://stackoverflow.com/a/11257333/191438
- herge 13y agoMemcache is probably faster. But not as fast as writing data to /dev/null.
- wdewind 13y agoI have not used nginx, and have never heard of it spoken about in such glowing terms. Can you maybe compare/contrast it with apache?
- jeffasinger 13y agoThe biggest difference is that nginx uses an evented I/O, and handles many connections per thread/process, Apache can only handle one at a time. This allows it to to use far less memory per connection, and lets it perform reasonably under very high loads. It also has very low latency, even for small loads, and is relatively easy to install and configure on most platforms. nginx does an excellent job as a reverse proxy for applications, there are many configurations where nginx acts as a load balancer, and serves static content, and everything else is passed off to a real application. It's also useful if you're running on a tiny VPS with very little RAM. However, Apache has a few features that nginx lacks, like embedding languages into it like mod_php does, and per directory configuration, in that directory.
- coldtea 13y ago>I have not used nginx, and have never heard of it spoken about in such glowing terms. Seriously? There are lots of glowing blog posts, articles etc about Nginx all the time, including on HN. Just last week or so, it was reported that it powers the majority of the top-1000 biggest sites.
- wdewind 13y agoYeah I guess what I mean was the post I was replying to called it the most useful tool powering the internet. I have not seen that before. I also like to ask people on HN who seem extremely passionate about something to explain why they are passionate because you often learn something new, that you often would not from articles etc.