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

后端 未结 7 1236
花落未央
花落未央 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:38

    You're being awefully vauge on the details. And I believe the answer your looking for depends on the situtation. To my knowledge very few things tend to be better than the other all the time.

    Obviously it woudln't be faster to read things of the file system (assuming that it's a harddrive). Even a SDD will be noticably slower than in-memory reads. And the reason for that is that HDD/FileSystem is built for capacity not speed, while DDR memory is particulary fast for that reason.

    Good caching means to keep frequently accessed parts in memory and the not so frequently accessed things on disk (persistent storage). That way the normal case would be vastly improved by your caching implementation. That's your goal. Make sure you have a good understanding of your ideal caching policy. That will require extensive benchmarking and testing.

提交回复
热议问题