redis和ssdb讀取效能對比

來源:互聯網
上載者:User

標籤:http   使用   os   io   檔案   資料   ar   2014   

      最近關注了一下ssdb,他的特點是基於檔案儲存體系統所以它支撐量大的資料而不因為記憶體的限制受取約束.從官網的測試報告來看其效能也非常出色和redis相當,因此可以使用他代表redis來進行k-v資料業務的處理.想法總是美好的,不過現實中就可能非常骨感.

    以於針對Redis和ssdb的幾個讀操進行一個簡單的效能測試對比,這個測試不是直接在本機調用Redis和ssdb. 而是通過一個程式在別的伺服器上調用.測試指令(get,hget,lregion)以下是測試結果

測試代碼

 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,但其基於磁碟儲存有著其最大的優勢,畢竟很多業務資料遠超過伺服器記憶體的容量.

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.