gpt4 book ai didi

python - 内存缓存不会存储键/值,因为值太大

转载 作者:行者123 更新时间:2023-11-28 22:06:54 25 4
gpt4 key购买 nike

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 - 内存缓存不会存储键/值,因为值太大,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2917484/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com