Home  >  Article  >  Backend Development  >  memcache 多服务器,该怎么解决

memcache 多服务器,该怎么解决

WBOY
WBOYOriginal
2016-06-13 12:36:08837browse

memcache 多服务器
php操作memcache可以利用Memcache::addServer添加多台memcache服务器

$memcache = new memcahce;
$memcache->addServer($ip1,11211);
$memcache->addServer($ip2,11211);
我对服务器不懂,有几点不明白希望指点一下

我理解的memcache是用来缓存数据的,如果是在一台服务器上一台memcache服务器不能解决大访问量的话,那么我们设置第二台memcache服务器的ip是不是另一台机器了,而我们的网站代码只能放一台服务器上吧,比如我们将网站源码放在ip1这台服务器上,那么我添加第二台memcache服务器有什么用呢$memcache->addServer($ip2,11211); ip2难道不是另一台机器做了服务器吗?我对于这个很是不理解,什么集群了也不懂 求高手指点

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn