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.