Hello, I have written an Apache module which uses apr_memcache. While benchmarking with e.g. "ab -n 5000 -c 40", I find that there are lots of sockets in TIME_WAIT after each test:
tcp 0 0 127.0.0.1:11211 127.0.0.1:59866 TIME_WAIT
-
tcp 0 0 127.0.0.1:11211 127.0.0.1:60125 TIME_WAIT
-
tcp 0 0 127.0.0.1:11211 127.0.0.1:59860 TIME_WAIT
-
# netstat -tupan | grep 11211 | grep WAIT | wc -l
3057
Apache is running in worker mode with thread_limit=64. The behaviour is
the same with prefork mode.
According to the memcache stats, curr_connections alternates quickly
between 3 and about 40.
I wonder if I'm doing something wrong. I have basically copied the code
from ssl_scache_memcache.c. My expectation would be that connections are
kept open and reused.
I create the server like this:
ap_mpm_query(AP_MPMQ_HARD_LIMIT_THREADS, &thread_limit);
apr_memcache_server_create(p, host_str, port, 0, 1, thread_limit, 600, &st);
Any idea?
Thanks,
Peter
--
SUSE LINUX Products GmbH Bug, bogey, bugbear, bugaboo:
Research & Development A malevolent monster (not true?);
Some mischief microbic;
What makes someone phobic;
The work one does not want to do.
From: Chris Young (The Omnificent English Dictionary In Limerick Form)
pgpZjp4OiDtGt.pgp
Description: PGP signature
