Turn from: http://www.cnblogs.com/lovecindywang/archive/2011/03/03/1969633.html
From the previous diagram can be guessed that there will also be Redis 2.2.1 test, the same test environment, 1K of data volume, using the Servicestack.redis client to do the following test:
1) Set operation
2) Get operation
3) del operation
Each set of tests is tested using three configurations:
1 Green Line is open dump mode of persistence, 5 minutes lasting once
2 The Blue Line is open aof mode of persistence, write disk per second
3) The red line is to turn off any persistent way
The same other configuration is used for each configuration:
1 open VM maximum memory 10GB (128 byte one page) after start swapping out, VM space 160GB
2 maximum use of memory 15GB, to ensure that there is enough residual memory in the dump
3) Open compression, no configuration Master
Now take a look at the test results:
As you can see from this diagram:
1 for the lack of persistence in the way, read and write in the amount of data reached 8 million times, performance dropped several times, this time is the memory 10g,redis began to swap out to disk. And since then there is no way to perk up again, performance than mongodb a lot worse.
2 for the way of aof persistence, the overall performance will not be much worse than the way without persistence, are in the amount of tens of millions of data, memory is full after the performance of the read only hundreds of.
3 for the Dump persistence mode, read and write performance fluctuations are relatively large, may be in the period of dump also has a relationship, and reached 14 million data volume, read and write performance post. In the dump, will not be swapped out, and all the modified data or create a new page, memory consumption than usual high, more than 15GB. And dump also compresses, takes up a lot of CPU. In other words, at that time memory, disk and CPU pressure are close to the limit, performance is not bad.
To sum up:
1 Redis is actually only suitable as a cache, not a database or storage. Its persistence method is suitable for saving the emergency what, not very suitable as a common function to use. For this version of Redis, it is not recommended to use any persistence method. Otherwise, it might be ugly to die. Plainly, expect Redis is memcached upgrade version, with a variety of data structure, but do not expect Redis to and mongodb/kt.
2 for VM is not recommended to open, although open VM can let Redis save more data than memory, but if the hot and cold data is not very obvious performance will be very poor (my test is random query key, hot and cold is not obvious). Of course, for hot and cold conditions, you can set 200%-400% of memory as a VM space, and it is not recommended to set 10 times times as much memory space as a VM (like my configuration).
3 Servicestack.redis client seems to have several bugs, first redistypedclient Dispose incredibly did not implement, should be to call Client.dispose (), Second Redisnativeclient's info attribute is not to get the latest value every time, the third pooledredisclientmanager of Writepoolindex and Readpoolindex only see Add to see minus the place, Do not know what this is, in fact, every time take the first is not active client can be, Pooledredisclientmanager also did not force a recycle of active client to use overtime (avoid the use of the time to forget Dispose to occupy too many connections). I will try to contact Servicestack.redis's author about these points.