memcached

How can I store a YAML object in Memcached ? Without a serializations problems.

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...

How to cache query result in django?

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...

Specifics on Memcached's strategy for allocation after max memory has been reached

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...

rails caching with money gem (eu_central_bank)

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',...

Northscale memcached ram usage problem?!

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...

Designing a cache key calculating strategy that's manageable

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...

how to use memcache to speed-up rails/heroku

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...

Why does nginx + memcache corrupt my response body?

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"&gt; <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> ...

C#.NET Memcached: Add item with file dependency?

Delete! Delete! ...

ASP.NET caching w/file dependency: static var vs. AspNet cache vs. memcached

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. ...

Potential problems with using ASP.NET App cache on mirror?

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...

http/proxy caching with memcached

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...

UUID primary keys and Memcached

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...

How can I cache Model objects in Rails?

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...

Failing to run memcached in win 7 xampp

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...

Zend_Session SaveHandler for Memcache

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...

Using memcache as a session store?

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 ...

Expiring memcached using mysql proxy when an update occurs?

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? ...

Need to rebuild memcache module with same build number as php

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...

php_memcache.dll vc6 X64?

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? ...