failed connections after longer bursts of requests (on WinXP)

13 views
Skip to first unread message

Steve Clay

unread,
Sep 4, 2008, 3:28:24 PM9/4/08
to memc...@googlegroups.com
I'm trying to ab test a PHP app to compare the performance of disk cache
and memcache (client/server details at end). I realize the win32 ports
are unsupported, but any assistance would be appreciated.

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/

Josef Finsel

unread,
Sep 4, 2008, 3:31:52 PM9/4/08
to memc...@googlegroups.com
Which win port are you using?
--
"If you see a whole thing - it seems that it's always beautiful. Planets, lives... But up close a world's all dirt and rocks. And day to day, life's a hard job, you get tired, you lose the pattern."
Ursula K. Le Guin

Steve Clay

unread,
Sep 4, 2008, 3:41:37 PM9/4/08
to memc...@googlegroups.com
Josef Finsel wrote:
> Which win port are you using?

1.2.4b by Kenneth Dalgleish
http://www.splinedancer.com/memcached-win32/
Using binary release installed as service

Is there a better choice?

Josef Finsel

unread,
Sep 4, 2008, 4:04:32 PM9/4/08
to memc...@googlegroups.com
I don't think I used that one. I know that we have used the 1.2.1 version successfully as well as the 1.2.5 version that was just released. I seem to remember hearing there were some issues with the 1.2.4 windows version but I can tell you the 1.2.5 version we have running in production for some of our sites.

Also, what client are you using?

Steve Clay

unread,
Sep 4, 2008, 4:29:38 PM9/4/08
to memc...@googlegroups.com
Josef Finsel wrote:
> I don't think I used that one. I know that we have used the 1.2.1
> version successfully as well as the 1.2.5 version that was just

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/

Josef Finsel

unread,
Sep 4, 2008, 4:55:17 PM9/4/08
to memc...@googlegroups.com
Try this... put a quick .net test together using the BeIT client for the 1.2.5 server and see if it has the same problems.

Henrik Schröder

unread,
Sep 5, 2008, 5:26:55 AM9/5/08
to memc...@googlegroups.com
How does the connection pooling in that PHP client work, and how big a connection pool do you have? Does it even have one? If you do that short burst test of yours, opening new TCP connections is a performance bottleneck, but if you have a proper connection pool and a hot system, your pool should have grown to a good size that can accomodate the load.

I haven't seen the problem you describe, but I've never used the PHP client either. I'll see if I can make a similar test using our client that uses over 150 concurrent connections.


/Henrik Schröder

Henrik Schröder

unread,
Sep 5, 2008, 6:39:31 AM9/5/08
to memc...@googlegroups.com
I did a quick test, and I don't have a problem with ~300 concurrent connections:

stats
STAT pid 2572
STAT uptime 2098
STAT time 1220610967
STAT version 1.2.5
STAT pointer_size 32
STAT curr_items 1
STAT total_items 8
STAT bytes 16056
STAT curr_connections 296
STAT total_connections 1736
STAT connection_structures 297
STAT cmd_get 58949
STAT cmd_set 8
STAT get_hits 58949
STAT get_misses 0
STAT evictions 0
STAT bytes_read 659213
STAT bytes_written 944747621
STAT limit_maxbytes 67108864
STAT threads 1

In my test program I have 400 threads, all simultaneously getting the same 16k key over and over again, and I obviously run into thread contention so I don't get the full 400 concurrent connections, but still, no errors connecting to my memcached whatsoever.


/Henrik
Reply all
Reply to author
Forward
0 new messages