memcached与内部缓存在PHP中? [英] memcached vs. internal caching in PHP?

查看:56
本文介绍了memcached与内部缓存在PHP中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用PHP中的一些旧软件,该软件维护$ cache数组以减少SQL查询的数量.我当时只是考虑将memcached放在其位置,并且想知道是否要摆脱内部缓存.如果我保留内部缓存,还是仍然有值得提高的性能,还是内存缓存就足够了?

解决方案

内存缓存(在金属上实现)似乎比某些php解释的缓存方案要快.

但是:如果它没有损坏,请不要修复它.

如果删除自定义缓存代码,则可能必须处理依赖于缓存的其他代码.我不能代表您必须维护的代码的质量,但这似乎是可能不值得"的事情之一.

让我这样说:您是否相信原始的开发人员编写的代码能够在您删除缓存后仍然可以正常工作?(我可能不会)>

因此,除非现有缓存给您带来问题,否则我建议您不要将其淘汰.

I'm working on some old(ish) software in PHP that maintains a $cache array to reduce the number of SQL queries. I was thinking of just putting memcached in its place and I'm wondering whether or not to get rid of the internal caching. Would there still be a worthwihle performance increase if I keep the internal caching, or would memcached suffice?

解决方案

It seems likely that memcache (which is implemented on the metal) would be faster than some php interpreted caching scheme.

However: if it's not broken, don't fix it.

If you remove the custom caching code, you might have to deal with other code that depends on the cache. I can't speak for the quality of the code you have to maintain but it seems like one of those "probably not worth it" things.

Let me put it this way: Do you trust the original developer(s) to have written code that will still work if you rip out the caching? (I probably wouldn't)

So unless the existing caching is giving you problems I would recommend against taking it out.

这篇关于memcached与内部缓存在PHP中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆