memcached

What's the best approach to rate limit an expensive operation with PHP & Memcached?

I came up with this: if($prog->memcache) { $r = $prog->memcache->get("ratelimit:{$_SERVER['REMOTE_ADDR']}"); if(!empty($r)) $prog->errorClose('This IP has been flagged for potential abuse.'); } foo(); // the thing we're rate limiting... if($prog->memcache) $prog->memcache->set("ratelimit:{$_SERVER['REMOTE_ADDR']}", 1, 0, ...

How to troubleshoot memcache set method always fail issue?

I have XAMPP 1.7.3 installed on Windows 7. The PHP version is 5.3.1. I have successfully installed memcache for win32 from http://www.splinedancer.com/memcached-win32. I got PHP extension php_memcache.dll from http://downloads.php.net/pierre. Restarting apache and checking phpinfo() shows memcache is OK. When I test it with below PHP...

Which Python module to use for Memcached?

Hello folks, I am implementing caching for my Python application and I want to use memcached. Which module do you suggest me to use? There are so many that I don't know which one to choose. Thanks, Boda Cydo. ...

How to make SQLAlchemy use Memcached?

Has anyone joined SQLAlchemy and Memcached together so that results returned by SQLAlchemy where cached in Memcached? At the moment I have no idea how to implement it myself, I am completely lost and looking for help. Thanks, Boda Cydo. ...

Where download php_memcache.dll ?

Hello, I'm trying to download from http://pecl4win.php.net/ext.php/php_memcache.dll but "The pecl4win build box is temporarily out of service. We're preparing a new build system." Thank you. PHP version is 5.3 ...

What type of websites does memcached speed up

I have read this article about 400% boost of your website. This is done by a combination of nginx and memcached. The how-to part of this website is quite good, but i mis the part where it says to what types of websites this applies. I know nginx is a http engine, I need no explanation for that. I thought memcached had something to do ...

How long will memcached data stay in the memory

If I load the data of user_x into memory with memcache, how long will this data stay available? If a user only logs in once a year this data is unnecessary in the memory. Or am i looking at this the wrong way? ...

Broken pipe error in rails with memcached

I keep running into this error MemCacheError (Broken pipe): Broken pipe on my Rails app and I can't figure out why. When I access memcached via Rails.cache in my controller, the first 1 or 2 read/writes always seems to throw the broken pipe error. But when I access memcached by creating a new object, ActiveSupport::Cache::MemCacheStore...

Returning content directly from memcache - Django / HTTP Server

Hi folks, I've built a web application with Django, I'm using Memcached in order to cache data. A few views cache the whole HttpResponse objects, therefore there might be a better alternative for returning the Memcached data other than going through Django. What could be faster alternatives for returning Memcached data on HTTP Request...

Using .NET, how and why to use the memcached?

I hear much talk about memcached, but when briefly studied on it, I couldn't understand what advantages I can take instead of using the good old Dictionary<string, object> to cache my data in my applications. Can someone explain it to me? ...

Pylibmc: ImportError: dynamic module does not define init function (init_pylibmc)

>>> import pylibmc Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/pylibmc.py", line 55, in <module> import _pylibmc ImportError: dynamic module does not define init function (init_pylibmc) Trying to import pylibmc, which...

Are memcached entries saved by the Danga client compatible with the Spy client?

After saving a String value into memcached using the Danga client, I attempted to get the entry using the Spy client. The two String values are not the same. The Danga client retrieves a string with an additional empty char prepended to the string, therefore violating the equality condition. Danga t,e,s,t,s,t,r,i,n,g Sp...

App session cookie not being created in Rails, sporadically

Hi everyone, This is an issue sporadically for very few users, however we haven't been able to replicate it. However I have now got a Chrome instance (Mac) which is reproducing the error (for some unknown reason), and I hope to not restart it until I have this nailed! Rails application, using memcached for session store. While the bug ...

How can I get the expire time for the particular item in memcached

In runtime, I want to retrieve the expire time info about some items in memcached. I didn't find any related interface on memcached. Can I do this? something like: mc.get_expire_time('key') Thank you ...

Serialization for memcached

I have this huge domain object(say parent) which contains other domain objects. It takes a lot of time to "create" this parent object by querying a DB (OK we are optimizing the DB). So we decided to cache it using memcached (with northscale to be specific) So I have gone through my code and marked all the classes (I think) as [Serializa...

Usage of Memcache to improve performance of MySQL Query

Is is always advantages to use memcache to improve performance of MySQL query ? Are there any downsides of extensive use of Memcache ? ...

Memcache textual protocol cheatsheet ?

Memcached interface is implemented using a textual protocol. Sometimes it's very useful to be to fetch data stored on your remote server simply by invoking netcat with some shell kung fu, for example: To download the XML result of your nightly data crunching job you might run something like: echo "get 95ec6c7693ec53771c8a3fb1061562b8" ...

Memcache in python

I want to memcache an xmldata using python,also needs to update the cache with the refreshed xmldata retreived from webserver,could any one help me with sample code. ...

How i can design a cache system using PDO and memcached?

Hi, I'm using PDO for connect to the database in a system where I want implement memcached. I don't know what keys use for caching the results because I can't get the string of the final query with PDO (because the prepared statements). Any good idea for resolve this? Thanks in advance. ...

Google App Engine - Memcache - Java version of Python's client.add?

The python interface to the memcache has an add method: add(key, value, time=0, min_compress_len=0, namespace=None) Sets a key's value, if and only if the item is not already in memcache. ... The return value is True if added, False on error. So with this you can add an item if it doesn't exist, and see if it previously e...