Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the maximum value size you can store in redis?

Tags:

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.

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

like image 693
Ken Cochrane Avatar asked Apr 09 '11 16:04

Ken Cochrane


People also ask

Is Redis good for large data?

This is strictly a matter of using the right tool for the job. Both an RDBMS and a NoSQL solution (such as Redis) can be used for storing big data sets - I have intimate acquaintance with Redis databases over 1TB for example.

How big should Redis cache be?

In general, I do advise our customers to try to stay as small as possible and I have often said to try to stay below 100kb, but I have also seen plenty of customers use Redis with larger values (in the MB range). Sometimes those larger values are no big deal.

How long can you store data in Redis?

Redis is a key-value storage, that keeps data in RAM, but it can also write it to hard drive. So it is not problem to keep data for 8 days in redis. Even if you will restart it.


2 Answers

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

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.

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-maximum-number-of-keys-a-single-redis-instance-can-hold-and-what-is-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

like image 55
BMiner Avatar answered Sep 18 '22 08:09

BMiner


Article about Redis Memory Usage can help you to roughly determine how much memory your database would take.

like image 25
yojimbo87 Avatar answered Sep 21 '22 08:09

yojimbo87