【问题标题】:Why is `node.js` dying when called from inside python/uwsgi?为什么从 python/uwsgi 内部调用时,`node.js` 会死掉?
【发布时间】:2012-03-15 17:40:04
【问题描述】:

从 shell 这个python 代码启动并与node.js 进程通信工作正常:

> from subprocess import *
> js = "(function(m) { console.log(m) })('hello world')"
> (out,err) = Popen(["node"], stdin=PIPE, stdout=PIPE, stderr=PIPE, shell=False).communicate(js)
> out
"hello world\n"

但是当我从 uwsgi 中运行相同的代码时,我会在 err 中得到这个:

'FATAL ERROR: v8::Context::New() V8 is no longer usable\n'

来自wsgi 社区或node.js 社区的任何见解?我很茫然。

【问题讨论】:

  • @LinusGThiel 我还没有尝试过更改 uwsgi 设置,但是基于 python 的建议使用 close_fds=True 调用 Popen 不起作用

标签: python node.js wsgi uwsgi subprocess


【解决方案1】:

检查你是否正在运行有内存限制的 uWSGI(如 --limit-as 或 cgroup/jail)。从它产生的进程将继承这些限制。甚至检查 v8 可能预期的环境变量(如 HOME)

【讨论】:

  • 增加 uwsgi 每个进程的内存限制已修复!设置为:<limit-as>512</limit-as>,我将其升级为<limit-as>768</limit-as>
猜你喜欢
  • 2015-06-22
  • 2011-10-25
  • 2013-04-01
  • 1970-01-01
  • 1970-01-01
  • 2012-10-25
  • 1970-01-01
  • 2010-09-16
  • 1970-01-01
相关资源
最近更新 更多