简体   繁体   English

错误:永远检测到的脚本被信号杀死:SIGKILL

[英]error: Forever detected script was killed by signal: SIGKILL

Recently I'm having an issue with my server. 最近我的服务器出了问题。

My node server stops, and forever does not restart it. 我的节点服务器停止,永远不会重新启动它。

In my forever log I see this line: 在我的永远日志中,我看到这一行:

error: Forever detected script was killed by signal: SIGKILL

The server itself does not throw an error. 服务器本身不会抛出错误。 In fact the server seems to run without any glitches and then a random SIGKILL is executed. 事实上,服务器似乎没有任何故障运行,然后执行随机SIGKILL。

I don't know if it's AWS shutting down my server, or if it's an issue with forever, or perhaps the node server itself. 我不知道AWS是否关闭了我的服务器,或者它是永远的问题,还是节点服务器本身。

Searching Google does not provide much insight. 搜索Google并没有提供太多见解。

I thought this might be related to a cpu spike or a memory usage spike, but both seem to be low (but maybe there's a spike for a split second that I don't recognize). 我认为这可能与cpu峰值或内存使用量峰值有关,但两者似乎都很低(但可能会出现一段时间的峰值,我不认识)。

Is this an issue anyone has encountered before? 这是以前任何人遇到的问题吗? Any idea how can I fix it? 知道怎么解决它?

Well.. Why the problem occurred is still mystery but I was able to resolve it by reducing the queue for my queries on my MongoDB. 嗯..为什么问题发生仍然是个谜,但我能够通过减少我在MongoDB上查询的队列来解决它。

While both mongo and node were not using a lot of RAM this seems to be the cause of the issue since by reducing the number of queries, the problem disappeared. 虽然mongo和节点都没有使用大量RAM,但这似乎是问题的原因,因为通过减少查询数量,问题就消失了。

What exactly triggered the SIGKILL is still a mystery, yet I thought this information maybe useful for other users. 什么触发SIGKILL仍然是一个谜,但我认为这些信息可能对其他用户有用。

For me it had to do with the way mongoose was setup and interacting with the application code. 对我而言,它与mongoose的设置方式以及与应用程序代码的交互方式有关。

I was able to fix by creating a connection using the answer from here: Mongoose Connection , creating my schema definitions and only exporting the models to be used. 我能够通过使用此处的答案创建连接来修复: Mongoose Connection ,创建我的模式定义并仅导出要使用的模型。

I hope this is helpful to someone 我希望这对某人有帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM