I try to force PHP to memcache the timeout extension almost immediately if the memcached server to which I connect is connected (for some reason). I would like to make an exception in this case (which will be handled elsewhere).
I searched and tried different things without any luck. I am adding servers (only one so far) to the standard pool:
$this->memcache->addServer ( $server['host'], $server['port'] );
Then I killed memcached deamon (also tried with the wrong port and host) and opened my page. It just loads for a very long time, and then nginx returns with a 504 Gateway Time-out error.
How can I tell the memcache client to try, I donβt know, 1 second, and then give up, and at that moment I must somehow find the timeout.
The bottom line is that if our memcached server is unavailable, I would like to display a user-friendly error page as soon as possible (already working on uncaught exceptions) and not force the user to wait 30 seconds before he sees a general server error.
source share