Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any reason not to use Redis 32bit (as opposed to 64bit) except for the 4GB limit?

Tags:

redis

ubuntu

I'm concerned with mem for a box on which among other things I run a couple of redis instances. Thefore I'm thinking about moving to Redis 32bit since this should save me quite a bit of ram.

from 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.

As said in the quote, 4GB is the max for a redis instance on 32 bit but I'm making sure I don't hit this. I DO use multiple redis instances that each stay below the 4GB limit, but I guess this is not a problem (?)

Any other reason, such as performance possibly, I should look out for?

like image 715
Geert-Jan Avatar asked Jul 06 '13 22:07

Geert-Jan


People also ask

How much RAM do I need for Redis?

The minimum requirements of a Redis infrastructure for non-productive OutSystems environments are the following: Single Redis server with 2 CPUs (>2.6 Ghz) and 4GB of RAM (can be Virtual Machine)

Are 32 bit programs limited to 4GB?

Anyway, the "only" limitation a 32-bit program has is that it cannot map more than 4GB at once. But you can easily extend it through shared memory.

Why is Redis using so much memory?

This is because pointers take 8 bytes in 64-bit systems. But of course the advantage is that you can have a lot of memory in 64-bit systems, so in order to run large Redis servers a 64-bit system is more or less required.

Does Redis use lots of memory?

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.


1 Answers

Using multiple 32 bits Redis instances generally works well. There are a few drawbacks you need to consider though:

  • most people run the 64 bits version, so the 32 bits version is much less tested and deployed. It makes it less reliable, since it increases the probably you hit an undetected bug.

  • some operations are less efficient in 32 bits. For instance the BITOP, BITCOUNT operations should be more efficient when they run on a 64 bits CPU.

  • it is difficult to set a memory limit. Setting the maxmemory parameter is tricky because you also have to consider more than the size of your data (but also internal communication buffers , master/slave replication buffers, I/O buffers, etc ...). If you are too optimistic (i.e. if you have set maxmemory too close to 4 GB), you will have random crash when Redis memory is saturated.

You also may want to read what Salvatore said about it:

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

like image 51
Didier Spezia Avatar answered Sep 29 '22 18:09

Didier Spezia