Questions tagged [dalli]

High performance memcached client for Ruby.

131 questions
4
votes
2 answers

Rails & Memcached: Optimizing multiple fetches

I am building a Rails backend to an iPhone app. After profiling my application, I have found the following call to be especially expensive in terms of performance: @messages.as_json This call returns about 30 message objects, each including many…
pejmanjohn
  • 1,057
  • 3
  • 12
  • 26
4
votes
0 answers

Rails 3.2 session cookies in cookie_store get deleted after redirect to external urls

We are facing a weird problem where-in few keys/cookies are getting deleted/missing from the session in our rails 3.2 app (staging environment) which has the following cache settings/configuration. The session store is cookie store and has been…
4
votes
1 answer

How to call silence! on dalli cache_store?

I'm trying to develop application with caching in development mode, but development.log spammed is heavily by cache logs. I'm use dalli, and I know, that dalli has silence! method…
denis.peplin
  • 9,585
  • 3
  • 48
  • 55
4
votes
1 answer

get the cache value with Dalli and memcached

I am trying to interact with the cache store in a Rails app using Dalli. I am doing just fragment caching and have set up my dev config like this: #config.action_controller.perform_caching = true config.cache_store = :dalli_store So that it isn't…
timpone
  • 19,235
  • 36
  • 121
  • 211
3
votes
0 answers

Are there any side effects of setting config.cache_store?

Ruby on Rails offers different caching techniques (https://guides.rubyonrails.org/caching_with_rails.html) I just want to save and fetch some data to Memcached. And I don't want to use Memcached for other types of Rails caching like page caching or…
vovan
  • 1,460
  • 12
  • 22
3
votes
1 answer

How to increase memcache slab size above 1MB with dalli and Rails?

I'm using Ruby on Rails and dalli gem to do caching with memcache. The default value (value as in key-value store, aka slab) max size is 1MB. I would like to increase this to 2MB. The documentation of dalli says: value_max_bytes: The maximum size of…
Zack Xu
  • 11,505
  • 9
  • 70
  • 78
3
votes
0 answers

Does Rails make a new connection to memcached server for every cached fragment in the view or does it retrieve everything in one connection?

I'm using dalli gem as a memcached client in my Rails 4 app. Having multiple cached fragments in my view I couldn't but wonder how efficiently does Rails handles retrieval of data from memcached server. Does it make a new connection per each…
Sbbs
  • 1,610
  • 3
  • 22
  • 34
3
votes
2 answers

Rails 4.1 w/ Heroku: DalliError: No server available

I am using: Rails 4.1.0rc2 Heroku gem 'memcachier' gem 'dalli' If I use caching from the console, it works: irb(main):010:0> Rails.cache.write("foo", "bar") => 1297036692682702848 irb(main):011:0> Rails.cache.read("foo") => "bar" But if I set…
miler350
  • 1,411
  • 11
  • 15
3
votes
3 answers

"You are trying to cache a Ruby object which cannot be serialized to memcached."

I've been having some caching problems with a footer that is shared across multiple sites, and I'm wondering what might be up. Here's the error message and the backtrace: Cache read: remote_footer_information ({:expires_in=>300 seconds}) Cache…
isthmuses
  • 1,316
  • 1
  • 17
  • 27
3
votes
2 answers

Fragment caching Jbuilder using Dalli on Heroku

I'm trying to use fragment caching with Jbuilder as one of the view is taking quite a bit to render (only view rendering can take 2500ms+ Note that this does work in other calls, but this one can't seem to work and I can't figure why. Second : this…
3
votes
1 answer

How to specify memcache server to Rack::Session::Memcache?

I'm trying to configure my Rack app to use Memcache for sessions with Rack::Session::Memcache How do I give it the options (such as server, username and password)? Presently I have use Rack::Session::Memcache But I get the error in `initialize':…
Colonel Panic
  • 132,665
  • 89
  • 401
  • 465
3
votes
1 answer

Rails.cache - working but not working

I am using Rails.cache (I have tried both default store and memcached with the dalli gem - but I get the same behaviour) it seems to be working, but isn't (logs show that the query is not made, but actual results show otherwise)... I have a search…
A4J
  • 879
  • 10
  • 24
3
votes
1 answer

Expiring memcache via regex

I'm using memcache in my rails app. I want to say expire all the entries with keys like 'foo-123-*' Where * is any string. Of course, no memcache distribution supports this directly (right?) because it's built to be simple and fast so it doesn't…
John Bachir
  • 22,495
  • 29
  • 154
  • 227
2
votes
0 answers

Rails QueryCache enabled, but not working

We have a Rails 4.2 app running on an Oracle backend, with memcached/Dalli as the cache store. QueryCache does not seem to be working for repeated SQL within the same request. Per the documentation: Query caching is a Rails feature that caches…
Dave Smylie
  • 2,663
  • 3
  • 25
  • 32
2
votes
0 answers

Cache in production

I'm currently testing the caches in my app (Dalli gem). And a weird thing is happening. I'm caching a list related with the current_user. But when I test the app with different account (with different browsers), the caches are mixed. For example: I…
stig Garet
  • 564
  • 2
  • 13
1
2
3
8 9