title: PHP memcache connect
body: <p>I have a page where few thousands of users can hit a method at the same time . I do have following code where I connect every time . Since this will go to a seperate memcache server will this cause slowdowns is there a way to connect just once and reuse that connection ? Do I have to close connection after every request ? </p>
  
  <pre><code>$primary_connected = $memcache_primary-&gt;connect($primary_memcache_server, 11211);
  if($primary_connected){
          $data = $memcache_primary-&gt;get($key);
          if ($data != NULL) {
              return data;
          }
   }
  else{
  /////Get data from database 
  }
  </code></pre>