您可以在 redis 中存储的最大值大小是多少? [英] What is the maximum value size you can store in redis?

查看:29
本文介绍了您可以在 redis 中存储的最大值大小是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道你可以在redis中存储的最大值大小是多少?我想使用 redis 作为带有 celery 的消息队列来存储一些需要由另一台服务器上的工作人员处理的小文档,并且我想确保这些文档不会太大.

Does anyone know what the maximum value size you can store in redis? I want to use redis as a message queue with celery to store some small documents that need to be processed by a worker on another server, and I want to make sure the documents aren't going to be too big.

我找到了一个引用 1GB 的页面,但是当我点击页面上的链接以获取他们获得该答案的位置时,该链接不再有效.这是链接:

I found one page with a reference to 1GB, but when I followed the link on the page for where they got that answer the link wasn't valid anymore. Here is the link:

http://news.ycombinator.com/item?id=1182005

推荐答案

所有字符串值限制为 512 MiB.这是您可能最关心的大小限制.

All string values are limited to 512 MiB. This is the size limit you probably care most about.

EDIT:由于 Redis 中的键是字符串,因此最大键大小为 512 MiB.密钥的最大数量为 2^32 - 1 = 4,294,967,295.

EDIT: Because keys in Redis are strings, the maximum key size is 512 MiB. The maximum number of keys is 2^32 - 1 = 4,294,967,295.

另一方面,值的大小可以根据其类型而变化.对于聚合数据类型(即散列、列表、集合和排序集合),每个元素的最大值大小为 512 MiB,尽管数据结构本身最多可以有 2^32- 1 个元素.

Values, on the other hand, can vary in size depending on their type. For aggregate data types (i.e. hash, list, set, and sorted set), the maximum value size is 512 MiB for each element, although the data structure itself can have up to 2^32 - 1 elements.

https://redis.io/topics/data-types

https://redis.io/topics/faq#what-is-the-最大键数单个 redis-instance-can-hold-and-what-the-the-max-number-of-elements-in-a-hash-list-set-sorted-set

http://groups.google.com/group/redis-db/browse_thread/thread/1c7e33fbc98734b3?fwc=2

这篇关于您可以在 redis 中存储的最大值大小是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆