If you're using the libmemcached client (http://pecl.php.net/package/memcached ), be sure to instantiate the Memcached instance with a persistent_id. Also Memcached::addServers behaves much differently from the other PHP memcache client -- the server list is persistent and it doesn't check for duplicates. If you're calling it on each pageload, over the lifetime of an apache process you'll accumulate thousands of connections. That's one way to get to 20k connections.

Peter

On Dec 21, 2009, at 6:45 AM, Henrik Schröder wrote:

Most database connectors use pooled connections by default, but with the PHP clients you have to explicitly use it. I've never really used the PHP client, but I think you should use AddServer instead of Connect or something. Look it up in the manual.


/Henrik

On Mon, Dec 21, 2009 at 02:14, majikman <[email protected]> wrote:
We recently migrated a lot of data off our mysql server and onto our
memcached servers. One thing we're noticing is that we're getting a
disproportionate larger number of connections to memcached than to
mysqld. Mysqld will usually get anywhere from 100-300 connections at a
time. Our memcached servers, on the other hand, will have as many as
20k connections at a time. Is this normal or should I suspect
something is the matter?

We're running Apache 2.2.x in prefork with PHP 5.2.x. memcache 1.4.1
and mysql 5.1.x.

Thanks in advance.


Reply via email to