Skip to content

Conversation

@rogerhu
Copy link

@rogerhu rogerhu commented Feb 13, 2015

No description provided.

@gusdan
Copy link
Owner

gusdan commented Feb 13, 2015

Good catch. But that is interesting Django doesn't support it in 1.7 as well.
https://github.com/django/django/blob/stable/1.7.x/django/core/cache/backends/memcached.py#L185
did you try that option? Any speed changing in case of using with ElasticCache?

@rogerhu
Copy link
Author

rogerhu commented Feb 15, 2015

I haven't benchmarked myself but there are several perf measurements that people have done in the past..

http://www.creapptives.com/post/46449295377/binary-protocol-benchmarks-for-memcached

@gusdan
Copy link
Owner

gusdan commented Mar 17, 2015

I was wondering why django comunity didn't set that flag. And i performed my own simple bacnhmarks and binary protocol works slowly for long strings (not numbers). I did simple test:

  1. clone you repo
  2. add it to virtual env
  3. run django shell
  4. perform 1000 reads for same key with value = '1'*1000

old version (no binary) takes 1.359 - 1.405s
new version (binary) takes 1.419 - 1.438s

i think it's common usecase for memcache: storing long string (html pages, pickle, jsons). and binary protocol does some otherhead here without pros of minimize transfering.

So i'm going to reject your pull request unless you have some objections.

@robbyt
Copy link

robbyt commented Oct 6, 2015

Just a note about this, I've seen issues with pickled objects silently becoming corrupt when forcing memcached binary mode. It was a deep bug, and suggest you stay away from memcached binary mode w/ django.

@gusdan
Copy link
Owner

gusdan commented Oct 6, 2015

Thank you for update.

On Tue, Oct 6, 2015 at 3:18 AM, Robert Terhaar notifications@github.com
wrote:

Just a note about this, I've seen issues with pickled objects silently
becoming corrupt when forcing memcached binary mode. It was a deep bug, and
suggest you stay away from memcached binary mode w/ django.


Reply to this email directly or view it on GitHub
#6 (comment)
.

@gusdan gusdan closed this Feb 12, 2016
matteiuspi pushed a commit to CashStar/django-elasticache that referenced this pull request Mar 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants