asp.net-core - kestrel 后面的 Dotnet 站点停止工作(请求从 Apache 服务器返回 503)
问题描述
我在 Linux 机器上运行 .NET core 3.1 应用程序,Kestrel 在反向代理 (Apache) 后面。我不断地将一些数据推送到某个端点,然后通过 signalR 集线器将这些数据转发给用户:
[HttpPut("{tagName}/live")]
[Authorize(Roles = "Datasource")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status400BadRequest)]
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
[ProducesResponseType(StatusCodes.Status403Forbidden)]
[TypeFilter(typeof(TagControllerFilterAttribute))]
public async Task<IActionResult> PutLiveTag(Tag tag, string tagName)
{
bool status = await tagRepository.UpdateLiveData(tagName, tag);
if (status)
{
await tagHubContext.Clients.Group(tagName).SendAsync(tagName, tag);
return Ok();
}
return BadRequest();
}
用户只需将其从组中删除即可加入和离开该信号器集线器:
public class TagDataHub : Hub
{
[HubMethodName("subscribe")]
public async Task JoinTagGroup(string tagName)
{
await Groups.AddToGroupAsync(Context.ConnectionId, tagName);
}
[HubMethodName("unsubscribe")]
public async Task LeaveTagGroup(string tagName)
{
await Groups.RemoveFromGroupAsync(Context.ConnectionId, tagName);
}
}
我的应用程序在部署中运行了几个小时,然后当我尝试使用该应用程序的 API 端点或与该应用程序相关的任何东西时,我得到 503 来自Apache的响应。我真的不知道为什么 Kestrel 停止工作......当我运行时,service dotnet-site status
我发现该应用程序仍在运行。
我检查了服务器中的进程,我看到 dotnet 使用了大量资源,但除了上面提供的代码之外,该应用程序中没有其他任何东西在运行:
请发送帮助我真的不知道如何在 linux 服务器上调试/解决这个问题,我会重视任何建议。
我也查了这个并完全按照这个人做,但它没有帮助我:apache mpm worker
解决方案
推荐阅读
- webrtc - 远程用户离开事件在 webrtc 视频中不起作用
- c# - Combobox SelectedValue 未在绑定 XAML 中设置,但在 C# 中有效
- ios14 - iOS 14 上的 WKUserScript init 崩溃:使用未实现的初始化程序 init(source:injectionTime:forMainFrameOnly:in:)
- machine-learning - 为什么自动编码器中的解码器在最后一层使用 sigmoid?
- docker - Knative - kubernetes yaml 从谷歌云存储挂载数据
- python - Graphviz 使用带重音的点
- node.js - 获取其属性等于数组中元素之一的所有文档
- r - 如何处理 stm 主题模型中的空文档
- python - Python-第一行代码范围内的素数列表
- ansible - Ansible 重试项目