php - Memcached client hang when memcache server is unavailable -


we use laravel , memcached our caching system. i'm trying achieve fallback mechanism, if our cache node unavailable fallback database.

however when our memcache node down or unreachable, memcached client hang around 12 seconds long timeout.

i want able answer memcached node or memcached client in max 1 second, couldn't find way fail fast, please advise.

i tried overwrite cache manager of laravel , have own memcached driver following options:

public function creatememcacheddriver(array $config) {     $repository = parent::creatememcacheddriver($config);     $memcache = $repository->getmemcached();      $memcache->setoption(\memcached::opt_connect_timeout, 100);     $memcache->setoption(\memcached::opt_retry_timeout, 300);     $memcache->setoption(\memcached::opt_send_timeout, 1000);     $memcache->setoption(\memcached::opt_recv_timeout, 0);     $memcache->setoption(\memcached::opt_poll_timeout, 1000);     $memcache->setoption(\memcached::opt_server_failure_limit, 2);      return $repository; } 

this didn't change anything.

how can set smaller timeout on memcached client?


Comments

Popular posts from this blog

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -