我对 Memcache、Memcached 和 php5-memcache 感到困惑 [英] I'm Confused with Memcache vs Memcached vs php5-memcache

查看:31
本文介绍了我对 Memcache、Memcached 和 php5-memcache 感到困惑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我按照这个教程 关于如何安装 nginx、php 和 mysql,包括 php5-memcache.

I followed the instruction in this tutorial on how to install nginx, php, and mysql including the php5-memcache.

我想知道我是否还需要安装没有php5"前缀的 memcache 或 memcached.

I'm wondering if I still need to install the memcache or memcached without the "php5" prefix .

截至目前,我的 WordPress 网站正在抱怨 ff:

As of now my WordPress site is complaining the ff:

The following memcached servers are not responding or not running:

Page Cache: 127.0.0.1:11211.
Database Cache: 127.0.0.1:11211.
Object Cache: 127.0.0.1:11211.
This message will automatically disappear once the issue is resolved.

如果需要安装,会不会和php5-memcache冲突?或者像两个版本的过度使用?

If it is needed to be installed, will it not conflict with php5-memcache? Or something like an overkill usage of the two version?

什么是最好的版本?内存缓存还是内存缓存?php5-memcache 或 php5-memcached.

And what is the best version to use? Memcache or Memcached? php5-memcache or php5-memcached.

我听说带有d"的 memcached 只是一个服务或守护进程.但是有人试图将两者与我所看到的进行比较 here.

I heard that memcached with "d" is just a service or daemon. But somebody is trying to compare the two as what I have seen here.

推荐答案

这些扩展的名称令人困惑.

The names of these extensions are confusing.

实际上,php5-memcache 和 php5-memcached 都是用于处理 memcached 服务的 PHP 扩展(Memcached server).它们都为您的 PHP 进程提供了成为 memcached 服务客户端的能力,即通过网络连接到 memcached,并说出 memcached 协议,以便使用 memcached API.

Actually, both php5-memcache and php5-memcached are PHP extensions for working with the memcached service (Memcached server). They both give your PHP processes, the ability to be clients to the memcached service, i.e. to connect to memcached over the network, and to speak the memcached protocol, in order to use the memcached API.

在我看来,php5-memcached 扩展更稳定,功能更多,所以我建议,应该先尝试一下.它的大部分操作也更快(产生这些结果的基准的 php 源).

The php5-memcached extension is more stable and has more features in my opinion, so I would suggest, that it should be tried first. Most of its operations are faster too (php source for the benchmark that produced these results).

您仍然需要在某处启动实际的 memcached 服务及其地址,以便连接到它.如果您想要分布式缓存,memcached 服务可以在同一台主机上启动,也可以在另一台/多台主机上启动.

You still do need the actual memcached service started somewhere, and its address, in order to connect to it. The memcached service may be started on the same host, or on another host/hosts, if you want a distributed cache.

这篇关于我对 Memcache、Memcached 和 php5-memcache 感到困惑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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