Questions tagged [dalli]

High performance memcached client for Ruby.

131 questions
2
votes
0 answers

Rails + Unicorn Issue - DalliError: Unable to unmarshal value: undefined class/module

I have a Rails 3.1 app, which utilizes the Shopify API gem to fetch some external data via ActiveResource. We store these ActiveRecord model objects in Memcached via Dalli, and then read in again when needed. We can successfully read in this data…
Bjorn Forsberg
  • 470
  • 1
  • 6
  • 19
2
votes
1 answer

Why are calls to a "rack" route showing up in my Rails cache log?

My Rails 3.2 app contains a health check route for an upstream load balancer: # routes.rb get 'health' => lambda { |env| [200, {"Content-Type" => 'application/json'}, [ 'Alive.' ] ] } I am also using Dalli and memcached to cache various objects in…
jordanpg
  • 6,386
  • 4
  • 46
  • 70
2
votes
1 answer

Heroku Memcache issue - Dalli::NetworkError: localhost:11211 is down

I have recently upgraded Rails to 3.2.2 and now I seem to be running into Memcache related issues... can anyone help? My production config: config.serve_static_assets = true config.static_cache_control = "public,…
2
votes
1 answer

how to query memcached for specific fragments and how to clear all of memcache

Just getting starting using memcached with a rails app I have the following fragment: <% cache("home_main", :expires_in => 1.minute) do %> and would like to query the value via the Rails console but: => nil 1.9.1 :012 >…
timpone
  • 19,235
  • 36
  • 121
  • 211
2
votes
0 answers

Rails cache messages

I am using Rails.cache.read/write/fetch methods. When I perform these operations I see the following messages (see below) in my log. I wanted to know what they mean, I understand read/write message, but how about Fetch Hit and Generate. Use…
kapso
  • 11,703
  • 16
  • 58
  • 76
2
votes
1 answer

Exclude images from caching with Memcached / Dalli

I've recently implemented caching with memcached heroku add-on using Dalli gem for my Rails application. What I find though is when deployed to Heroku, it also caches all my static assets including images, which quickly blows up my memcached size. A…
membLoper
  • 1,972
  • 19
  • 21
1
vote
2 answers

How to automatically delete a memcache after some time in Dalli

I'm not sure if this can be done at all. I'm trying to set Dalli to delete a memcache after 3 seconds (just to experiment) dalli = Dalli::Client.new dalli.add("test1","value", 3) dalli.get("test1").should eql "value" sleep(10) …
toy
  • 11,711
  • 24
  • 93
  • 176
1
vote
1 answer

Dalli GET does not find records in legacy memcached instance

Preamble: I have a legacy memcached instance running which interacts with Perl Modules to manage keys. I can telnet to the server to manually get and set keys. Problem: I'm trying to connect to this instance using Ruby/Rails. Using the Dalli Gem,…
ThorTL67
  • 528
  • 4
  • 13
1
vote
1 answer

Cannot start memcached

I cannot get memcached to run on my server. This is what I tried so far: % sudo systemctl start memcached # no output % sudo systemctl status memcached.service ● memcached.service - memcached daemon Loaded: loaded…
de.
  • 7,068
  • 3
  • 40
  • 69
1
vote
0 answers

Rails.cache.delete does not work (Dalli store)

Hi I ma new to rails and I try to delete a key from the rails cache like this: Rails.cache.fetch('datasources_field_options') I see a big array in the rails console Then I try to delete it like this: …
Hairi
  • 3,318
  • 2
  • 29
  • 68
1
vote
1 answer

How to detect if a user has another user's session in Rails?

We are experiencing a bizarre, very rarely occurring bug where a user will be logged into another user's account. We are on Rails 4.2. We use authlogic for authentication and dalli as our memcached client. Use memcache as the session store. I…
Zachary Wright
  • 23,480
  • 10
  • 42
  • 56
1
vote
1 answer

How to refresh clustered Redis Elasticache nodes in a Rails app?

I'm soon to implement Elasticache in Rails app using the Elasticache-Dalli gem. Their documentation details how to refresh the nodes, but it doesn't detail how often to refresh them or by what means. AWS documentation says the following: If a…
Peter P.
  • 3,221
  • 2
  • 25
  • 31
1
vote
0 answers

CanCanCan, How to store current_ability in memcached

After upgrading CanCan 1.4 to CanCanCan 2.0, I can not anymore cache current_ability into memcached with Dalli. I got error below : Cache write: profils/11-20170821121414000000::ability Marshalling error for key…
孙悟空
  • 1,215
  • 1
  • 11
  • 26
1
vote
1 answer

Dalli caching doesn't work rspec

Am trying to use Rails.cache.read and Rails.cache.write helpers during my rspec scenario but it doesn't work. Am using dalli_store for cache store. I wrote ActionController::Base.perform_caching = true in any random test scenario and then run…
mr.freeman13
  • 93
  • 1
  • 4
1
vote
1 answer

Memcache not able to fetch value

I set 10000 keys in memcache for i in 1..10000 Rails.cache.write("short_key#{i}", i) end After ~500s (not benchmarked but happens around 10m), when I do _random = rand(10000) Rails.cache.read("short_key#{_random}") returns nil. This is fine.…
geek_guy
  • 607
  • 1
  • 5
  • 17
1 2 3
8 9