title: Why is memcache php extension (or memcached) so unreliable?
body: <p>I am disappointed with memcached. Working with it has been far from easy.</p>
  
  <p>An example:</p>
  
  <pre><code>$memcache = new Memcache;
  $memcache-&gt;connect('127.0.0.1', 11211) or die ("Could not connect");
  
  $memcache-&gt;set('id', $array, 120);
  </code></pre>
  
  <p>I set this about an hour ago - and it is still there! The manual says can use the "number of seconds starting from current time" as parameter. So why is the expiry ignored?</p>
  
  <p>Another thing that bugs me is that sometimes values are not written. It all is pretty much random.
  "argyleblanket" mentioned running into those problems in the php manual:
  <a href="http://www.php.net/manual/en/memcache.set.php#84032" rel="nofollow">http://www.php.net/manual/en/memcache.set.php#84032</a>
  I have implemented that fallback on all my replace() calls as well. I don't get why it won't just work on the first call. Why offer a replace() function if it's in the stars if it replaces the content or not?</p>
  
  <p>The question is why would I trust such a software to do anything of importance
  and is there a way to make it more reliable?</p>