This is not possible. If the connections are persistent per process,
TIME_WAIT should not be an issue as they are not closed. There are
people on this lists with hundreds of thousands of open connections per
memcached server.
Brian.
--------
http://brian.moonspot.net/
On 4/7/10 1:39 PM, Jay Paroline wrote:
Ok, I think I wasn't clear enough in my question, so I wrote a simple
example.
<?php
set_time_limit(0);
$m = new Memcached('pool');
$m->addServer('172.16.0.64', 11211);
$m->add('monkeys', '5');
while(1){
$m->get('monkeys');
sleep(5);
}
?>
If 5 of these are running at the same time, I would *like* to have
them all sharing the same connection. But that's not what happens:
[r...@lifebook ~]# php testMemcachePool.php&
[1] 3291
[r...@lifebook ~]# netstat -tnap | grep 11211
tcp 0 0 172.16.1.84:47401
172.16.0.64:11211 ESTABLISHED 3291/php
[r...@lifebook ~]# php testMemcachePool.php&
[2] 3294
[r...@lifebook ~]# netstat -tnap | grep 11211
tcp 0 0 172.16.1.84:47401
172.16.0.64:11211 ESTABLISHED 3291/php
tcp 0 0 172.16.1.84:47402
172.16.0.64:11211 ESTABLISHED 3294/php
[r...@lifebook ~]# php testMemcachePool.php&
[3] 3297
[r...@lifebook ~]# netstat -tnap | grep 11211
tcp 0 0 172.16.1.84:47401
172.16.0.64:11211 ESTABLISHED 3291/php
tcp 0 0 172.16.1.84:47402
172.16.0.64:11211 ESTABLISHED 3294/php
tcp 0 0 172.16.1.84:47403
172.16.0.64:11211 ESTABLISHED 3297/php
[r...@lifebook ~]# php testMemcachePool.php&
[4] 3300
[r...@lifebook ~]# netstat -tnap | grep 11211
tcp 0 0 172.16.1.84:47404
172.16.0.64:11211 ESTABLISHED 3300/php
tcp 0 0 172.16.1.84:47401
172.16.0.64:11211 ESTABLISHED 3291/php
tcp 0 0 172.16.1.84:47402
172.16.0.64:11211 ESTABLISHED 3294/php
tcp 0 0 172.16.1.84:47403
172.16.0.64:11211 ESTABLISHED 3297/php
[r...@lifebook ~]# php testMemcachePool.php&
[5] 3303
[r...@lifebook ~]# netstat -tnap | grep 11211
tcp 0 0 172.16.1.84:47404
172.16.0.64:11211 ESTABLISHED 3300/php
tcp 0 0 172.16.1.84:47405
172.16.0.64:11211 ESTABLISHED 3303/php
tcp 0 0 172.16.1.84:47401
172.16.0.64:11211 ESTABLISHED 3291/php
tcp 0 0 172.16.1.84:47402
172.16.0.64:11211 ESTABLISHED 3294/php
tcp 0 0 172.16.1.84:47403
172.16.0.64:11211 ESTABLISHED 3297/php
On our production servers, we might have 200 apache processes running
at the same time (each running PHP). We have 21 memcached buckets, so
our worst case scenario is 4200 active connections to memcached from
just one front end node. In reality I'm counting 2583 with a sate of
ESTABLISHED right now with 137 httpd processes.
--
To unsubscribe, reply using "remove me" as the subject.