I had tested the following key-value store for set () and get ()
- Memcachedb, use memcached client protocol.
- Tokyo tyrant (Tokyo
Cabinet), use memcached client Protocol
- Redis, use jredis Java
Client
1. Test environment1.1 Hardware/OS
2 Linux boxes in a LAN, 1 server and 1 test Client
Linux centos 5.2 64bit
Intel (r) Xeon (r) CPU e5410 @ 2.33 GHz (L2 cache: 6 m), quad-core * 2
8g memory
SCSI disk (standalone disk, no other access)
1.2 Software Version
Db-4.7.25.tar.gz
Libevent-1.4.11-stable.tar.gz
Memcached-1.2.8.tar.gz
Memcachedb-1.2.1-beta.tar.gz
Redis-0.900_2.tar.gz
Tokyocabinet-1.4.9.tar.gz
Tokyotyrant-1.1.9.tar.gz
1.3 Configuration
Memcachedb startup Parameter
Test 100 bytes
./Memcachedb-H/data5/kvtest/bdb/data-D-P 11212-M 2048-N-l 8192
(Update: As mentioned by Steve, the 100-byte-test missed the-n paramter, so I added
It and updated the data)
Test 20 K bytes
./Memcachedb-H/data5/kvtest/mcdb/data-D-P 11212-B 21000-n-M 2048
Tokyo tyrant (Tokyo Cabinet) Configuration
Use default Tokyo tyrant sbin/ttservctl
Use. Tch database, hashtable Database
Ulimsiz = "256m"
SID = 1
Dbname = "$ basedir/casket. Tch # bnum = 50000000" # default 1 m is not enough!
Maxcon = "65536 ″
Retval = 0
Redis Configuration
Timeout 300
Save 900 1
Save 300 10
Save 60 10000
# No maxmemory settings
1.4 test Client
Client in Java, jdk1.6.0, 16 threads
Use memcached client java_memcached-release_2.0.1.jar
Jredis client for redis test, another JDBC-redis has
Poor performance.
2. Small Data Size Test Result
Test 1, 1-5,000,000 as key, 100 bytes string value, do set, then get test, all get test has result.
Request per second (mean)
Store |
Write |
Read |
Memcached |
55,989 |
50,974 |
Memcachedb |
25,583 |
35,260 |
Tokyo tyrant |
42,988 |
46,238 |
Redis |
85,765 |
71,708 |
Server load average
Store |
Write |
Read |
Memcached |
1.80, 1.53, 0.87 |
1.17, 1.16, 0.83 |
Memcachedb |
1.44, 0.93, 0.64 |
4.35, 1.94, 1.05 |
Tokyo tyrant |
3.70, 1.71, 1.14 |
2.98, 1.81, 1.26 |
Redis |
1.06, 0.32, 0.18 |
1.56, 1.00, 0.54 |
3. larger data size test result
Test 2, 1-500,000 as key, 20 K Bytes string value, do set, then get test, all get test has result.
Request per second (mean)
(Aug 13 update: Fixed a bug on get () that read non-exist key)
Store |
Write |
Read |
Memcachedb |
357 |
327 |
Tokyo tyrant |
3,501 |
257 |
Redis |
1,542 |
957 |
4. Some notes about the test
When test redis server, the memory goes up steadily, consumed all 8g and then use swap (and write speed slow down), after all memory and swap space is used, the client will get exceptions. so use redis in a productive environment shocould limit to a small data
Size. It is another cache solution rather than a persistent storage.So compare redis together with memcachedb/TC may not fair because redis actually does not save data to disk during the test.
Tokyo cabinet and memcachedb are very stable during heavy load, use very little memory in set test and less than physical memory in get test.
Memcachedb peformance is poor for write large data size (20 K ).
The call response time was not monitored in this test.