ZADD 或 HMGET 等 redis 命令可以处理的参数数量是否有限制? [英] Is there any limit on the number of arguments that redis commands such as ZADD or HMGET can handle?

查看:84
本文介绍了ZADD 或 HMGET 等 redis 命令可以处理的参数数量是否有限制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用单个 ZADD 或 HMGET 命令而不是 MULTI/EXEC.

I'd like to use single ZADD or HMGET commands instead of a MULTI/EXEC.

ZADD 可以处理的 (score, member) 元组数量有限制吗?

Is there any limit on the number of (score, member) tuples that ZADD can handle?

HMGET 可以处理的字段数有限制吗?

Is there any limit on the number of fields that HMGET can handle?

推荐答案

理论上的限制相当高,但你应该以一种你无法达到的方式设计你的读取.保持读取大小合理的主要原因是避免阻塞服务器太长时间.

The theoretical limit is pretty high, but you should design your reads in such a way that you don't reach it. The main reason for keeping reads sanely-sized is to avoid blocking the server for too long.

数百或数千应该是一个不错的选择,但最好的办法是使用您的代码和数据自行测试.

Several hundreds or thousands should be a good ballpark, but the best thing would be to test it yourself with your code and data.

硬限制,例如,是:

  • 硬编码的 1GB 用于客户端查询缓冲区(server.h 中的 PROTO_MAX_QUERYBUF_LEN)
  • 参数的最大数量是 int C 数据类型的最大值,通常是有符号的,长度为 4 个字节,表示最多 2,147,483,647.
  • A hardcoded 1GB for client query buffer (PROTO_MAX_QUERYBUF_LEN in server.h)
  • The maximum number of arguments is the maximal value of the int C data type, which is usually signed and 4 bytes long meaning up to 2,147,483,647.

这篇关于ZADD 或 HMGET 等 redis 命令可以处理的参数数量是否有限制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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