Nodejs cluster报错Error [ERR_IPC_CHANNEL_CLOSED]: channel closed

这个错误是在Master进程向子进程send消息时发现pipe已经关闭了的情况下由Master进程报出来的。

2019-12-16 14:33:02,pid-170096, Error [ERR_IPC_CHANNEL_CLOSED]: channel closed
    at ChildProcess.target.send (internal/child_process.js:578:16)
    at Worker.send (internal/cluster/worker.js:54:28)

经排查这个问题原因是子进程占用内存太多,触发了Linux内核的OOM Killer机制通过SIGKILL信号kill掉了子进程。在Centos 6上查看/var/log/messages可以找到相关日志:

root@prod:/var/log> grep "Kill" messages | grep node
Dec 16 14:33:00 8_17 kernel: Out of memory: Kill process 170341 (node) score 8 or sacrifice child
Dec 16 14:33:00 8_17 kernel: Killed process 170341, UID 0, (node) total-vm:2174692kB, anon-rss:1251432kB, file-rss:8kB
Dec 16 14:35:54 8_17 kernel: Out of memory: Kill process 175318 (node) score 8 or sacrifice child
Dec 16 14:35:54 8_17 kernel: Killed process 175318, UID 0, (node) total-vm:2175532kB, anon-rss:1252000kB, file-rss:40kB
Dec 16 14:42:04 8_17 kernel: Out of memory: Kill process 184236 (node) score 8 or sacrifice child
Dec 16 14:42:04 8_17 kernel: Killed process 184236, UID 0, (node) total-vm:2186980kB, anon-rss:1264544kB, file-rss:172kB
Dec 16 14:42:04 8_17 kernel: Out of memory: Kill process 184240 (node) score 8 or sacrifice child
Dec 16 14:42:04 8_17 kernel: Killed process 184240, UID 0, (node) total-vm:2186980kB, anon-rss:1264544kB, file-rss:172kB
Dec 16 14:42:32 8_17 kernel: Out of memory: Kill process 184250 (node) score 9 or sacrifice child
Dec 16 14:42:32 8_17 kernel: Killed process 184250, UID 0, (node) total-vm:2213728kB, anon-rss:1290780kB, file-rss:208kB
Dec 16 14:43:08 8_17 kernel: Out of memory: Kill process 184629 (node) score 10 or sacrifice child
Dec 16 14:43:08 8_17 kernel: Killed process 184629, UID 0, (node) total-vm:2229684kB, anon-rss:1307020kB, file-rss:664kB
Dec 16 14:43:08 8_17 kernel: Out of memory: Kill process 184277 (node) score 9 or sacrifice child
Dec 16 14:43:08 8_17 kernel: Killed process 184277, UID 0, (node) total-vm:2216760kB, anon-rss:1291796kB, file-rss:616kB

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值