Memcache multi-server solution

Source: Internet
Author: User
For memcache multi-server php operations on memcache, you can use Memcache: addServer to add multiple memcache servers $ memcache & nbsp; new & nbsp; memcahce; $ memcache-& gt; addServer ($ ip1, 11211); $ memcache-& gt; addServer ($ ip2, 11211 );
You can use memcache: addServer to add multiple Memcache servers for php operations.

$ Memcache = new memcahce;
$ Memcache-> addServer ($ ip1, 11211 );
$ Memcache-> addServer ($ ip2, 11211 );
I don't understand the server, but I want to give some advice.

I understand that memcache is used to cache data. if a memcache server on one server cannot handle large traffic volumes, we should set whether the ip address of the second memcache server is another machine, our website code can only be placed on one server. for example, we put the website source code on the ip1 server, how can I add a second memcache server? $ memcache-> addServer ($ ip2, 11211); isn't ip2 another server? I don't understand this very well. I don't know what clusters I want to offer.
------ Solution --------------------
Yes, ip2 is another machine.
So what you need to save may be in ip1 or ip2.
But you don't need to worry about it. you only need to know that the saved items can be retrieved at any time.
------ Solution --------------------
If there are 0.1 million concurrent requests, some technology should be used to allocate each server to 10 thousand concurrent requests (is this the case for server load balancer ?). Yes
Are there any index. php files on the 10 servers (that is, do you want to synchronize the source code of the 10 servers )? Yes

Another problem is that multiple memcache servers only increase the data storage capacity? Or is efficiency improved?
Capacity increases and efficiency increases (server load balancer)

For example:
One server, apache + php (website source code storage) and 10 memcache servers (data storage)
When 0.1 million is concurrently sent to this server, is it as fast to retrieve data from these 10mm servers and from only one mm server?
Each memcache has connections and memory allocation restrictions. The data retrieval speed depends on the network speed.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.