memcached

Is it advisable to use serialize() to persist an object across multiple requests?

In a project I'm working on, I have an object that is a sort of Collection with a database back end. The exact results this Collection returns are dependent upon its configuration, which is itself dependent on a number of user inputs. I would like to have an element on the page that contains the records in the Collection and can be upd...

How can I know about Memcache status in my Rails app?

I created a Rails app hosted on Heroku with a Memcache plugin limited to 5 MB. How can I know about Memcache status, free cache left, biggest cache chunk etc.? Can I access this within the app (an admin page for example)? Or using the Ruby console? Also, is there any graphical plugin for this? ...

How to increase key size in Memcached

Problem I'm getting the error: key too long "rack:session:BAh7...." /usr/local/ruby-enterprise/lib/ruby/gems/1.8/gems/memcache-client-1.8.5/lib/memcache.rb:703:in `get_server_for_key' /usr/local/ruby-enterprise/lib/ruby/gems/1.8/gems/memcache-client-1.8.5/lib/memcache.rb:920:in `request_setup' /usr/local/ruby-enterprise/lib/ruby/gems/1...

cache lite / memcache

i have a function that build query depending on which page user is at, by parameter array value, once it build the query, then it returns, so we can execute it and get the desire result we want. well we need to put cache on it, so we can speed up things and im really confuse on how to make cache id, sence the query is kind of dynamic ...

Memcache: Why can't I get a query result

It works when I save a simple string. When I save a query result it returns true but I can't read it from the cache anymore. Here is my code: $cachekey=md5('mqv_'.$connections[$ccn][5].mysql_result($r,$u,'Tablechoice').$e1.$e2.$e3.$e4.$_SESSION["auszug1"].$_SESSION["per_page1"]); if($rv = $memcache->get($cachekey)){ $cachemsg="da...

Session overlap, 2 users logged in somehow the system sees them as one.

Hello guys, Rarely our system mixes logged in users and I can't figure out why. Here is the scenario: 2 users log in (A and B) normally each one has his own ID, at some point one of the users (A) takes the ID of the other user (B) and contribute to the website as if he is B. Technically that's what is going on: 1- 2 users logs in: ea...

Getting total number of records from mysql table - too slow

I have a file that goes thru a large data set and splits out the rows in a paginated manner. The dataset contains about 210k rows, which isn't even that much, it will grow to 3Mil+ in a few weeks, but its already slow. I have a first query that gets the total number of items in the DB for a particular WHERE clause combination, the most ...

Duplicate key-value pairs returned by memcached

hi - We are using a cluster of memcached servers for caching purpose, in a Django(Python) production, having tried both cmemcache and python-memcache as the API. The problem is under high concurrency, we started to have duplicate key-value pairs, that is to say we are having multi values for a single key. Is there anyone having had the s...

How can I communicate between PHP and a Java program?

I'm working on a web application that frequently requires a calculation intense query to be run, the results of which are stored in a separate table. Using MySQL, this query takes about 500ms (as optimized as possible, believe me). To eliminate this bottleneck, I've created a Java program that loads the relevant DB data into memory and...

How to clear Memcached (1.4.x) stats from java

Running flush() on the java-clients we've tried (SpyMemcacheD and Danga) does not reset the statistics on the memcached server. Does anyone know a good way to do this? I could implement a telnet client that sends stats reset But that seems excessive ...

Memcache inhibits the website

Hi, I added memchached to my website. And site started running very slow. If I cancel memchached ,application backs to work quickly. Why is this happening?And how to avoid it? Thanks, kukuwka ...

do I need memcache-client

I am on rails 2.3.5 and ruby on 1.8.7. I have a single application using a local memcached (latest version from apt-get memcached) instance. It seems memcached is working as expected but going through the docs and other comments, 1 - It seems memcached-client is recommeneded for speeding things up. I can't tell for sure with my version...

caching with memcached

I have a section in my main layout like the following. I am starting to use memcached and wondering if this portion can be cached somehow becasue the current_user call makes a hit to the database for every page load and by nature of the plugin (authlogic) thats behind it, it actually updates the user record (i.e. the perishable token). ...

Rails memcached: Where to begin?

I read a few tutorials on getting memcached set up with Rails (2.3.5), and I'm a bit lost. Here's what I need to cache: I have user-specific settings that are stored in the db. The settings are queried in the ApplicationController meaning that a query is running per-request. I understand that Rails has built-in support for SQL cachei...

Memcached for Social Network Application

I asked this question over at ASP.NET... http://forums.asp.net/t/1584731.aspx ...but wanted to ask it here as well. I’m sure this problem has been solved before so I figured why reinvent the wheel… Short story, I’m building a web application with social features using memcached as a caching layer for the database. To simplify the prob...

What is the reason for 'Policy prevented put operation' in google app engine?

The following exception is logged when data is put into the cache. com.google.appengine.api.memcache.stdimpl.GCacheException: Policy prevented put operation The data which is stored in the cache: Map<String, List<Dependents>> dependentMap = new HashMap<String,List<Dependents>>(); In the map key will be an ID and for each ID there w...

How do I store a fetched entity in memcache for App Engine?

Because each new request in App Engine creates a new Handler, the entity I'd like to alter and put (using POST) has to be retrieved again. This seems wasteful, since I've populated the form with the information from GET a moment earlier. How do I store a key, fetched entity, or key/entity pair in memcache for App Engine? ...

Memcached is crashing a lot. Why?

I am using memcached and it seems to be crashing a lot lately. Sometimes a deploy can cause it to crash on ActionController::Base.cache_store.clear and sometimes it happens out of nowhere. How can I get to the root cause of this? Does it have it's own log somewhere? How can I make it more robust? Our site relies heavily on it and i...

Storing MySQL writes in Memory

This is a bit of an oddball question. I'm aware of using memcached to cache "read heavy" data in memory, but is it possible todo the same for writes? For example: You have a chunk of data in memory (in memcached) and if you have to make any changes to that data, you make it in memory itself. At the end of a certain time period (hour, or...

Adding decision logic to Apache's mod_proxy_balancer with Memcache

Hi, What I am trying to achieve is to have Apache's mod_proxy_balancer check if a request was already made using a Memcache store. Basically: Streaming media request comes in. Check if streaming media has already been served with Memcache. If so, can that streaming media server handle another request. If so send request to said streami...