Redis偶尔挂起(Redis occasional hangs)
我们在服务器上运行的Windows节点有一个独立的Redis(2.8.2104)。
另外两台服务器正在与此实例通信。
我们将它与SignalR一起使用并用于缓存。 转储大小约为700MB
我们有时会挂机1-3分钟。 在此之后它会自行恢复。
错误似乎只发生在我们页面上有一些流量时。
在这段时间里,我们得到了您可以在下面看到的异常
StackExchange.Redis.RedisConnectionException:在System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务任务)上的EVAL上的SocketFailure,位于Microsoft.Owin.Cors.CorsMiddleware.d__0.MoveNext的System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务任务)。 )---来自抛出异常的先前位置的堆栈跟踪结束---在Microsoft.Owin的System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务任务)的System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务任务)处.Mapping.MapMiddleware.d__0.MoveNext()---抛出异常的前一个位置的堆栈跟踪结束---在System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务任务)at
当我搜索Redis日志时,我可以偶尔找到这些错误:
[33144] 18 Feb 18:18:44.843#
=== REDIS BUG REPORT START:从此开始剪切和粘贴=== [33144] 18 Feb 18:18:44.844#Out of Memory分配308457个字节。 [33144] 18 Feb 18:18:44.844#--- ABORT [33144] 18 Feb 18:18:44.844#--- STACK TRACE redis-server.exe!LogStackTrace(c:\ release \ redis \ src \ win32_interop \ win32_stacktrace.cpp:95)(0x00000016,0x042E0028,0x00000000,0x00000001)redis-server.exe!AbortHandler(c:\ release \ redis \ src \ win32_interop \ win32_stacktrace.cpp:206)(0x00000001,0x89EE7767,0x40150880,0xBB7A5ED7)redis -server.exe!raise(f:\ dd \ vctools \ crt \ crtw32 \ misc \ winsig.c:587)(0x00000001,0x00000000,0x0004B4E9,0x042E0028)redis-server.exe!abort(f:\ dd \ vctools \ crt \ crtw32 \ misc \ abort.c:82)(0x00000001,0x4013F888,0x0004B4E9,0x00008000)redis-server.exe!redisOutOfMemoryHandler(c:\ release \ redis \ src \ redis.c:3397)(0x0004B4E9,0x4007DA07,0x042E0028 ,0x4007A27B)redis-server.exe!zmalloc(c:\ release \ redis \ src \ zmalloc.c:147)(0xBDF01150,0x4007EB2C,0xBDF01150,0x446D6B10)redis-server.exe!sdsnewlen(c:\ release \ redis \ src \ sds.c:59)(0xBDF01150,0xBDF01150,0x3E74FD95,0x00000003)redis-server.exe!_addReplyStringToList(c:\ release \ redis \ src \ networkin gc:271)(0xBDF01150,0xBDF01150,0x042E0028,0x400E34FE)redis-server.exe!addReplyBulkCBuffer(c:\ release \ redis \ src \ networking.c:517)(0xFFFFFFFF,0x042E0028,0x01B77260,0x01B77260)redis-server.exe !luaReplyToRedisReply(c:\ release \ redis \ src \ scripting.c:792)(0x00000004,0xBDF01150,0x00000002,0x00000002)redis-server.exe!luaReplyToRedisReply(c:\ release \ redis \ src \ scripting.c:839) (0xFFFFFFFF,0x00A7F690,0x67897B20,0xBDF01150)redis-server.exe!evalGenericCommand(c:\ release \ redis \ src \ scripting.c:1048)(0x71E66870,0x00000000,0x00000001,0x000000B2)redis-server.exe!call(c :\ release \ redis \ src \ redis.c:2016)(0x56C60B04,0x4008B000,0x00000000,0x000000B2)redis-server.exe!processCommand(c:\ release \ redis \ src \ redis.c:2235)(0xBDF01150,0x000000B2 ,0x000023B5,0x00000001)redis-server.exe!processInputBuffer(c:\ release \ redis \ src \ networking.c:1274)(0xBDF01150,0x00000000,0x00000000,0x00000001)redis-server.exe!readQueryFromClient(c:\ release \ redis \ src \ networking.c:1329)(0xFFE51650,0x00000001,0x4 4726F20,0x0000012C)redis-server.exe!aeMain(c:\ release \ redis \ src \ ae.c:487)(0x56C5C7F8,0x00000002,0x00000000,0x00000002)redis-server.exe!redis_main(c:\ release \ redis \ src \ redis.c:3524)(0x0024BA50,0x00000002,0x56C5C7EB,0x00000002)redis-server.exe!main(c:\ release \ redis \ src \ win32_interop \ win32_qfork.cpp:1363)(0x00000016,0xFFFFFFFF,0x00000016, 0x0023F3A0)redis-server.exe!ServiceWorkerThread(c:\ release \ redis \ src \ win32_interop \ win32_service.cpp:485)(0x4000B3D0,0x00000000,0x00000000,0x00000000)KERNEL32.DLL!BaseThreadInitThunk(c:\ release \ redis \ src \ win32_interop \ win32_service.cpp:485)(0xBB0113B0,0x00000000,0x00000000,0x00000000)ntdll.dll!RtlUserThreadStart(c:\ release \ redis \ src \ win32_interop \ win32_service.cpp:485)(0x00000000,0x00000000,0x00000000,0x00000000) ntdll.dll!RtlUserThreadStart(c:\ release \ redis \ src \ win32_interop \ win32_service.cpp:485)(0x00000000,0x00000000,0x00000000,0x00000000)[33144] 18 Feb 18:18:44.857#=== REDIS BUG REPORT END 。 确保从START到END包含。 ===
maxheap设置为3000mb,服务器总共有64 GB RAM,大约10GB是免费的
还有一件事,但我不确定它是否真正解决了这个问题。
大多数情况下,问题会增加其频率。 然后,当我重置其中一个服务器的iis时,问题就完全消失了几个小时或几天。 我想到可能有挂/堆信号队列。 但我没有任何进一步的迹象表明情况可能如此。
关于那的任何提示?
We have a single standalone Redis (2.8.2104) for Windows node running on a server.
Two other server are communicating with this instance.
We use it with SignalR and for caching. The dump has a size of about 700MB
From time to time we have hangs for 1-3 minutes. After this it recovers by itself.
The error seems to only occur when there is some traffic on our page.
In this time we get the exception you can see below
StackExchange.Redis.RedisConnectionException: SocketFailure on EVAL at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Owin.Cors.CorsMiddleware.d__0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Owin.Mapping.MapMiddleware.d__0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at
When I search through the Redis log i can ocasssionally find these errors:
[33144] 18 Feb 18:18:44.843 #
=== REDIS BUG REPORT START: Cut & paste starting from here === [33144] 18 Feb 18:18:44.844 # Out Of Memory allocating 308457 bytes. [33144] 18 Feb 18:18:44.844 # --- ABORT [33144] 18 Feb 18:18:44.844 # --- STACK TRACE redis-server.exe!LogStackTrace(c:\release\redis\src\win32_interop\win32_stacktrace.cpp:95)(0x00000016, 0x042E0028, 0x00000000, 0x00000001) redis-server.exe!AbortHandler(c:\release\redis\src\win32_interop\win32_stacktrace.cpp:206)(0x00000001, 0x89EE7767, 0x40150880, 0xBB7A5ED7) redis-server.exe!raise(f:\dd\vctools\crt\crtw32\misc\winsig.c:587)(0x00000001, 0x00000000, 0x0004B4E9, 0x042E0028) redis-server.exe!abort(f:\dd\vctools\crt\crtw32\misc\abort.c:82)(0x00000001, 0x4013F888, 0x0004B4E9, 0x00008000) redis-server.exe!redisOutOfMemoryHandler(c:\release\redis\src\redis.c:3397)(0x0004B4E9, 0x4007DA07, 0x042E0028, 0x4007A27B) redis-server.exe!zmalloc(c:\release\redis\src\zmalloc.c:147)(0xBDF01150, 0x4007EB2C, 0xBDF01150, 0x446D6B10) redis-server.exe!sdsnewlen(c:\release\redis\src\sds.c:59)(0xBDF01150, 0xBDF01150, 0x3E74FD95, 0x00000003) redis-server.exe!_addReplyStringToList(c:\release\redis\src\networking.c:271)(0xBDF01150, 0xBDF01150, 0x042E0028, 0x400E34FE) redis-server.exe!addReplyBulkCBuffer(c:\release\redis\src\networking.c:517)(0xFFFFFFFF, 0x042E0028, 0x01B77260, 0x01B77260) redis-server.exe!luaReplyToRedisReply(c:\release\redis\src\scripting.c:792)(0x00000004, 0xBDF01150, 0x00000002, 0x00000002) redis-server.exe!luaReplyToRedisReply(c:\release\redis\src\scripting.c:839)(0xFFFFFFFF, 0x00A7F690, 0x67897B20, 0xBDF01150) redis-server.exe!evalGenericCommand(c:\release\redis\src\scripting.c:1048)(0x71E66870, 0x00000000, 0x00000001, 0x000000B2) redis-server.exe!call(c:\release\redis\src\redis.c:2016)(0x56C60B04, 0x4008B000, 0x00000000, 0x000000B2) redis-server.exe!processCommand(c:\release\redis\src\redis.c:2235)(0xBDF01150, 0x000000B2, 0x000023B5, 0x00000001) redis-server.exe!processInputBuffer(c:\release\redis\src\networking.c:1274)(0xBDF01150, 0x00000000, 0x00000000, 0x00000001) redis-server.exe!readQueryFromClient(c:\release\redis\src\networking.c:1329)(0xFFE51650, 0x00000001, 0x44726F20, 0x0000012C) redis-server.exe!aeMain(c:\release\redis\src\ae.c:487)(0x56C5C7F8, 0x00000002, 0x00000000, 0x00000002) redis-server.exe!redis_main(c:\release\redis\src\redis.c:3524)(0x0024BA50, 0x00000002, 0x56C5C7EB, 0x00000002) redis-server.exe!main(c:\release\redis\src\win32_interop\win32_qfork.cpp:1363)(0x00000016, 0xFFFFFFFF, 0x00000016, 0x0023F3A0) redis-server.exe!ServiceWorkerThread(c:\release\redis\src\win32_interop\win32_service.cpp:485)(0x4000B3D0, 0x00000000, 0x00000000, 0x00000000) KERNEL32.DLL!BaseThreadInitThunk(c:\release\redis\src\win32_interop\win32_service.cpp:485)(0xBB0113B0, 0x00000000, 0x00000000, 0x00000000) ntdll.dll!RtlUserThreadStart(c:\release\redis\src\win32_interop\win32_service.cpp:485)(0x00000000, 0x00000000, 0x00000000, 0x00000000) ntdll.dll!RtlUserThreadStart(c:\release\redis\src\win32_interop\win32_service.cpp:485)(0x00000000, 0x00000000, 0x00000000, 0x00000000) [33144] 18 Feb 18:18:44.857 # === REDIS BUG REPORT END. Make sure to include from START to END. ===
maxheap is set to 3000mb the server has a total of 64 GB RAM and about 10GB were free
There is also one more thing , but i'm not sure wether it is really realted to the problem.
Most of the time the problem increases its frequency. Then when I reset the iis of one of the server the problem is gone for hours or days completly. I thought about there may be hanging / stacking signalR queues. But I don't have any further signs that this may be the case.
Any hints about that?
原文:https://stackoverflow.com/questions/35489732
最满意答案
所有Microsoft.Extensions。*包都以.NET Standard 2.0为目标。 这意味着如果向应用程序添加适当的包,则可以使用依赖注入,配置,日志记录和 HttpClientFactory。
如果要将它与Polly一起使用,则需要添加Microsoft.Extensions.Http以使用HttpClientFactory和Microsoft.Extensions.Http.Polly
要配置HttpClientFactory,您必须将Microsoft.Extensions.DependencyInjection添加到“main”项目中。 Microsoft.Extensions.Http包仅依赖于包含接口的Microsoft.Extensions.DependencyInjection.Abstractions ,而不是DI提供程序本身。
All of the Microsoft.Extensions.* packages target .NET Standard 2.0. That means that you can use Dependency Injection, Configuration, Logging and HttpClientFactory if you add the appropriate package to your application.
You need to add Microsoft.Extensions.Http to use HttpClientFactory and Microsoft.Extensions.Http.Polly if you want to use it with Polly
To configure HttpClientFactory you'll have to add Microsoft.Extensions.DependencyInjection to your "main" project. Microsoft.Extensions.Http package only depends on Microsoft.Extensions.DependencyInjection.Abstractions which contains the interfaces, not the DI provider itself.
相关问答
更多-
所有Microsoft.Extensions。*包都以.NET Standard 2.0为目标。 这意味着如果向应用程序添加适当的包,则可以使用依赖注入,配置,日志记录和 HttpClientFactory。 如果要将它与Polly一起使用,则需要添加Microsoft.Extensions.Http以使用HttpClientFactory和Microsoft.Extensions.Http.Polly 要配置HttpClientFactory,您必须将Microsoft.Extensions.Depend ...
-
任何人都可以请建议我怎样才能使两个分支(目标为4.5和4.6.2)成功地在具有正确的Nuget依赖关系的同一台机器上构建? 同意Hans的评论“ net45子目录为什么是空的,而不是标准的行为,这不是显而易见的事情,他们是否被手工剥离并检查到源代码控制? ”。 Nuget不会删除.NET 4.5文件夹中的.dll文件。 当您切换到指向.NET Framework 4.5的旧分支时,属性winodw中的程序集路径应该指向...\lib\net45\..文件夹。 而Git的默认行为并不是将packages文件夹 ...
-
我认为你可以做这样的事情: var loggingHandler = new LoggingHandler(); var responseContentProcessingHandler = new ResponseContentProcessingHandler(); loggingHandler.InnerHandler = responseContentProcessingHandler; var client = new HttpClient(loggingHandler); 所以你不需要为了链 ...
-
.NET Framework 4.6.2和.NET Standard 2.0不兼容(.NET Framework 4.6.2 and .NET Standard 2.0 incompatibility)[2024-04-13]
在VS 2017 15.3和.NET Core 2.0.0 SDK(2017年8月发布)中的最新工具更新中,支持.NET Standard 2.0的.NET Framework的最低版本为4.6.1。 这是通过添加兼容性DLL来确保库加载和工作的工具来实现的。 在4.6.1-4.7中只有少数API不支持,但Entity Framework Core应该可以在4.6.1+上运行。 对于.NET Framework 4.7.1+,工具不再需要注入这些库。 As of the latest tooling upd ... -
您需要.NET 4.6.2目标包,而不仅仅是运行时。 下载可以在这里下载https://www.microsoft.com/en-us/download/details.aspx?id=53321 You need the .NET 4.6.2 targeting pack, not just the runtime. Download can download it here https://www.microsoft.com/en-us/download/details.aspx?id=53321
-
Runtime版本和Target版本是不同的东西。 您需要运行Visual Studio 2017 setup并选择Individual Components下的.net 4.6.2 SDK/Targeting pack : 在VS2017中默认不选择它们。 您还必须为.net 4.7执行此操作,默认情况下也不会安装它。 The Runtime version and Target versions are different things. You need to run Visual Studio 20 ...
-
事实证明我下载了错误的安装程序。 它是4.6,而我需要4.6.2,这是可用的。 这个问题值得删除,但我不会因为其他人可能会犯同样的罪。 It turns out I had downloaded a wrong installer. it was of 4.6 whereas I needed 4.6.2 which is available here. The question deserves deletion but i wont coz some one else might commit the ...
-
尽管Prism 5已被弃用且不再受支持,但您应该能够在面向.NET Framework 4.6.2的应用程序中使用它,因为后者是.NET Framework 4到4.6的向后兼容的就地更新。 1。 在Visual Studio中创建一个新的WPF应用程序项目,在解决方案资源管理器中右键单击该项目,然后选择“管理NuGet包”,然后单击左侧窗格中的“在线”项,搜索“Prism”并安装“Prism(Deprecated)”套餐。 这应该下载并参考Prism 5程序集,您应该能够在之后构建应用程序。 Althou ...
-
.NET 4.5引入了编译器使用的MethodInfo.CreateDelegate()方法而不是Delegate.CreateDelegate() 记录的C#表达式行为 Expression
> e = f => f.DoSomething; 是它将创建一个表示Func 的表达式,如果编译和调用它将接受Foo并返回一个在该Foo上调用.DoSomething()的Action 。 这种行为没有改变。 由于记录的行为没有变化,因此很可能没有变更的文 ... -
新的DataAnnotations本地化功能,如博客文章中所述, 宣布.NET Framework 4.6.2 仅适用于ASP.NET WebForms 。 的WebForms ... .NET Framework 4.6.2中的新本地化功能在System.Web.ModelBinding.DataAnnotationsModelValidator类中实现,该类使用StringLocalizerProviders.DataAnnotationStringLocalizerProvider.GetLocali ...