为什么从 python/uwsgi 内部调用`node.js` 会死? [英] Why is `node.js` dying when called from inside python/uwsgi?
问题描述
从 shell 开始,这个 python
代码启动并与 node.js
进程通信:
From the shell this python
code which start and communicates with a node.js
process works fine:
> 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代码>:
But when I run the same code from within uwsgi I instead get this in err
:
'致命错误:v8::Context::New() V8 不再可用\n'
任何来自 wsgi
社区或 node.js
社区的见解?我不知所措.
Any insights from either the wsgi
community or the node.js
community? I'm at a loss.
推荐答案
检查您是否正在运行具有内存限制的 uWSGI(例如 --limit-as 或 cgroup/jail).从它产生的进程将继承这些限制.甚至检查 v8 可以预期的环境变量(如 HOME)
Check if you are running uWSGI with memory constraints (like --limit-as or a cgroup/jail). Processes spawned from it will inherit those limits. Even check for environment variables v8 could expect (like HOME)
这篇关于为什么从 python/uwsgi 内部调用`node.js` 会死?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!