Jul 292013
 

I got a weird feeling that redis is more stable than memcached … but I don’t have solid evidence for that.

The case is, I migrated an application’s backend from memcached to redis, there were surely some other bug fixes and trivial performance tuning, but thinking of the memcached version had been running in production for more than 6 months without any significant problem, I wouldn’t think my changes make any big difference. Also, I changed my codes only, nothing to do with redis/memcached so I think it’s a fair comparison.

memcached use to hit 6GB memory (VIRT) usage after a week to 10 days running, then for most cases it will crash cos ops people set RAM limitation. Ops people asked me to do a restart once the memory utilization hit a certain level, but I found that restart memcached will simply wipe out all my in-memory-only data like counter, which is not critical but will make the application looks weird (“no more visitor in the past 7 days???”), and this initiated the migration to redis.

After migrated to redis, the memory utilization started from 4200MB, and one of the oldest instance had been running there since Jun 4 (50+ days till now), and memory is at 4300MB. I guess the increment was due to data size growth instead of memory leak, though again, I don’t have evidence.

Anyway, I’m not going to go back to memcached in the future, so the difference won’t bother me.

Jun 222013
 

I hit this while reading some articles and found it is really helpful, one should check it before making any data store decisions.

To me there are several clear winners – redis/memcached for kv store, MongoDB for document store, and Oracle/MySQL for traditional RDBMS, and seems Oracle is a clear winner across corporations.

I believe what I decided to use memcached and then migrate to redis were both wise decisions, but I still doubt decided to use mongodb was a right decision or not. I will dig into MongoDB a little bit more to see if it got improved in the past two years for the issues I care, especially memory management mechanism.

Aug 152012
 

Need to play with PHP extension for redis for a while, and after reading several articles on the web, I decided to with PHPRedis instead of Predis because of performance.

My goal is build up a webservice to proxy requests to backend redis servers, the web server is actually a proxy handling all routing related issues, so that clients don’t have to worry about hashing, sharding, etc. So I do prefer something pretty fast, though I don’t know how fast I need.

I dig out an article of how to build up PHPRedis extension, but need to get redis.ini from github to so that build won’t fail. However, if you are lazy you can just put “extension=redis.so” to redis.ini by yourself, anyway, all up to you. Determine name of tarball and directory in spec file is some sort of tricky, as it seems things changed every version. I was using nicolasff-phpredis-2.2.1-66-g89bdaf2.tar.gz and nicolasff-phpredis-89bdaf2, note that they are not identical though have some common parts.

I’ve deployed the extension to one of my test box, and will do some tests later on.