During each connection I'm only doing a single get for a 16K binary item
(some gzipped content).
With short bursts of connections (400 concurrent requests) memcached
behaves fine (though quite a bit slower than disk reads).
When I lengthen the test to 1000 requests and run this a few times (3 or
4 seconds of break between), memcached stops accepting connections
during the 3rd or so run. With every 20th request I'm logging the
stats['curr_connections'] and it never gets above 150 or so. In fact,
even with no concurrency, around 800 requests in the client stops
connecting and then needs some time to breathe...
I had identical results this morning on another XP box with similar
setup. Any ideas on how I can investigate this? Should I chalk this up
to "immature Win32 port"?
If I set up a VM w/ Linux + memcached, will I be able to connect to it
from Windows?
PHP 5.2.6 / Apache 2.2.9 / WinXP
PHP memcache client 2.2.4-dev R1.99
memcached 1.2.4 Win32 beta (9/3/2008) limit 1024 connections / 64MB
http://www.splinedancer.com/memcached-win32/
--
Steve Clay
http://mrclay.org/
1.2.4b by Kenneth Dalgleish
http://www.splinedancer.com/memcached-win32/
Using binary release installed as service
Is there a better choice?
Both the 1.2.1 [1] I tried this morning and the 1.2.5 [2] I just tried
had identical behavior. Maybe the PHP client (2.2.4-dev R1.99) or Apache
is exhausting resources.
I've boiled my PHP page down to a memcache connect and stats read (see
below). I'm running 1000 requests, 100 concurrently.
First run: # connections max at: 84, no fails until request 968
Later runs: # connections low, ~50% fails increasing with each run.
<?php
$mc = new Memcache;
if (! @$mc->connect('localhost', 11211)) {
file_put_contents(
dirname(__FILE__) . '/../memcached_stats.txt'
,"Fail\n"
,FILE_APPEND | LOCK_EX
);
die();
}
$stats = $mc->getStats();
file_put_contents(
dirname(__FILE__) . '/../memcached_stats.txt'
,$stats['curr_connections'] . "\n"
,FILE_APPEND | LOCK_EX
);
[1] http://jehiah.cz/projects/memcached-win32/
[2] http://code.jellycan.com/memcached/