证明memcache比文件系统缓存更快?
是否有任何理论表明缓存应该比文件系统更快?
我认为,由于文件系统也使用缓存,所以当文件系统的概念有些松散时,没有科学证据表明我们应该将内容从文件系统移动到缓存(例如 memcache)——就像下载“文件”一样就像下载一个 memcached 对象一样。
我的具体例子是是否通过内存缓存或文件系统托管模板引擎。有关系吗?
Is there any theory that says that a cache should be faster than a file system?
I think that since the file system also uses caching there is no scientific proof that we should move content from file system to a cache such as memcache when the concept of file system is somewhat loose -- like downloading a "file" could be the same as downloading a memcached object.
My concrete example is whether to host a template engine via memcache or file system. Does it matter?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在许多情况下,您的文件系统可能会更快。例如,当您需要“编译模板”的缓存时,文件系统会更快。
文件系统缓存(尤其是在 Linux 上)将确保您的缓存模板(经常读取)在很短的时间内可用。内核将它们保存在内存缓存中,读取速度会非常快。
memcached 是一个分布式键/值存储。它有不同的用例。
Your filesystem will probably be faster in many situations. E.g. when you need a cache for your "compiled templates", the filesystem will be faster.
And the filesystem caches (especially on linux) will make sure, that your cached templates - which are read often - are available in very short time. The kernel keeps them in an in-memory cache, and reads will be fast as hell.
memcached is a distributed key/value store. It has different use cases.
请阅读 memcached 关于页面,了解 memcached 存在的原因。除非您有一个用于 100 个前端 Web 服务器的神奇集群文件系统缓存,否则您的问题没有意义。
Please read the memcached about page to understand why memcached exists. Your question doesn't make sense unless you have a magical clustered filesystem cache for your 100 front-end web servers.