Neel Choudhury
Neel Choudhury

Reputation: 573

Entering large string (1 MB) as keyfor a key gives exception

According to the specification of redis size of the string can be 512 MB (link)

I tried to insert a large string of approximately 1 MB in size using the following command

cat command.txt | redis-cli --pipe

where the content of command.txt is SET k <large string>

I am getting following error ERR Protocol error: too big inline request

Little bit digging around the net shows that the size of a reuqest is limited by REDIS_INLINE_MAX_SIZE whose value is fixed as (1024*64) or 64KB.

Is there any way to change that or is there a better way to send large string into redis

Upvotes: 2

Views: 1993

Answers (1)

Itamar Haber
Itamar Haber

Reputation: 50052

x-post from /r/redis

Use one of the many clients - that's the simplest approach.

Alternatively, you can prepare the payload in RESP and then you won't need even the the cli - for example: https://gist.github.com/itamarhaber/c33ab7a067483050c47d

Upvotes: 2

Related Questions