<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Nodejs on Elastic Code</title>
    <link>https://my.elastic-code.com/zh/tags/nodejs/</link>
    <description>Recent content in Nodejs on Elastic Code</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>zh-cn</language>
    <copyright>© 2026 Elastic Code</copyright>
    <lastBuildDate>Wed, 08 Jan 2025 09:32:11 +0800</lastBuildDate><atom:link href="https://my.elastic-code.com/zh/tags/nodejs/index.xml" rel="self" type="application/rss+xml" />
    
    <item>
      <title>进程管理工具之 pm2</title>
      <link>https://my.elastic-code.com/zh/posts/tech/pm2/</link>
      <pubDate>Wed, 08 Jan 2025 09:32:11 +0800</pubDate>
      
      <guid>https://my.elastic-code.com/zh/posts/tech/pm2/</guid>
      <description>&lt;h1 class=&#34;relative group&#34;&gt;PM2&#xA;    &lt;div id=&#34;pm2&#34; class=&#34;anchor&#34;&gt;&lt;/div&gt;&#xA;    &#xA;    &lt;span&#xA;        class=&#34;absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none&#34;&gt;&#xA;        &lt;a class=&#34;text-primary-300 dark:text-neutral-700 !no-underline&#34; href=&#34;#pm2&#34; aria-label=&#34;锚点&#34;&gt;#&lt;/a&gt;&#xA;    &lt;/span&gt;&#xA;    &#xA;&lt;/h1&gt;&#xA;&lt;p&gt;参考：https://mp.weixin.qq.com/s/S8Gw2XzuflnN2QMSVXhLhg&lt;/p&gt;&#xA;&#xA;&lt;h2 class=&#34;relative group&#34;&gt;场景&#xA;    &lt;div id=&#34;场景&#34; class=&#34;anchor&#34;&gt;&lt;/div&gt;&#xA;    &#xA;    &lt;span&#xA;        class=&#34;absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none&#34;&gt;&#xA;        &lt;a class=&#34;text-primary-300 dark:text-neutral-700 !no-underline&#34; href=&#34;#%e5%9c%ba%e6%99%af&#34; aria-label=&#34;锚点&#34;&gt;#&lt;/a&gt;&#xA;    &lt;/span&gt;&#xA;    &#xA;&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;node 应用跑的时候突然抛了个错，崩溃了，是不是需要重新跑起来？这时候是不是就需要另一个进程来自动做重启这件事情？&lt;/li&gt;&#xA;&lt;li&gt;node 应用的日志默认输出在控制台，如果想输出到不同的日志文件，是不是可以让另一个进程获取 node 应用的输出，然后写文件来实现？&lt;/li&gt;&#xA;&lt;li&gt;node 是单线程的，而机器是多个 cpu 的，为了充分利用 cpu 的能力，我们会用多个进程来跑 node 应用，来提高性能。这种通用逻辑是不是也可以放到一个单独进程里来实现？&lt;/li&gt;&#xA;&lt;li&gt;node 运行时的 cpu、内存等资源的占用，是不是需要监控？这时候是不是可以让另一个进程来做？&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;线上的 node 应用不只是跑起来就行了，还要做自动重启、日志、多进程、监控这些事情。&lt;/p&gt;</description>
      
    </item>
    
  </channel>
</rss>
