Questions tagged [python-memcached]

Python-memcached is a Python based API (implemented in 100% python) for communicating with the memcached distributed memory object cache daemon.

Python-memcached is a Python based API (implemented in 100% python) for communicating with the memcached distributed memory object cache daemon.

Code is based off the code written by Evan Martin of Danga. Sean Reifschneider of tummy.com has taken over maintenance of the code.

55 questions
2
votes
1 answer

Connect to python-memcached using memcached.sock path

How do I connect to Python-memcached using the path to memcached.sock? (Python 2.7) Memcached comes pre-installed on my host (Webfaction). I have started it and verified that it is running. I also verified that memcached.sock is in my home…
user984003
  • 28,050
  • 64
  • 189
  • 285
2
votes
1 answer

ResourceWarning: python-memcached not closing socket?

I'm running some unit tests with Python 3.6.1 and getting a ResourceWarning ResourceWarning: unclosed
user
  • 4,651
  • 5
  • 32
  • 60
2
votes
0 answers

Old values returned from memcached when using multiple nodes and infinite TTLs

I'm running into an issue where I have a python-memcached client connecting to 3 memcached nodes on ElastiCache. I have some cache values that have an infinite TTL and they get overridden when the data source is updated. Cache is also written to on…
Seán Hayes
  • 4,060
  • 4
  • 33
  • 48
2
votes
2 answers

Django - alert when memcached is down

Is there some ready-made addon that alerts admins about memcached instance being inaccessible from a Django application? I don't mean here monitoring memcached daemon itself, but something that checks if my Django app benefits from caching. My basic…
Tomasz Zieliński
  • 16,136
  • 7
  • 59
  • 83
2
votes
1 answer

memcached listeing on UDP with Django

Question: I am not able to get memcached listening on UDP, to work (get set delete) with Django. I have the memcached listening only on UDP 11211, as I have mentioned in the previous question. What I have tried so far: 1.Setting CACHES to use…
Nabeel Ahmed
  • 18,328
  • 4
  • 58
  • 63
2
votes
1 answer

How to find the keys being evicted from memcache?

Is there any inbuilt way/ or a hack by which I can know which key is being evicted from memcache ? There is one solution of polling for all possible keys inserted into memcache (e.g. get multi), but that is inefficient and certainly not…
DhruvPathak
  • 42,059
  • 16
  • 116
  • 175
2
votes
1 answer

Memcached Compare-And-Set pattern yields wrong result

I'm trying to implement memcached compare-and-set pattern, following the instructions of Guido at: http://neopythonic.blogspot.nl/2011/08/compare-and-set-in-memcache.html However, I don't seem to get it right and I have no idea what's wrong. The…
Martijn
  • 586
  • 5
  • 19
2
votes
1 answer

Implementing get_multi on app engine memcache

I was wondering if somebody could help. I'm using the blobcache module outlined in this post here This works fine but I'm looking to speed retrieval from memcache by using the get_multi() key function but my current code cannot find the keys when…
2
votes
1 answer

Handling a python package name with hyphen in the setup() requires list

I depend on the package python-memcached but its name breaks the python naming conventions and consequently it breaks the setup function in core.py. setup(name='foo', version='1.0', requires = ['python-memcached','psycopg2'] …
z7sg Ѫ
  • 3,153
  • 1
  • 23
  • 35
1
vote
1 answer

App Engine: Memcache design to ensure fast read and high write throughput

I'm currently using App Engine with Python. My application looks like a massive multiplayer game. I would like to improve the time necessary to fetch the latest actions published in a "room". I already use the Memcache API to store and retrieve…
Damien
  • 439
  • 5
  • 16
1
vote
1 answer

Python Memcached: caching objects

I am using Python 2.6.5 and Django 1.3 Let me say i have model like: class Company(models.Model): name = models.CharField(...) type = models.SmallIntegerField(...) .... def check_condition(self, someParam): do someThing... …
Mp0int
  • 18,172
  • 15
  • 83
  • 114
1
vote
1 answer

How can I set a value in memcache to expire at a specific time?

I have a google app engine apps (created using python). I want to add a value to memcache but would like for the value to expire every midnight (PST) How do I do this?
N.P
  • 245
  • 1
  • 12
1
vote
1 answer

Python pylibmc syntax / how can I use mc.set in a loop

I want to set keys in a for loop, and read them back in another script also using a loop. To test memcache is working I made these simple scripts: a.py import pylibmc mc = pylibmc.Client(["127.0.0.1"], binary=True, behaviors={"tcp_nodelay":…
kopke
  • 67
  • 5
1
vote
0 answers

Does memcache need to be started as a daemon separately when used with django?

I am trying to integrate caching with my django project. After some research I am convinced memcache is best for this. So, I require to install memcache through apt-get memcache and then its python bindings again as another apt-get python-memcache.…
1
vote
1 answer

Memcache not present in App-Engine-Patch?

I'm trying to store a date into memcache using the following code: from datetime import date from google.appengine.api.memcache import Client MEMCACHE_DATE_KEY = 'date' client = Client() def last_date(): return…