memcache won't store key/value because the value is too big

≯℡__Kan透↙ 提交于 2019-12-14 02:00:19

问题


cache.set(key, Biglist, 3600)
print cache.get(key)

When my "Biglist" is a huge list of lots of content, it doesn't seem to store.

But when I change it to small text like "abc", it stores.

What do I have to configure so that I can set my memcache to accept unlimited size of key/value?


回答1:


See What is the maximum data size you can store section in the FAQ.

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.



来源:https://stackoverflow.com/questions/2917484/memcache-wont-store-key-value-because-the-value-is-too-big

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!