/redis-proxy

Primary LanguageCGNU General Public License v2.0GPL-2.0

redis-proxy
===========

The redis-proxy receives requests from clients and separates get and set requests between master and several slaves.
Set commands are always go to master server and get commands go to master or one of slaves(chosen by roundrobin).
AUTH, PING and QUIT commands are processed locally.
After start redis-proxy determines which server is master and set all other servers as slaves.
If master fails the first available slave becomes the master. After server recovery it becomes the slave.

# Build

just run make

# Usage

./redis-proxy -[ct] redis-proxy.conf

Options:
    -c : configuration file name
    -t : test configuration file and exit


# Limitations

1. Inline commands and pipelining are not supported at this time
2. EVAL, SYNC, DEBUG, CLIENT, CONFIG, SELECT, MIGRATE, MONITOR, PUBLISH, SLAVEOF, SLOWLOG, SHUTDOWN, PSUBSCRIBE, UNSUBSCRIBE, PUNSUBSCRIBE commands are always fails at this time
3. Low productivity compared to redis server
   redis-benchmark:
       PING_INLINE: 50761.42 requests per second
       PING_BULK: 44444.45 requests per second
       SET: 38167.94 requests per second
       GET: 41666.67 requests per second
       INCR: 35087.72 requests per second
       LPUSH: 35087.72 requests per second
       LPOP: 36496.35 requests per second
       SADD: 36363.64 requests per second
       SPOP: 35587.19 requests per second
       LPUSH (needed to benchmark LRANGE): 37593.98 requests per second
       LRANGE_100 (first 100 elements): 19801.98 requests per second
       LRANGE_300 (first 300 elements): 12269.94 requests per second
       LRANGE_500 (first 450 elements): 9624.64 requests per second
       LRANGE_600 (first 600 elements): 7662.84 requests per second
       MSET (10 keys): 30030.03 requests per second