Which is faster/better for caching, File System or Memcached?

后端 未结 7 1246
花落未央
花落未央 2021-02-01 16:54

I don\'t think it\'s clear to me yet, is it faster to read things from a file or from memcached? Why?

7条回答
  •  情话喂你
    2021-02-01 17:13

    Memcached is faster, but the memory is limited. HDD is huge, but I/O is slow compared to memory. You should put the hottest things to memcached, and all the others can go to cache files.
    (Or man up and invest some money into more memory like these guys :)

    For some benchmarks see: Cache Performance Comparison (File, Memcached, Query Cache, APC)

    In theory:

    Read 1 MB sequentially from memory       250,000 ns
    Disk seek                             10,000,000 ns
    

    http://www.cs.cornell.edu/projects/ladis2009/talks/dean-keynote-ladis2009.pdf

提交回复
热议问题