title: Failed to write session data (memcache)
body: <p>I'm noticing an <strong><em>intermittent</em></strong> issue with our Memcached session handler. The error that occurs is:</p>
  
  <blockquote>
    <p>Unknown: Failed to write session data (memcache). Please verify that
    the current setting of session.save_path is correct.</p>
  </blockquote>
  
  <p>Notes:</p>
  
  <ul>
  <li>It seems to be an intermittent issue that occurs 5 or 6 times a day to various users.</li>
  <li>Memcached is not localhost. i.e. It's on a different server than the web server.</li>
  <li>I'm using the Memcache extension (as opposed to the MemcacheD extension).</li>
  <li>I'm using the tcp prefix. If you look at <a href="https://stackoverflow.com/questions/12112319/failed-to-write-session-data-php-and-memcached">this question</a>, you'll see that the "fix" was to put tcp:// a prefix if you're using the Memcache extension.</li>
  </ul>
  
  <p>My php.ini settings:</p>
  
  <pre><code>session.save_handler = memcache
  session.save_path = "tcp://64.233.191.255:11211"
  </code></pre>
  
  <p>Note that I've also used:</p>
  
  <pre><code>session.save_path = "tcp://64.233.191.255:11211?persistent=1&amp;weight=1&amp;timeout=1&amp;retry_interval=15"
  </code></pre>
  
  <p>But it doesn't seem to matter.</p>
  
  <p>Checked the memcached.log file, where I found the following error:</p>
  
  <blockquote>
    <p>Failed to write, and not due to blocking: Connection reset by peer.</p>
  </blockquote>
  
  <p>Note: This particular error occurs at least once, at the same time (01:07AM), everyday. It will then occur sporadically throughout the day.</p>