Le 24/08/2015 11:18, Yann Ylavic a écrit :
On Mon, Aug 24, 2015 at 8:17 AM, Christophe JAILLET
<christophe.jail...@wanadoo.fr> wrote:
Le 21/08/2015 15:47, Yann Ylavic a écrit :
On Sun, Aug 16, 2015 at 12:05 AM,  <jaillet...@apache.org> wrote:
+    if ((i < 1) || (i > 1800)) {
Why a limit of 1800? Maybe the implicit INT_MAX is good enough.
Also the memcached may never close its connections by itself, or
always do, so -1 and 0 could also be interesting...
Obviously 0 should be allowed, but I don't see any reason for -1. What
difference would you make between the 2?
Hm, I thought that for apr_memcache_server_create (hence
apr_reslist_create), ttl=0 was "always close" (immediately) and -1 was
"never close" (infinite), but that's not the case (ttl=0 means "never
close", and -1 is invalid).
Correct.

I don't know if memcached can be configured to always close the
connections when done (I guess so), but since the minimal TTL is 1
second, we could end up reusing connections closed remotely (without
recovering on error) in this case.
AFAIK, memcached can not be configured to close connections by itself.

Apparently all mpm are configured to ignore SIGPIPE, so apr_socket_send() should just return the error and the logic in apr_memcache should handle it.
I.e.:
     ms_bad_conn(ms, conn);
     apr_memcache_disable_server(mc, ms);


So why wouldn't we recover? If the connection is closed for whatever reason, wouldn't the server be marked as DEAD? Following calls to apr_memcache_find_server_hash_default would try it again after 5 s.

So maybe our best option is to use ap_timeout_parameter_parse() to set
sconf->ttl, which would allow a TTL of 1 microsecond (min), and almost
no max (native 64bit apr_time_t)...

Regards,
Yann.

TTL value passed to apr_memcache_server_create is a apr_uint32_t.
It is then passed as-is to apr_reslist_create as a apr_interval_time_t (i.e. apr_int64_t)

So, there *IS* a max value of 2^32 usec  =  4294 s  ~ 3600 s  =  1h

Indeed, ap_timeout_parameter_parse() would be nice. This would allow TTL in 
millisecond (ms). min is for minutes.
However having an upper limit of 4294 s (or 3600 in order to have a round 
value) still makes sense to me.


CJ

Reply via email to