0

Can I write around 10MB of value (JSON Data as a string) against a key (string - xyz) in Azure redis cache

Size- Standard 1 GB Version - 4.0.14

I am able to insert 3MB of value , but while inserting 7MB of value it gives network error.

I am using StackExchange.Redis.2.1.58 client from .net console app.

Sagar
  • 645
  • 2
  • 9
  • 31
  • What is the network error? – Schwern Nov 06 '20 at 04:10
  • **StackExchange.Redis.RedisConnectionException: 'An unknown error occurred when writing the message'** StackExchange.Redis.RedisConnectionException HResult=0x80131500 Message=An unknown error occurred when writing the message Source=StackExchange.Redis StackTrace: at StackExchange.Redis.ConnectionMultiplexer.ExecuteSyncImpl[T](Message message, ResultProcessor`1 processor, ServerEndPoint server) in /_/src/StackExchange.Redis/ConnectionMultiplexer.cs:line 2805 at StackExchange.Redis.RedisBase.ExecuteSync[T](Message message, ResultProcessor`1 processor, ServerEndPoint serve – Sagar Nov 06 '20 at 04:30

2 Answers2

0

From Redis website:

Strings are the most basic kind of Redis value. Redis Strings are binary safe, this means that a Redis string can contain any kind of data, for instance a JPEG image or a serialized Ruby object.

A String value can be at max 512 Megabytes in length.

DaShaun
  • 3,722
  • 2
  • 27
  • 29
0

You could put 'syncTimeout' parameter in ConnectionString like this "RedisConfiguration": {"ConnectionString": "mycache.redis.cache.windows.net:6380,password=$$$$$$$$$$$$$$$$$$=,ssl=True,abortConnect=False,syncTimeout=150000"," DatabaseNumber ": 1}. This parameter sets the "Time (ms) to allow synchronous operations", as can be seen at https://stackexchange.github.io/StackExchange.Redis/Configuration.html. I had this problem when I stored items that took more than 5 seconds to be processed, since this is the default value. You can try increasing this value using the parameter inserted in the connection string. I hope I can help you with this, regards.