A
A
Anton B2014-11-18 21:57:45
PHP
Anton B, 2014-11-18 21:57:45

How to make it so that when connecting to memcached, the success was 100%?

Good afternoon!
On a game project with an audience of 10 thousand users, I use memcached to store sessions and as a key-value store.
Memcached server is remote, it processes requests from 2 PHP servers.
I set the PHP script to log the success of the connection to the memcached server and found that about 30% of the connections were not successful.
Since memcached acts as a layer in front of the database, each unsuccessful connection to memcached loads the database.
Setting memcached timeouts at the PHP level (there are 5 parameters) did not change the situation.
On the side of the memcached server, the maximum number of connections was set to 999 thousand, 32GB of memory was allocated.
Tell me how to make sure that the success of connecting to memcached tends to 100%. Or suggest another solution. Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Entelis, 2014-11-18
@DmitriyEntelis

1) what does it mean that the connection was not successful? with what error falls?
2) it seems very strange to me to use memcached to store sessions. It does not guarantee the safety of data, data can be forced out at any time. Use redis for this.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question