2 min

Memcached vs Redis

Oct 21, 2014

Obviously, that depends upon usage. Redis can be used for multiple purposes while Memcached seems to be focused on one basic but important function.

Currently, I'm using or testing both as simple cache stores for individual article pages where the key-value is post_id-HTML.

I'm also storing the Grebe homepage within each system too.

I'm using Nginx to access Memcached while I'm using my Grebe Perl code to read the cached pages from Redis.

I need to recompile Nginx to include the Redis module. I'll attempt to do this and then use the Nginx server block config file to pull cached pages from Redis. I'll do simple speed tests to compare diffs.

http://jamieonsoftware.com/post/59738699304/memcached-vs-redis

http://oldblog.antirez.com/post/redis-memcached-benchmark.html

http://redis.io/topics/benchmarks

http://stackoverflow.com/questions/10558465/memcache-vs-redis

Memcached is a volatile in-memory key/value store. Redis can act like one (and do that job as well as memcached), but it is a data structure server.

Benchmarks are often conflicting, but this much is clear: when used like memcached Redis falls somewhere between nearly as fast or maybe even a little faster.

The powerful data types are particularly important. They allow redis to provide a fantastic shared queue (lists), a great messaging solution (pub/sub), a good place for storing sessions (hashes), and a compelling place for high score tracking (sorted sets). These are just a few examples that scratch the surface.

To answer your original question: The performance and memory usage of Redis compared to memcached should be relatively similar. Close enough that for most uses any performance difference in either direction is academic as neither is likely to be the bottleneck.

Values up to 512MB in size (memcached limited to 1MB per key)

http://systoilet.wordpress.com/2010/08/09/redis-vs-memcached/

http://dormando.livejournal.com/525147.html

http://dormando.livejournal.com/495593.html

http://www.bigdatalittlegeek.com/blog/2014/3/25/memcached-vs-redis

http://www.reddit.com/r/PHP/comments/264s1b/memcached_vs_redis_im_particularly_interested_in/

1 MB Memcached limit

I created a large post at MakeToledo.com that contains 6,744 words, and it's upposedly a 37-min read, and the saved HTML for that post weighed in at 44 KB.

So I guess that an HTML page that exceeds the memcached 1 MB limit would have to be a monster.

Let's say 7,000 words creates a 50 KB HTML file. Of course, it depends upon how much formatting exists. I guess that a lot of bullet points and other formatting will inflate the size.

Anyway, about 140,000 words would create a 1 MB HTML page if my arithmetic is correct. And the reading time would be over 13 hours.

I posted the 37-min post into my Grebe app on the development area, and it worked okay. It's in memcached.

http://en.wikipedia.org/wiki/Word_count

But while the length of a novel is to a large extent up to its writer, lengths may also vary by sub-genre; many chapter books for children start at a length of about 16,000 words, and a typical mystery novel might be in the 60,000 to 80,000 word range while a thriller could be over 100,000 words.

Many universities limit Ph.D. dissertations to at most 100,000 words, barring special permission for exceeding this limit.

Classification Word count
Novel over 40,000 words
Novella 17,500 to 40,000 words
Novelette 7,500 to 17,500 words
Short story under 7,500 words

I should be okay with memcached.

#redis - #memcached - #caching

From JR's : articles
518 words - 3547 chars - 2 min read
created on
updated on - #
source - versions

Related articles
Http caching - oct 2, 2014 - Oct 02, 2014



A     A     A     A     A

© 2013-2017 JotHut - Online notebook

current date: May 5, 2024 - 8:20 a.m. EDT