B
B
bdsoft2013-10-26 21:35:29
PHP
bdsoft, 2013-10-26 21:35:29

PHP sometimes fails to connect to Memcache and Sphinx?

PHP sometimes fails to connect or takes a long time to connect to the MemCache and Sphinx daemon
Everything is on the same server and connecting to 127.0.0.1
Memcache gives an error:
Warning: Memcache::connect() [memcache.connect]: Can't connect to 127.0.0.1 :11211, Connection timed out (110)
The problem occurs approximately every two minutes.
OS: Centos 6
What could be the reason?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Andrey Burov, 2013-10-26
@BuriK666

the memcached daemon has a switch
-c Use max simultaneous connections; the default is 1024.
Most likely it rests on this

S
Stepan, 2013-10-27
@L3n1n

netstat -atun | awk '{print $5}' | cut -d: -f1 | sed -e '/^$/d' |sort | uniq -c | sort -n

Look at the number of connections. There was a similar situation, a lot of open connections to 127.0.0.1.

E
edogs, 2013-10-27
@edogs

We don’t know what the reason is, but if everything is on the same server, it’s more correct to use sockets in most cases.
At the same time, make sure that the memcache is not available from the external Internet, it is available by default.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question