最近關注了一下ssdb,他的特色是基於文件存儲系統因此它支撐量大的數據而不由於內存的限制受取約束.從官網的測試報告來看其性能也很是出色和redis至關,所以能夠使用他表明redis來進行k-v數據業務的處理.想法老是美好的,不過現實中就可能很是骨感. git
以於針對Redis和ssdb的幾個讀操進行一個簡單的性能測試對比,這個測試不是直接在本機調用Redis和ssdb. 而是經過一個程序在別的服務器上調用.測試指令(get,hget,lregion)如下是測試結果截圖 github
測試代碼 redis
private void HGetHandler(RedisClient e) { while (mRuning) { long index = System.Threading.Interlocked.Increment(ref mIndex); ProtobufKey key = "user_" + Data.Import.Users[(int)(index % Data.Import.Users.Count)].Name; key.Get<Model.Order, Model.Employee, Model.Customer>(e); System.Threading.Interlocked.Increment(ref mCount); } } private void LRegionHandler1TO2(RedisClient e) { while (mRuning) { ProtobufList<Model.Order> list = "Orders"; list.Range(1, 2, e); System.Threading.Interlocked.Increment(ref mCount); } } private void LRegionHandler50TO60(RedisClient e) { while (mRuning) { ProtobufList<Model.Order> list = "Orders"; list.Range(50, 60, e); System.Threading.Interlocked.Increment(ref mCount); } } private void LRegionHandler100TO110(RedisClient e) { while (mRuning) { ProtobufList<Model.Order> list = "Orders"; list.Range(100, 110, e); System.Threading.Interlocked.Increment(ref mCount); } } private void GetHandler(RedisClient e) { while (mRuning) { long index = System.Threading.Interlocked.Increment(ref mIndex); ProtobufKey key = "user_" + Data.Import.Users[(int)(index % Data.Import.Users.Count)].Name; key.Get<Model.User>(e); System.Threading.Interlocked.Increment(ref mCount); } }
從測試結果看來差距仍是很是明顯,並不象官網那樣說得這麼理想.雖然SSDB效率上不如REDIS,但其基於磁盤存儲有着其最大的優點,畢竟不少業務數據遠超過服務器內存的容量. c#
我的站:www.ikende.com 服務器
我的開源項目github.com/IKende 性能