【发布时间】:2015-08-16 10:22:42
【问题描述】:
我正在尝试使用“forver”模块运行我的 Node 应用程序,我还想通过“--prof”选项来分析我的应用程序。 我使用的命令是
NODE_ENV=staging PORT=3000 NODE_CONFIG_DIR="/domains/serving/src/config" 永远启动 -c "node --prof" -l /var/log/forever.log -e /var/log/forever_error. log -o /var/log/forever_output.log -a /domains/serving/src/bin/www
或者
NODE_ENV=staging PORT=3000 NODE_CONFIG_DIR="/domains/serving/src/config" 永远启动 -c "node --debug=3048 --prof" -l /var/log/forever.log -e /var /log/forever_error.log -o /var/log/forever_output.log -a /domains/serving/src/bin/www
在我的本地机器上运行时一切正常,但是在服务器上执行相同的命令时会失败
1) forever list 命令显示一个进程正在运行,但没有进程在侦听端口 3000 2) 未创建探查器日志文件 (v8.log) 我尝试使用 find 命令
sudo find / -iname "v8.log"
我的本地机器是 Ubuntu
服务器配置如下 以下命令的输出
uname -e
Linux MSSSKAMITMI 2.6.32-431.29.2.el6.x86_64 #1 SMP Tue Sep 9 21:36:05 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
节点-v
v0.12.0
如果我在服务器和本地运行节点命令而不是永远运行一切正常,则创建日志文件的进程侦听端口 3000,我也可以发出请求并获得响应。
NODE_ENV=staging PORT=3000 NODE_CONFIG_DIR="/domains/serving/src/config" node --debug=3048 --prof /domains/serving/src/bin/www
【问题讨论】:
-
我为此找到的最佳答案是:stackoverflow.com/a/50892075/3487604
标签: linux node.js profiling v8