MemcachePool :: get (): Local server (tcp 11211, udp 0) failed: Network timeout

I have been working with Memcache and PHP for a long time, and everything was fine, but now I get this error every 10-15 minutes.

MemcachePool::get(): Server localhost (tcp 11211, udp 0) failed with: Network timeout

I thought it might be because of the firewall or something like that, so I turned on my firewall but did not stop giving this message.

After each error, I have to restart memcache.

And this is Memcache not with D on a Windows 7 machine with TSV 5.4.5 MSVC9. I cannot figure out what to do with this Network Timeout problem now . What can be done to solve this problem.

Currently, I only have one local machine with Windows 7, so I cannot create a Memcache cluster or install Memcache (D).

Not sure if this is a problem with memcache daemon or client.

+5
source share
1 answer

I had the same problem: php on Windows 10 and Memcached installed on Ubuntu (works in the Windows subsystem for Linux)

In my case, the problem was that localhostresolved in [::1]:

>ping localhost
Pinging SURFACE-PRO-FRA [::1] with 32 bytes of data:

And Memcached by default listens only to 127.0.0.1.

To solve this problem, you can force Memcached to listen also on ipv6:

$ sudo vi /etc/memcached.conf

Replace

-l 127.0.0.1

with:

-l 127.0.0.1,::1

And then

sudo service memcached restart

Or, conversely, connect your application to 127.0.0.1 instead of localhost.

0
source

Source: https://habr.com/ru/post/1537687/


All Articles