apr-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 51511] New: apr_memcache_server_create creates connection pool with invalid TTL
Date Thu, 14 Jul 2011 21:54:50 GMT

             Bug #: 51511
           Summary: apr_memcache_server_create creates connection pool
                    with invalid TTL
           Product: APR
           Version: HEAD
          Platform: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: APR
        AssignedTo: bugs@apr.apache.org
        ReportedBy: timw@apache.org
    Classification: Unclassified

Created attachment 27285
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=27285
Patch to correct memcache pool ttl

The ttl parameter to apr_memcache_server_create is documented as:

"time to live in seconds of a client connection"

Subversion (in my case 1.6.11, but still the same in trunk), calls this with
the value 50.

This parameter is passed directly to apr_reslist_create without modification,
however the ttl parameter to apr_reslist_create is a        
apr_interval_time_t microseconds value.

The net result of this is that connections to memcache are closed immediately
after they are returned to the pool by the Subversion process. 
It seems that the pool is using a 50 microsecond TTL value, and closing any
connection pretty much immediately after use.

On our Subversion server, we observe port exhaustion, with > 30,000 TCP sockets
to the memcache port in TIME_WAIT (unless we turn on very aggressive time_wait
reuse/recycle options).

A tcpdump capture on that server reveals every connection is closed with a
memcache quit command, and tracing back through the code this is only called
from the conn_clean pool cleanup handler.

Patching apr_memcache_server_create to multiply the TTL by 1,000,000 fixes the
issue on our server (as observed by the number of TIME_WAIT sockets and
connections to memcached).

Patch against 1.3.9 (which should apply cleanly against trunk) is attached.

Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org

View raw message