ubuntu - 除了 4GB 限制外,还有什么理由不使用 Redis 32 位(相对于 64 位)?

标签 ubuntu redis

我关心的是一个盒子的内存,我在上面运行了几个 redis 实例。因此,我正在考虑迁移到 Redis 32 位,因为这可以为我节省相当多的内存。

来自 enter link description here

Redis compiled with 32 bit target uses a lot less memory per key, since pointers are small, but such an instance will be limited to 4 GB of maximum memory usage. To compile Redis as 32 bit binary use make 32bit. RDB and AOF files are compatible between 32 bit and 64 bit instances (and between little and big endian of course) so you can switch from 32 to 64 bit, or the contrary, without problems.

正如引文中所说,4GB 是 32 位 redis 实例的最大值,但我确保我不会达到这个要求。我确实使用了多个 redis 实例,每个实例都保持在 4GB 限制以下,但我想这不是问题 (?)

我应该注意任何其他原因,例如可能的性能?

最佳答案

使用多个 32 位 Redis 实例通常效果很好。不过,您需要考虑一些缺点:

  • 大多数人运行 64 位版本,因此 32 位版本的测试和部署要少得多。它降低了可靠性,因为它增加了您遇到未检测到的错误的可能性。

  • 某些操作在 32 位中效率较低。例如 BITOP、BITCOUNT 操作在 64 位 CPU 上运行时应该更高效。

  • 很难设置内存限制。设置 maxmemory 参数很棘手,因为您还必须考虑的不仅仅是数据的大小(还有内部通信缓冲区、主/从复制缓冲区、I/O 缓冲区等...)。如果您过于乐观(即,如果您将 maxmemory 设置得太接近 4 GB),当 Redis 内存饱和时,您将随机崩溃。

您可能还想阅读 Salvatore 对此的评论:

https://groups.google.com/forum/#!topic/redis-db/ThCVJdMrqCE

关于ubuntu - 除了 4GB 限制外,还有什么理由不使用 Redis 32 位(相对于 64 位)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17507780/

相关文章:

linux - 如何在 Linux 上安装后隐藏设备/卷

linux - 在服务器中使用 TCP Keep-Alives 摆脱空闲客户端

ubuntu - 合并视频后时长过长 - ffmpeg

node.js - Node-Redis psubscribe 带有自定义消息

python - 使用请求的响应时间极长

php - 包 'mysql-server' 没有安装候选

python - Flask-SocketIO redis 订阅

redis - 在 Redis 中存储 32 位有符号整数的内存有效方式

Symfony RedisAdapter 根据应用程序环境有不同的内部缓存键

Javascript (NodeJS) 回调范围