apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dr. Peter Poeml" <po...@suse.de>
Subject apr_memcache and sockets in TIME_WAIT
Date Wed, 21 Feb 2007 11:24:41 GMT

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         TIME_WAIT   -        
tcp        0      0         TIME_WAIT   -        
tcp        0      0         TIME_WAIT   -        

 # netstat -tupan | grep 11211 | grep WAIT | wc -l

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?

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)

View raw message