Memcache Multi-server
PHP operation Memcache can add multiple memcache servers with Memcache::addserver
$memcache = new Memcahce;
$memcache->addserver ($ip 1,11211);
$memcache->addserver ($ip 2,11211);
I do not understand the server, there are a few points do not understand the hope of pointing
I understand that memcache is used to cache data, if it is a server on a memcache server can not solve the large traffic, then we set the second Memcache server IP is not another machine, and our website code can only be placed on a server bar, For example, we put the site source on the IP1 server, then I add a second memcache server what is the use of $memcache->addserver ($ip 2,11211); IP2 isn't another machine doing the server? I do not understand this very much, what cluster has not understood to seek master guidance
Share to:
------Solution--------------------
Yes, IP2 is another machine.
So what you need to save may be in ip1 or in IP2.
But you don't have to care about him, you just need to know what you can get back at any time.
------Solution--------------------
With 100,000 concurrent, a technology should be able to allocate each of the 10,000 concurrency (load balancing is this?). )。 Yes
Do you want to have index.php files on all 10 servers (i.e., to synchronize the Web source data for 10 servers)? Yes
Is there a problem with multiple memcache servers just to increase data storage capacity? Or is it going to improve efficiency?
capacity increases and efficiency increases (load balancing)
For example:
There are 1 servers apache+php (storage site source code) and 10 Memcache servers (storage data)
100,000 concurrent to these 1 servers, from the 10 mm respectively to fetch data and only from 1 mm server to fetch data is the same fast
each memcache has a connection number and memory allocation limit, the data speed depends on the network speed.