<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Jérôme Chauveau</title>
    <description>The latest articles on DEV Community by Jérôme Chauveau (@jrme_chauveau_54adb30d6).</description>
    <link>https://dev.to/jrme_chauveau_54adb30d6</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2071684%2F19fe4b0d-c486-482a-afe7-e107f80fe81b.png</url>
      <title>DEV Community: Jérôme Chauveau</title>
      <link>https://dev.to/jrme_chauveau_54adb30d6</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jrme_chauveau_54adb30d6"/>
    <language>en</language>
    <item>
      <title>Nodejs worker pools fine tuning</title>
      <dc:creator>Jérôme Chauveau</dc:creator>
      <pubDate>Thu, 21 Nov 2024 15:03:11 +0000</pubDate>
      <link>https://dev.to/jrme_chauveau_54adb30d6/nodejs-worker-pools-fine-tuning-26o8</link>
      <guid>https://dev.to/jrme_chauveau_54adb30d6/nodejs-worker-pools-fine-tuning-26o8</guid>
      <description>&lt;p&gt;Hi everyone,&lt;/p&gt;

&lt;p&gt;If I understood correctly:&lt;/p&gt;

&lt;p&gt;1) by default nodejs provides a worker pool, whose size can be tuned with UV_THREADPOOL_SIZE (default: 4)&lt;br&gt;
2) a cpu or io intensive task can use thread from this worker pool (this is the case for node modules like DNS or Crypto) or create a dedicated worker pool&lt;br&gt;
3) total number of worker pools should not exceed the actual number of cpu capability of where the application is running&lt;/p&gt;

&lt;p&gt;My questions:&lt;/p&gt;

&lt;p&gt;1) how do you track the actual number of workers being used by your application ?&lt;br&gt;
2) when using third party modules (for instance mongoose or JSONStream), one should be aware of those modules strategy (use of default worker pool or dedicated worker pool). Does that mean that for every module used one should look into the code to determine its strategy?&lt;br&gt;
3) the use of node cluster (for instance with pm2) seems that it complicates the fine tuning of the number of workers, and that it'd be better to just scale out. Your advice on this matter?&lt;/p&gt;

&lt;p&gt;Thanks for your feedback&lt;/p&gt;

</description>
      <category>node</category>
    </item>
  </channel>
</rss>
