Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/azure/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Caching 在StackExchange.Redis中设置缓存时发生TimeoutException_Caching_Azure_Redis_Timeoutexception_Stackexchange.redis - Fatal编程技术网

Caching 在StackExchange.Redis中设置缓存时发生TimeoutException

Caching 在StackExchange.Redis中设置缓存时发生TimeoutException,caching,azure,redis,timeoutexception,stackexchange.redis,Caching,Azure,Redis,Timeoutexception,Stackexchange.redis,我正在尝试使用VisualStudio中的StackExchange.Redis客户端在Azure Redis缓存中设置键值对。这是我的代码: ConnectionMultiplexer connection=ConnectionMultiplexer.Connect("connection_name,ssl=true,password=some_password"); IDatabase cache = connection.GetDatabase(); for (int i =

我正在尝试使用VisualStudio中的StackExchange.Redis客户端在Azure Redis缓存中设置键值对。这是我的代码:

ConnectionMultiplexer connection=ConnectionMultiplexer.Connect("connection_name,ssl=true,password=some_password");

IDatabase cache = connection.GetDatabase();      
for (int i = 0; i < 500; i++)
{
cache.StringSet("key" + i, "value" + i);
}
ConnectionMultiplexer connection=ConnectionMultiplexer.Connect(“connection\u name,ssl=true,password=some\u password”);
IDatabase cache=connection.GetDatabase();
对于(int i=0;i<500;i++)
{
StringSet(“键”+i,“值”+i);
}
然而,当代码设置一些随机键值对时,我得到了TimeoutException。问题可能是什么?我应该如何解决?谢谢。

  • 可能是服务器暂停(“slowlog get”和Redis服务器日志是首先要查看的内容)
  • 可能是网络基础设施的停顿
  • 可能是图书馆的小故障
  • 可能只是在数据上被阻止(可能尝试稍高一点的超时)

错误消息应该包括一组数字。如果你能告诉我这些数字,我也许能说得更多。

这是Azure Redis,托管服务。在过去,报告的最小尺寸(例如基本250MB)肯定存在类似的问题。如果您使用此尺寸,请尝试更大的尺寸,例如标准2.5GB