I'm using gem 'dalli' but the same problem happen with gem memcached-client
development.rb
config.cache_store = :dalli_store
My app controller
Rails.cache.write('presidentes', Candidato.by_cargo(:key => "Presidente"))
@presidentes = Rails.cache.read('presidentes')
If I debug the @presidentes var it returns
--- !binary |
BAhvOi...
I am trying to cache query results on my django app. However, it seems that it is caching the whole app. I tried following logi:
def cacheView():
result = cache.get('key')
if result is None:
result = Model.objects.get(id=1)
cache.set('key', 'result')
I am calling this method when user logs in. However, if I try to logout a...
Hi,
According to the Memcached wiki, the following occurs when an attempt to allocate a value to the cache is executed and the memory limit is reached:
When do expired cached items get
deleted from the cache?
memcached uses
a lazy expiration, which means it uses
no extra cpu expiring items. When an
item is requested (a...
I found this add-on for the Money gem which updates from the ECB European Central Bank (updates its rates every 24 hours) but I'm unsure how I should go about caching in my rails app which uses multiple currencies.
http://github.com/RubyMoney/eu_central_bank
eu_bank ||= EuCentralBank.new
eu_bank.update_rates
#Rails.cache.fetch('rates',...
Hi,
We started using memcached on the test server for our social media project and having some problems on ram usage.
We have created a cluster with 1 server node running with just 1 cache bucket sized 128 mb but when we check memcached.exe ram usage from the task manager it' s ram usage rises continously 1mb per second.
Any workaro...
I am having trouble managing cache keys in my project.
Currently we use a define-at-wish strategy and uniqueness of keys are not guaranteed.
Every time some one want to cache a kind of object, a constant is defined in the module in a form like this:
BOOK_NOTE_KEY = "BKNT%d"
An BookNote object's cache key is like BOOK_NOTE_KEY % note...
Heroku supports memcache natively as an addon. my problem is, being a rails newbie still, I have no clue how to use memcache in order to speed-up my most time-consuming request (I know which they are by looking a the newrelic analysis). should we use a gem like 'cache-money' on-top of memcache? does anyone use act_as_cached anymore?
I k...
I'm caching some web pages in memcache. When I read the page directly from the cache, the page is well formed like this ...
!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"-:-- 0
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
...
TL;DR: Which is likely faster: accessing static local variable, accessing variable stored in HttpRuntime.Cache, or accessing variable stored in memcached?
At work, we get about 200,000 page views/day. On our homepage, we display a promotion. This promotion is different for different users, based on their country of origin and language.
...
I've 2 servers mirror with a load balancer. I'd like to know the pros and cons of sticking with app cache versus going with something like memcache? I'm very interested in various solutions and especially the types of errors that I could get or limitations by not synchronizing them.
To start the discussion, I'd hazard that using ASP.NET...
What's the general best practice to deal with something like this..
##Post controller
def show
@post = get_from_memcache
end
##show.html.erb
<div><%= post.body%></div>
<div><%= post.created_at%></div>
<div><%= post.category%></div>
<div><%= Post.favorites_count%></div>
The get_from_memcache return a @post object from a cache that...
With Data being cached so often now and the database is only being accessed when there is new data (and then that data is cached lol) is there even a real performance difference for using Int primary keys vs UUID primary keys.
For example, lets assume im building NetFlix. A new movie gets added to the database, and the movie listing al...
Hi,
Is there a technique that I can use in Rails so that whenever a simple "find" is performed on a Model object, memcached is first searched for the result, only if no result is found will a query by then made to the database?
Ideally, I'd like the solution to be implicit, so that I can just write Model.find(id), it first checks the c...
Hi
I am running win 7 , 64 bit and xampp 1.7.3. But can not install memcached.
Because,can not find the dll http://downloads.php.net/pierre/php_memcache-cvs-20090703-5.3-VC6-x86.zip file in its location. I am sure, I can not install memcached in my system as this file is unavailable.
Can you please share this file?
Or do anyone know...
Recently discovered that Zend_Session's DbTable SaveHandler is implemented in a way that is not very optimized for high performance, so, I've been investigating changing over to using Memcache for session management.
I found a decent pattern/class for changing the Zend_Session SaveHandler in my bootstrap from DbTable to Memcache here a...
I currently have a huge problem. Two days ago my site running on one server was too much, so I purchased two more and had them clustered (rsync and load balanced).
I then start noticing that a user would hit server-1 and then on the next request hit server3 but that their session was still on server1 instead of server3 and they were no ...
Hi guys,
I have mysql Proxy running which takes a query, performs an md5 on it, and caches the result into a memcached DB. the problem occurs when an update happens in the rails app that would invalidate that cache. Any ideas on how to invalidate all of the proper keys in the cache at that time?
...
I'm running OSX 10.6 with php 5.2.13 and memcache 2.2.6. Build numbers as shown below. How do I get them to match though? Here's the error I get when php tries to load the memcache module:
$ php -m
PHP Warning: PHP Startup: memcache: Unable to initialize module
Module compiled with module API=20090626, debug=0, thread-safe...
I am running wamp server with php 5.3.0. My efforts running memcached were a fail :( After googeling I found out that the problem is that I need the correct php_memcache.dll which is a vc6 compiled for windows 7 X64. Does anyone know where can I find the dll?
...