PHP 5.5, NGINX and Memcached - 502 Error -
PHP 5.5, NGINX and Memcached - 502 Error -
i'm having problem memcached pools. seek add together context of error see if guys can help me this.
context:
php 5.5.17 (cgi-fcgi) (built: sep 24 2014 20:38:04) php-pecl-memcache-3.0.8-2.fc17.remi.5.5.x86_64 nginx version: nginx/1.0.15my problem:
i creating connection memcached , saving several keys, in 1 server first, this:
$_memcache = new memcache; $_memcache->addserver("127.0.0.1", "11211", true, 50, 3600, 45);
so, allow suppose add together several keys, in server , can without problem, can, when see site , code calling keys, it's getting it.
now problem, allow keys saved , working without problem, added memcached server pool, way:
$_memcache = new memcache; $_memcache->addserver("10.0.0.2", "11211", true, 50, 3600, 45); $_memcache->addserver("10.0.0.3", "11211", true, 50, 3600, 45);
but before refreshed site run code , keys have storage in first server stopped memcached in server number 1 (10.0.0.2), after refreshed site , received 502 error (bad gateway)
the error seeing in log of nginx is:
[error] 9364#0: *329504 recv() failed (104: connection reset peer) while reading response header upstream, client: xx.xx.xxx.xxx, server: _, request: "get / http/1.1", upstream: "fastcgi://unix:/run/php-fastcgi/sock:", host: "www.myhost.com"
so, why getting error. theory have reason because connections persistent not closing when stop memcached server, happens when have pool of x > 1 servers. if utilize 1 , stopped won't see error.
there way php 5.5 has bug fastcgi socket don't know.
note: problem having wasn't happening on previous php version 5.3, after changing version happening.
note: when don't utilize persistent connection seems work, site has huge traffic , won't handle amount of connections open, tested in dev environment.
any help or suggestions more welcome.
thanks in advance!
nginx memcached php-5.5
Comments
Post a Comment