mod_socache_memcache.c

Checkout Tools
  • last updated 5 hours ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Merge r1774602 from trunk:

Use correct format pattern, "%lu" is wrong for

apr_uint64_t on some platforms.

Followup to r1649491.

Submitted by: rjung

Reviewed/backported by: jim

  1. … 2 more files in changeset.
Merge r1774018 from trunk:

html elements

Reviewed/backported by: jim

  1. … 1 more file in changeset.
Merge r1768245, r1770828 from trunk:

heh... bring memcache up to redis :)

mod_status info

From Norm:

NWGNUsocachmem needs to find mod_status.h

Reviewed/backported by: jim

  1. … 4 more files in changeset.
Merge r1496711, r1597533, r1649491, r1665216, r1756553, r1756631, r1726675, r1718496, r1718476, r1747469 from trunk:

recognize the "default handler name" in r->handler, which is used when

no SetHandler/AddHandler and no matching mimetype during type_checker.

Submitted by: Eric Covener

mod_cache: try to use the key of a possible open but stale cache entry

if we have one in cache_try_lock(). PR 50317

Submitted by: Ruediger Pluem

* modules/cache/mod_socache_memcache.c (socache_mc_store): Pass

through expiration time.

Submitted by: Faidon Liambotis <paravoid debian.org>, jorton

* mod_cache: Preserve the Content-Type in case of 304 response.

304 does not contain Content-Type and mod_mime regenerates

the Content-Type based on the r->filename. This later leads to original

Content-Type to be lost (overwriten by whatever mod_mime generates).

mod_cache: Use the actual URI path and query-string for identifying the

cached entity (key), such that rewrites are taken into account when

running afterwards (CacheQuickHandler off). PR 21935.

mod_cache: follow up to r1756553: log the real/actual cached URI (debug).

better s-maxage support

+ *) mod_cache: Consider Cache-Control: s-maxage in expiration

+ calculations. [Eric Covener]

+

+ *) mod_cache: Allow caching of responses with an Expires header

+ in the past that also has Cache-Control: max-age or s-maxage.

+ PR55156. [Eric Covener]

remove dead code leftover from r1023387.

Prior to this revision, there was an apr_atoi64 in this context.

Now, ap_cache_control() sets control.max_age (which is checked here) when

the maxage value was parsed OK.

duplicate debug-level AH00764 in the just-validated path.

Rename ap_casecmpstr[n]() to ap_cstr_casecmp[n](), update with APR doxygen

Submitted by: jkaluza, jorton, jkaluza, ylavic, ylavic, covener, covener, covener, wrowe

Reviewed/backported by: jim

  1. … 10 more files in changeset.
Merge r1696105, r1700418 from trunk:

With the current implementation, it is likely to connect/close a socket with the memcache server for each command sent.

The root cause is a too small idle timeout (600 microseconds).

Add a new directive, 'MemcacheConnTTL', to control this idle connection timeout with the memcache server(s).

Change the default value from 600 usec (!) to 15 sec as per Yann suggestion.

I've limited accepted values from 1 to 1800 seconds (half an hour) because internaly, the value passed to 'apr_memcache_server_create' is still in mirco-seconds.

PR 58091

~~~~~~~~~~~~~~~~~~~_

Homemade measurement (on a slighly modified version of httpd) shows a +30% in number of processed requests using memcache to cache /index.html.

Comparison made between the 600 usec and 15 sec TTL.

Memcache config:

default

httpd Config:

CacheEnable socache /

CacheSocache memcache:127.0.0.1

LoadModule mpm_event_module modules/mod_mpm_event.so

httpd compiled with:

./configure --enable-mpms-shared=all --with-included-apr --with-mysql --with-libxml2 --enable-modules=reallyall --enable-ssl-ct=no --enable-maintainer-mode --prefix=$HOME/httpd-2.5

httpd and memcache running on the same VM running under Ubuntu 15.04

Load tested using:

ab -n 20000 http://127.0.0.1/index.html

Creation/closing of connections beetween httpd and memcache confirmed using the telnet connection to memcache and the stats command

Allow 0 as a valid value (never close idle connections)

Increased maximum allowed value to 3600 s (1 hour)

Use 'ap_timeout_parameter_parse' to allow more flexible configuration (i.e. h, min, s, ms suffixes)

Use 'apr_time_from_sec' when applicable.

Submitted by: jailletc36

Reviewed/backported by: jim

  1. … 5 more files in changeset.
  1. … 10 more files in changeset.
Merge r1429561 from trunk:

According top my testing 'socache_mc_id2key' is 6x faster with the use 'ap_bin2hex' instead of

apr_snprintf(..., "%02X" for each character.

Output is *not* exactly the same. It was uppercase, now it is lowercase.

According to my understanding, this is not an issue.

Should it be, a call to ap_str_toupper should be added.

The speedup would be less, but still significant.

Submitted by: jailletc36

Reviewed/backported by: jim

  1. … 2 more files in changeset.
Backport r1209766, r1210252, r1210284:

Add lots of unique tags to error log messages

ssl_util.c: Downgrade some dynamic locking messages from level DEBUG

to TRACE1-3

  1. … 164 more files in changeset.
Merge r1210221:

Change the provider names to match the module names:

mod_slotmem_shm: shared -> shm

mod_socache_memcache: mc -> memcache

  1. … 7 more files in changeset.
Merge r1208110:

Remove more log message prefixes that are now redundant as the

the error log format includes the module name.

  1. … 8 more files in changeset.