Cache: [GET /] skip? dalli gem, memcached, rails 3.1, nginx, unicorn production environment

I am trying to get the first production application. No matter what I do, I get a basic 404 page, and this is in my unicorn log, no matter what I do:

cache: [GET /] miss cache: [GET /something] miss 

production.rb

  config.cache_store = :dalli_store, 'localhost:11211' #config.cache_store = :memory_store 

Everything worked perfectly in development (without caching, which was missed in the development of AFAIK) and doublechecking. I have all the syntax correctly, like on a rails guide to set caching of controller actions, only nothing but error messages.

Can someone give any guidance as to why or what I am missing? Works in development, but not on the server that I created. I am more than happy to provide more information to get this sorted out. This is a lot of moving parts for coordination, I would appreciate any input.

edit:

I went for some feedback with Memcached, running it with all the previous options and -B binary (plus -vv), it seems that the program does not even connect to Memcached; memcached does not register anything while the program is running.

edit:

I returned to the local installation in design and production; caching works, memcached responds, the only difference is that I don't run nginx / unicorn just webrick, but if this helps to identify the problem, I should know, maybe this has some meaning and direction for the pursuit.

edit:

Return to the server and then launch in development mode with cache settings enabled:

config.cache_classes = true config.action_controller.perform_caching = true config.cache_store =: dalli_store, '127.0.0.1:11211'

Obviously, rails do not connect to memcached. There is nothing in the log about trying to connect to the cache, and memcache running with -vv does not show activity. If I go to the console, I can manually connect in accordance with the instructions of the dalli basic cli, hmmm. Simple execution of various options with memcached instances does not give an answer.

However, I can request memcached statistics on the index page that comes to every request where I configured it ... although it doesn’t show anything in rails to log in about access to memcached.

edit:

struggled through this, and found that the error was related .... when I went through some pipeline asset issues for misreferenced styles, it seems that everything is going smoothly. Learning experience, at least.

+4
source share
2 answers

Dalli is only a binary protocol, so make sure your memcached server talks about the binary protocol. For example, memcached should be started with:

 memcached [...] -B auto [...] 

In addition, the memcached version must be> = 1.4.0 .

UPDATE

These messages are generated by Rack :: Cache , which are set to verbose logging and do not mean that something is necessarily wrong. They are more like that you can do things like

 expires_in 20.minutes expires_in 3.hours, :public => true expires_in 3.hours, 'max-stale' => 5.hours, :public => true 

(in Rails controllers) and then page caching can work automatically (and these messages will be deleted any time the page is cached).

+1
source

You can use Rails.cache.read('[key]') through the heroku console to find out if it works or not.

0
source

All Articles