This is where I'm currently standing: I've been trying endlessly to get memcached working, but I'm getting bad errors everytime. On my local machine, running just mongrels, it's working perfectly, so the only difference is that we're running Passenger and REE on production.
The memcached logs show no errors, nor does rails, but apache is failing and giving me the following error: [Sun May 03 23:14:57 2009] [error] [client 76.239.166.13] Premature end of script headers: amazon, referer: [WEBSITEOMITTEDFORTHISCOMMENT] [ pid=5227 file=ext/apache2/Hooks.cpp:546 time=2009-05-03 23:14:57.657 ]: Backend process 5255 did not return a valid HTTP response. It returned no data. /opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/memcache- client-1.7.2/lib/memcache.rb:335: [BUG] non-initialized struct Stats: REE, Rails 2.3.2, Passenger 2.2, memcached, memcache-client gem, SystemTimer gem production.rb: config.cache_classes = true # Enable threaded mode # config.threadsafe! # Use a different logger for distributed setups # config.logger = SyslogLogger.new # Full error reports are disabled and caching is turned on config.action_controller.consider_all_requests_local = false config.action_controller.perform_caching = true # cache store config.cache_store = :mem_cache_store require 'memcache' CACHE = MemCache.new '127.0.0.1:11211′ begin PhusionPassenger.on_event(:starting_worker_process) do |forked| if forked # We're in smart spawning mode, so... # Close duplicated memcached connections - they will open themselves CACHE.reset end end # In case you're not running under Passenger (i.e. devmode with mongrel) rescue NameError => error end # Enable serving of images, stylesheets, and javascripts from an asset server # config.action_controller.asset_host = "http://assets.example.com" # Disable delivery errors, bad email addresses will be ignored # config.action_mailer.raise_delivery_errors = false I'm also using Rails.cache.fetch everywhere, and that's been working fine. As soon as I switch to CACHE which I set, I get bad command errors in memcached on my local machine using mongrels. Doing that in production yields no different results. Thanks! On May 4, 10:03 pm, kineticac <[email protected]> wrote: > I looked at the logs, and it looks like memcached is getting all the > hits fine, but I think it's actually Passenger not feeding it > correctly to rails? > > I turned on conservative spawning to see if that helps, but still same > error > > On May 4, 8:31 pm, kineticac <[email protected]> wrote: > > > Here's the error when not doing passenger stuff: > > Backend process 5255 did not return a valid HTTP response. It returned > > no data. > > /opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/memcache- > > client-1.7.2/lib/memcache.rb:335: [BUG] non-initialized struct > > > On May 4, 8:13 pm, kineticac <[email protected]> wrote: > > > > I've read this, but I'm not sure how to reset connections to > > > memcached. I've tried doing: Rails.cache.reset, but that's not a > > > defined method. > > > > This line: > > > CACHE = MemCache.new 'localhost:11211' > > > > Also does not work when I put it in my production.rb. I get an error > > > that says I have an uninitialized constant Rails::Initializer:MemCache > > > > I've installed the memcache-client gem. All documentation says rails > > > automatically tries to require it, in fact it's already built into > > > rails already. > > > > So I try to just use the Rails.cache object, which has nothing the gem > > > docs says it has. > > > > How do I reset Rails.cache? > > > > On May 4, 10:52 am, Rama <[email protected]> wrote: > > > > > This should help you understand the problem: > > > > >http://www.modrails.com/documentation/Users%20guide.html#_example_1_m... > > > > > Has a little tip on what you could do when you fork... > > > > > Rama > > > > > On May 4, 12:23 am, kineticac <[email protected]> wrote: > > > > > > Is this the right place to post help for memcached and rails apps? > > > > > > My rails app is running great in development with memcached, but when > > > > > I tossed it up on production, with the exact same setup, it stopped > > > > > working with very little error messaging. > > > > > > I'm using Phusion Passenger which runs Apache, Ruby Enterprise, > > > > > memcach-client gem, and of course memcached. > > > > > > I keep hearing about a lot of issues (inconsistent) with passenger and > > > > > memcached, and then with REE and memcached, but can't seem to find a > > > > > definitive answer to any of these. I feel like all production servers > > > > > use REE, passenger, and memcached together more often then not. I'm > > > > > not sure how to address these problems and what special items I need > > > > > to setup. > > > > > > If anyone has any info on what differences I need to take on a > > > > > production server that might differ from my development? > > > > > > Thanks
