Node.js/pm2:修订间差异
来自康健生活
| (未显示同一用户的2个中间版本) | |||
| 第49行: | 第49行: | ||
== 配置文件 == | == 配置文件 == | ||
== 技巧 == | |||
使用 <code>npm start</code> 启动并为进程命名。 | |||
{{shc|<syntaxhighlight lang="bash"> | |||
pm2 start npm --name newname -- start</syntaxhighlight>|$|/home/kangkk}} | |||
运行一个自定义的脚本 | |||
{{shc|<syntaxhighlight lang="bash"> | |||
pm2 start npm -- run custom | |||
</syntaxhighlight>|$|/home/kangkk}} | |||
== 内存 == | == 内存 == | ||
=== 最大内存 === | === 最大内存 === | ||
超过最大内存限制会自动崩溃,并且在项目目录下生成 core.pid 文件。 | 超过最大内存限制会自动崩溃,并且在项目目录下生成 core.pid 文件。 | ||
{{Shc_out|<syntaxhighlight lang="bash"> | |||
ls</syntaxhighlight>|<syntaxhighlight lang="bash">access.log core.12829 core.18594 core.25013 core.30818 core.3395 core.38790 core.7218 node_modules | |||
core.10177 core.12879 core.19192 core.25899 core.3145 core.33993 core.3940 core.73 package-lock.json | |||
core.10761 core.13908 core.19809 core.26633 core.31677 core.3411 core.40785 core.7915 package.json | |||
core.10846 core.14130 core.20295 core.27303 core.32116 core.34497 core.4699 core.831 production.js | |||
core.11179 core.1479 core.20761 core.2786 core.3262 core.34850 core.5085 core.8571 runtime | |||
core.11552 core.15413 core.20875 core.29218 core.32642 core.36601 core.6035 core.9859 src | |||
core.12064 core.17588 core.21868 core.29462 core.32854 core.36950 core.6157 error.log view | |||
core.12648 core.17661 core.23078 core.30426 core.33591 core.37015 core.6284 nginxStarter.sh | |||
</syntaxhighlight>|$|/home/kangkk}} | |||
==== file ==== | |||
使用 file。 | |||
{{Shc_out|<syntaxhighlight lang="bash"> | |||
file core.38790</syntaxhighlight>|<syntaxhighlight lang="bash"> | |||
core.38790: ELF 64-bit LSB core file, x86-64, version 1 (SYSV), too many program headers (3594) | |||
</syntaxhighlight>|$|/home/kangkk}} | |||
== vue == | == vue == | ||