cache.set(key, Biglist, 3600)
print cache.get(key)
当我的“Biglist”是一个包含大量内容的巨大列表时,它似乎无法存储。
但是当我将其更改为像“abc”这样的小文本时,它会存储。
我必须配置什么才能将我的内存缓存设置为接受无限大小的键/值?
最佳答案
参见What is the maximum data size you can store常见问题解答部分。
What is the maximum data size you can store? (1 megabyte)
The maximum size of a value you can store in memcached is 1 megabyte. If your data is larger, consider clientside compression or splitting the value up into multiple keys.
Why are items limited to 1 megabyte in size?
Ahh, this is a popular question!
Short answer: Because of how the memory allocator's algorithm works.
关于python - memcache 不会存储键/值,因为值太大,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2917484/