Memcache vs Java Memory

后端 未结 3 1547
被撕碎了的回忆
被撕碎了的回忆 2021-01-29 23:20

Simple, probably dumb question: Suppose I have a Java server that stores in memory commonly used keys and values which I can query (let\'s say in a HashMap)

What\'s the

3条回答
  •  醉梦人生
    2021-01-30 00:22

    I just made a benchmark between a concurrent hash map, memcached, and MySQL.

    HashMap vs. memcached vs. MySQL

    Here are the results:

    Type Insert Lookup Remove

    ConcurrentHashMap 264ms 93ms 82ms

    Memcached 6549ms 5976ms 4900ms

    Mysql 55754ms 26002ms 57899ms

    A thread pool was used for this benchmark.

    Some more information can be found here: http://www.incentergy.de/2013/12/big-data-architecture-patterns-for-performance/

    Further the following cache might be an alternative to memcached: https://code.google.com/p/kitty-cache/

提交回复
热议问题