Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Redis - Is there a limit on SET for datatype STRING?

I am using the command line interface on my mac terminal to set a long string.

SET mystring "[long string]"

Now the issue is this. When i copy from my text editor the long string into the cli, the pasted string gets cut off at 4,066 characters.

I thought it could be the copy/paste buffer size of the mac terminal but i can paste stings alot longer outside of redis-cli.

And its no where near the 512 Megabytes limit for a STRING in redis.

This is similar to another questions but not the same steps. Redis cuts of the string when getting a serialized object back. Cant find any limits

thanks!

like image 791
stax Avatar asked Dec 03 '13 22:12

stax


People also ask

What is the maximum storage capacity for a string type value in Redis?

Is there a upper limit to the suggest size of the value stored for a particular key in redis? 512MB is the current limit for Strings.

How many data types support Redis?

Redis supports 5 types of data types.

Can Redis only store strings?

In Redis, we have the advantage of storing both strings and collections of strings as values. A string value cannot exceed 512 MB of text or binary data. However, it can store any type of data, like text, integers, floats, videos, images, and audio files.

What can be stored in a Redis string?

Creating and Managing Strings However, strings in Redis are binary-safe, meaning a Redis string can hold any kind of data, from alphanumeric characters to JPEG images. The only limit is that strings must be 512 MB long or less.


1 Answers

redis-cli uses linenoise custom library for terminal input, which happens to have hard-coded input buffer size of 4096 bytes: linenoise.c:101. You may want to write down your Redis command into a file and execute it with redis-cli --eval.

like image 187
rkhayrov Avatar answered Nov 03 '22 02:11

rkhayrov