Hi all,I have Apache used as a load balancer in front of a couple of Mongrels (ruby on rails application). Reading the documentation for Apache, I was under the impression that the requests would not be forwarded to my Mongrels, but would stop at Apache, at least until the Expires time.
Here's a typical request / response (1st time): > GET / HTTP/1.1> User-Agent: curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3
> Host: xlsuite.com > Accept: */* > < HTTP/1.1 200 OK < Date: Fri, 13 Jun 2008 16:01:01 GMT < Server: Mongrel 1.1.4 < Last-Modified: Thu Apr 03 11:19:22 UTC 2008 < Status: 200 OK < Cache-Control: public;max-age=300 < Content-Type: text/html; charset=UTF-8 < Content-Length: 4458 < Expires: Fri Jun 13 16:06:01 +0000 2008 < Set-Cookie: session_id=744e857c1fdb806acbfc7b803f67fa13; path=/ < Vary: Accept-Encoding Redoing the same request still hits one of my mongrel.If I use ab while tailing the mongrel logs, I see the requests. My question is two-fold:
1. Have I configured this properly; 2. Should I use another caching provider ?Having read a couple of messages on this list, I know mod_mem_cache might not be the best solution. This Apache is a software load balancer: it serves almost no static files.
Thanks for any help and have a nice day! -- François Beausoleil http://xlsuite.com/# Apache 2.2 configuration file, on Ubuntu 7.04, stock Apache installation.
<VirtualHost *> ServerName xlsuite.com DocumentRoot /var/www/xlsuite/current/public <Proxy *> Allow from all </Proxy> <Proxy balancer://xlsuite_hosted> BalancerMember http://192.168.1.1:2000 BalancerMember http://192.168.1.2:2000 # more defined here </Proxy> ProxyPass / balancer://xlsuite_hosted/ ProxyPassReverse / balancer://xlsuite_hosted ProxyPreserveHost on ProxyRequests Off RewriteEngine On # Redirect all non-static requests to cluster RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f RewriteRule ^/(.*)$ balancer://xlsuite_hosted%{REQUEST_URI} [P,QSA,L] # DeflateAddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/javascript text/css
BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozilla/4.0[678] no-gzip BrowserMatch \bMSIE !no-gzip !gzip-only-text/html </VirtualHost> # mod_cache, mod_mem_cache configuration CacheEnable mem / # Specified in Kb. 1 Gb = 1024 * 1024 Kb MCacheSize 1048576# A prime number, because it's stored in a hash, and the hash needs to have space, yada, yada
MCacheMaxObjectCount 7919 # 48 bytes MCacheMinObjectSize 48 # 4 Mb MCacheMaxObjectSize 4194304 # 4 Mb MCacheMaxStreamingBuffer 4194304 # Remove extraneous information from the response ServerTokens Min ProxyVia Off ServerSignature Off ExtendedStatus Off ProxyStatus On # == End of Apache config file --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See <URL:http://httpd.apache.org/userslist.html> for more info. To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx " from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx