我測試了基於redis容器。 https://index.docker.io/u/dockerfile/redis/如何優化碼頭集裝箱的性能?
採用相同Redis的基準測試,Redis的服務器容器內運行慢得多,比上託管的操作系統,如下所示的實際統計中運行。 (第一個基準是碼頭集裝箱)
那麼,有沒有一種方法來優化碼頭集裝箱的性能?
[email protected]:/tmp$ redis-benchmark -p 49153 -q -n 100000
PING (inline): 5607.27 requests per second
PING: 6721.79 requests per second
MSET (10 keys): 6085.69 requests per second
SET: 6288.91 requests per second
GET: 6627.78 requests per second
INCR: 6454.11 requests per second
LPUSH: 6449.12 requests per second
LPOP: 5355.90 requests per second
SADD: 6237.91 requests per second
SPOP: 6794.40 requests per second
LPUSH (again, in order to bench LRANGE): 6089.76 requests per second
LRANGE (first 100 elements): 6000.24 requests per second
LRANGE (first 300 elements): 4660.70 requests per second
LRANGE (first 450 elements): 4276.79 requests per second
LRANGE (first 600 elements): 3710.85 requests per second
[email protected]:/tmp$
[email protected]:/tmp$ sudo /etc/init.d/redis-server start
Starting redis-server: redis-server.
[email protected]:/tmp$ redis-benchmark -q -n 100000
PING (inline): 19357.34 requests per second
PING: 19175.46 requests per second
MSET (10 keys): 16697.28 requests per second
SET: 19146.08 requests per second
GET: 19175.46 requests per second
INCR: 19135.09 requests per second
LPUSH: 19168.10 requests per second
LPOP: 14976.79 requests per second
SADD: 16638.93 requests per second
SPOP: 18079.91 requests per second
LPUSH (again, in order to bench LRANGE): 18268.18 requests per second
LRANGE (first 100 elements): 16136.84 requests per second
LRANGE (first 300 elements): 11528.71 requests per second
LRANGE (first 450 elements): 9237.88 requests per second
LRANGE (first 600 elements): 8864.46 requests per second
實際上也應該添加從另一個容器連接到redis服務器的基準測試,因爲這是我們推薦的。 – SvenDowideit
@jpetazzo在第二個項目中,我假設你說你從另一個主機連接時會得到可比的數字,而不管redis-server是在主機中的碼頭集裝箱內還是外部運行。在這兩種情況下,只有一個網絡層(主機網絡層或碼頭網絡層,而不是兩者) – Sajith