On Mar 26, 2008, at 7:23 AM, Jeff wrote:
>
> Thanks for the reply, Ezra.  We actually have an NFS mount set up, but
> I've read your warnings against NFS, so I'd like to try memcached.
> The only kicker is we are running Apache, which I know how to change
> the Rewrite rules to look for static content on the mount first, but
> not sure how to do that with Apache + memcached.   This may be the
> excuse I've been looking for to dump Apache, anyway.
>
> thanks again for the help,
> jeff



Hey Jeff-

        It's a great excuse to dump apache ;) But before you do that take a  
look at this module:

http://tangent.org/608/mod_memcached.html

        I have not used this and I don't know much about it but it can  
probably do the same thing nginx mod_memcached can do I would imagine.  
In case you decide to try nginx let me save you a little time with the  
magic memcached config options:

Say you have all page caches in /article

   location /article {

     proxy_intercept_errors  on;
     default_type text/html;
     charset UTF-8;

     if ($request_method = GET) {
         # Say nginx to try to fetch some key from memcache:
              # serve with correct mime type and charset
         set $memcached_key "app-production:article:$uri";
         memcached_pass memcached_cluster;
         # If no info would be found in memcache or memecache would be  
dead, go to
         # /fallback location
         error_page 404 502 504 = @fallback;
         break;
      }

     if (!-f $request_filename) {
       proxy_pass http://mongrels;
       break;
     }
   }



   location @fallback {
         proxy_set_header Host $http_host;
         proxy_set_header X-Real-IP $remote_addr;
         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
         proxy_redirect false;
         proxy_max_temp_file_size 0;
         # Pass request to mongrel
         proxy_pass http://mongrels;
   }


Cheers-

- Ezra Zygmuntowicz
-- Founder & Software Architect
-- [EMAIL PROTECTED]
-- EngineYard.com


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Deploying Rails" group.
To post to this group, send email to rubyonrails-deployment@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-deployment?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to