You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2006/06/13 14:33:51 UTC

DO NOT REPLY [Bug 39799] New: - mod_mem_cache not caching reverse proxied files

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39799>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39799

           Summary: mod_mem_cache not caching reverse proxied files
           Product: Apache httpd-2
           Version: 2.2.2
          Platform: Sun
        OS/Version: Solaris
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Other Modules
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: mike.scott@rightmove.co.uk


We are trying to use Apache 2.2.2 with mod_cache and mod_mem_cache as a reverse
proxy server to reduce disk load on a main server, caching files in memory. But
it doesn't appear to cache the files. If I use mod_disk_cache instead of
mod_mem_cache, the files are cached correctly.

Here is the httpd.conf file:

ServerRoot /usr/local/apache2.2
Listen 80
ServerAdmin systems@rightmove.co.uk
ServerName media.rightmove.co.uk
DocumentRoot "/usr/local/apache2.2/htdocs"
<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>
<Directory "/usr/local/apache2.2/htdocs">
    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
<FilesMatch "^\.ht">
    Order allow,deny
    Deny from all
    Satisfy All
</FilesMatch>

ErrorLog logs/error_log
LogLevel debug
<IfModule log_config_module>
    LogFormat "%h %l %u %t \"%r\" %>s %b" common
    CustomLog logs/access_log common
</IfModule>

User nobody
Group nobody

DefaultType text/plain
<IfModule mime_module>
    TypesConfig conf/mime.types
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
</IfModule>

#Include conf/extra/httpd-mpm.conf

ProxyRequests Off
ProxyPass / http://h1-img.rightmove.com/
ProxyPassReverse / http://h1-img.rightmove.com/
ProxyPreserveHost On

CacheEnable mem /
#CacheEnable disk /
CacheDefaultExpire 3600
CacheLastModifiedFactor 0.05
CacheMaxExpire 3600
CacheIgnoreCacheControl On
CacheIgnoreNoLastMod On

CacheMaxFileSize 8192
CacheRoot /export/home/apache/cache

MCacheMaxObjectSize 8192
MCacheMaxObjectCount 1000000
MCacheRemovalAlgorithm GDSF
MCacheSize 1000000

UseCanonicalName Off

StartServers       10
ServerLimit        100
MaxClients         100
MaxRequestsPerChild  0


Here are the HTTP headers from the first attempt to load a file (via telnet to
port 80):

# telnet h1-cache 80
Trying 10.6.3.5...
Connected to h1-cache.rightmove.com.
Escape character is '^]'.
GET /14k/13115/13115_419067A_19067_IMG_00_t.JPG HTTP/1.1
Host:media.rightmove.co.uk

HTTP/1.1 200 OK
Date: Tue, 13 Jun 2006 12:29:11 GMT
Server: Apache/1.3.29 (Unix)
Last-Modified: Sun, 28 May 2006 09:39:03 GMT
ETag: "f4ac4-d92-44796fb7"
Accept-Ranges: bytes
Content-Length: 3474
Content-Type: image/jpeg
Expires: Tue, 13 Jun 2006 13:29:12 GMT

Here are the HTTP headers from a second load of the same file:

# telnet h1-cache 80
Trying 10.6.3.5...
Connected to h1-cache.rightmove.com.
Escape character is '^]'.
GET /14k/13115/13115_419067A_19067_IMG_00_t.JPG HTTP/1.1
Host:media.rightmove.co.uk

HTTP/1.1 200 OK
Date: Tue, 13 Jun 2006 12:29:52 GMT
Server: Apache/1.3.29 (Unix)
Last-Modified: Sun, 28 May 2006 09:39:03 GMT
ETag: "f4ac4-d92-44796fb7"
Accept-Ranges: bytes
Content-Length: 3474
Content-Type: image/jpeg
Expires: Tue, 13 Jun 2006 13:29:52 GMT


Here are the error_log entries (note that log level is set to DEBUG):

[Tue Jun 13 13:29:12 2006] [debug] mod_cache.c(129): Adding CACHE_SAVE filter
for /14k/13115/13115_419067A_19067_IMG_00_t.JPG
[Tue Jun 13 13:29:12 2006] [debug] mod_cache.c(136): Adding CACHE_REMOVE_URL
filter for /14k/13115/13115_419067A_19067_IMG_00_t.JPG
[Tue Jun 13 13:29:12 2006] [debug] mod_proxy_http.c(54): proxy: HTTP:
canonicalising URL //h1-img.rightmove.com/14k/13115/13115_419067A_19067_IMG_00_t.JPG
[Tue Jun 13 13:29:12 2006] [debug] proxy_util.c(1378): [client 10.6.3.3] proxy:
http: found worker http://h1-img.rightmove.com/ for
http://h1-img.rightmove.com/14k/13115/13115_419067A_19067_IMG_00_t.JPG
[Tue Jun 13 13:29:12 2006] [debug] mod_proxy.c(756): Running scheme http handler
(attempt 0)
[Tue Jun 13 13:29:12 2006] [debug] mod_proxy_http.c(1662): proxy: HTTP: serving
URL http://h1-img.rightmove.com/14k/13115/13115_419067A_19067_IMG_00_t.JPG
[Tue Jun 13 13:29:12 2006] [debug] proxy_util.c(1798): proxy: HTTP: has acquired
connection for (h1-img.rightmove.com)
[Tue Jun 13 13:29:12 2006] [debug] proxy_util.c(1858): proxy: connecting
http://h1-img.rightmove.com/14k/13115/13115_419067A_19067_IMG_00_t.JPG to
h1-img.rightmove.com:80
[Tue Jun 13 13:29:12 2006] [debug] proxy_util.c(1951): proxy: connected
/14k/13115/13115_419067A_19067_IMG_00_t.JPG to h1-img.rightmove.com:80
[Tue Jun 13 13:29:12 2006] [debug] proxy_util.c(2045): proxy: HTTP: fam 2 socket
created to connect to h1-img.rightmove.com
[Tue Jun 13 13:29:12 2006] [debug] proxy_util.c(2141): proxy: HTTP: connection
complete to 10.6.3.1:80 (h1-img.rightmove.com)
[Tue Jun 13 13:29:12 2006] [debug] mod_proxy_http.c(1448): proxy: start body send
[Tue Jun 13 13:29:12 2006] [debug] mod_cache.c(602): cache: Caching url:
/14k/13115/13115_419067A_19067_IMG_00_t.JPG
[Tue Jun 13 13:29:12 2006] [debug] mod_cache.c(608): cache: Removing
CACHE_REMOVE_URL filter.
[Tue Jun 13 13:29:12 2006] [info] mem_cache: Cached url:
http://media.rightmove.co.uk:80/14k/13115/13115_419067A_19067_IMG_00_t.JPG?
[Tue Jun 13 13:29:12 2006] [debug] mod_proxy_http.c(1537): proxy: end body send
[Tue Jun 13 13:29:12 2006] [debug] proxy_util.c(1816): proxy: HTTP: has released
connection for (h1-img.rightmove.com)
[Tue Jun 13 13:29:52 2006] [debug] mod_cache.c(129): Adding CACHE_SAVE filter
for /14k/13115/13115_419067A_19067_IMG_00_t.JPG
[Tue Jun 13 13:29:52 2006] [debug] mod_cache.c(136): Adding CACHE_REMOVE_URL
filter for /14k/13115/13115_419067A_19067_IMG_00_t.JPG
[Tue Jun 13 13:29:52 2006] [debug] mod_proxy_http.c(54): proxy: HTTP:
canonicalising URL //h1-img.rightmove.com/14k/13115/13115_419067A_19067_IMG_00_t.JPG
[Tue Jun 13 13:29:52 2006] [debug] proxy_util.c(1378): [client 10.6.3.3] proxy:
http: found worker http://h1-img.rightmove.com/ for
http://h1-img.rightmove.com/14k/13115/13115_419067A_19067_IMG_00_t.JPG
[Tue Jun 13 13:29:52 2006] [debug] mod_proxy.c(756): Running scheme http handler
(attempt 0)
[Tue Jun 13 13:29:52 2006] [debug] mod_proxy_http.c(1662): proxy: HTTP: serving
URL http://h1-img.rightmove.com/14k/13115/13115_419067A_19067_IMG_00_t.JPG
[Tue Jun 13 13:29:52 2006] [debug] proxy_util.c(1798): proxy: HTTP: has acquired
connection for (h1-img.rightmove.com)
[Tue Jun 13 13:29:52 2006] [debug] proxy_util.c(1858): proxy: connecting
http://h1-img.rightmove.com/14k/13115/13115_419067A_19067_IMG_00_t.JPG to
h1-img.rightmove.com:80
[Tue Jun 13 13:29:52 2006] [debug] proxy_util.c(1951): proxy: connected
/14k/13115/13115_419067A_19067_IMG_00_t.JPG to h1-img.rightmove.com:80
[Tue Jun 13 13:29:52 2006] [debug] proxy_util.c(2045): proxy: HTTP: fam 2 socket
created to connect to h1-img.rightmove.com
[Tue Jun 13 13:29:52 2006] [debug] proxy_util.c(2141): proxy: HTTP: connection
complete to 10.6.3.1:80 (h1-img.rightmove.com)
[Tue Jun 13 13:29:52 2006] [debug] mod_proxy_http.c(1448): proxy: start body send
[Tue Jun 13 13:29:52 2006] [debug] mod_cache.c(602): cache: Caching url:
/14k/13115/13115_419067A_19067_IMG_00_t.JPG
[Tue Jun 13 13:29:52 2006] [debug] mod_cache.c(608): cache: Removing
CACHE_REMOVE_URL filter.
[Tue Jun 13 13:29:52 2006] [info] mem_cache: Cached url:
http://media.rightmove.co.uk:80/14k/13115/13115_419067A_19067_IMG_00_t.JPG?
[Tue Jun 13 13:29:52 2006] [debug] mod_proxy_http.c(1537): proxy: end body send
[Tue Jun 13 13:29:52 2006] [debug] proxy_util.c(1816): proxy: HTTP: has released
connection for (h1-img.rightmove.com)

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

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


DO NOT REPLY [Bug 39799] - mod_mem_cache not caching reverse proxied files

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39799>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39799


rpluem@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO




------- Additional Comments From rpluem@apache.org  2006-06-13 15:16 -------
Please keep in mind that each process of httpd has its own mem_cache (=>
mod_mem_cache gets more and more effective with worker MPM and a high number of
threads per process and a low number of processes). So I guess your second
request got to another httpd process. Please repeat the same with a keepalive
connection (so only one telnet call) which ensures that you are connected to the
same httpd process:

telnet h1-cache 80
GET /14k/13115/13115_419067A_19067_IMG_00_t.JPG HTTP/1.1
Host: media.rightmove.co.uk

<Some output>

GET /14k/13115/13115_419067A_19067_IMG_00_t.JPG HTTP/1.1
Host: media.rightmove.co.uk


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

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


DO NOT REPLY [Bug 39799] - mod_mem_cache not caching reverse proxied files

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39799>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39799





------- Additional Comments From mike.scott@rightmove.co.uk  2006-06-14 14:04 -------
(In reply to comment #1)
> Please keep in mind that each process of httpd has its own mem_cache (=>
> mod_mem_cache gets more and more effective with worker MPM and a high number of
> threads per process and a low number of processes). So I guess your second
> request got to another httpd process. Please repeat the same with a keepalive
> connection (so only one telnet call) which ensures that you are connected to the
> same httpd process:

Thank you, this explains it completely. This is therefore a documentation error
rather than a code error, since there is no mention that I can see of this
rather important point at http://httpd.apache.org/docs/2.2/mod/mod_mem_cache.html

Meanwhile, I've got it working properly using the worker MPM with a single
process and 3000 threads -- which seems to be performing OK on Solaris.


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

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