<?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: Joseph Benguira</title>
    <description>The latest articles on DEV Community by Joseph Benguira (@jbenguira).</description>
    <link>https://dev.to/jbenguira</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%2F306382%2F4a4453c0-e8b2-49ae-99ab-688c26815391.jpeg</url>
      <title>DEV Community: Joseph Benguira</title>
      <link>https://dev.to/jbenguira</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jbenguira"/>
    <language>en</language>
    <item>
      <title>[BenchP0rn] AMD Ryzen 5950x + Node.js, discover the real power of Node.js Workers</title>
      <dc:creator>Joseph Benguira</dc:creator>
      <pubDate>Tue, 09 Feb 2021 15:06:49 +0000</pubDate>
      <link>https://dev.to/jbenguira/benchp0rn-amd-ryzen-5950x-node-js-discover-the-real-power-of-node-js-workers-48do</link>
      <guid>https://dev.to/jbenguira/benchp0rn-amd-ryzen-5950x-node-js-discover-the-real-power-of-node-js-workers-48do</guid>
      <description>&lt;p&gt;I've just received my new computer based on Ryzen 5950x, it's a real Beast!&lt;/p&gt;

&lt;p&gt;One of the first thing I did was to benchmark it with my favorite language, Node.js :)&lt;/p&gt;

&lt;p&gt;I've made all the tests below with WRK as the client&lt;/p&gt;

&lt;p&gt;for the server part I used Cloudgate which is an open source multi-threaded Node.js application server, more details here: &lt;a href="https://github.com/elestio/cloudgate"&gt;https://github.com/elestio/cloudgate&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you want to run the benchmark on your own hardware:&lt;/p&gt;

&lt;p&gt;Install cloudgate:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;wget -O - https://cloudgate.terasp.net/CDN/cloudgate.sh | bash&lt;/code&gt; &lt;/p&gt;

&lt;p&gt;Create a sample project based on a template:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cloudgate --create /tmp/myproj&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;then type 0 to create a project based on "CatchAll" sample&lt;/p&gt;

&lt;p&gt;Finally start cloudgate on your new project path:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cloudgate -r /tmp/myproj&lt;/code&gt;&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;My benchmark results:&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Single thread test:&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;wrk -t1 -c256 --latency &lt;a href="http://127.0.0.1:3000/cloudgate/debug/raw"&gt;http://127.0.0.1:3000/cloudgate/debug/raw&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Running 10s test @ &lt;a href="http://127.0.0.1:3000/cloudgate/debug/raw"&gt;http://127.0.0.1:3000/cloudgate/debug/raw&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;1 threads and 256 connections&lt;/p&gt;

&lt;p&gt;Thread Stats Avg Stdev Max +/- Stdev&lt;/p&gt;

&lt;p&gt;Latency 1.03ms 464.75us 4.59ms 53.66%&lt;/p&gt;

&lt;p&gt;Req/Sec 123.98k 6.97k 131.51k 74.00%&lt;/p&gt;

&lt;p&gt;Requests/sec: 123391.18&lt;/p&gt;

&lt;p&gt;Transfer/sec: 6.00MB&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Low concurrency:&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;wrk -t2 -c16 --latency &lt;a href="http://127.0.0.1:3000/cloudgate/debug/raw"&gt;http://127.0.0.1:3000/cloudgate/debug/raw&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Running 10s test @ &lt;a href="http://127.0.0.1:3000/cloudgate/debug/raw"&gt;http://127.0.0.1:3000/cloudgate/debug/raw&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;2 threads and 16 connections&lt;/p&gt;

&lt;p&gt;Thread Stats Avg Stdev Max +/- Stdev&lt;/p&gt;

&lt;p&gt;Latency 50.77us 28.37us 2.82ms 93.06%&lt;/p&gt;

&lt;p&gt;Req/Sec 111.51k 8.43k 123.75k 59.90%&lt;/p&gt;

&lt;p&gt;Requests/sec: 221909.26&lt;/p&gt;

&lt;p&gt;Transfer/sec: 10.79MB&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;High concurrency:&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;wrk -t16 -c1024 --latency &lt;a href="http://127.0.0.1:3000/cloudgate/debug/raw"&gt;http://127.0.0.1:3000/cloudgate/debug/raw&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Running 10s test @ &lt;a href="http://127.0.0.1:3000/cloudgate/debug/raw"&gt;http://127.0.0.1:3000/cloudgate/debug/raw&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;16 threads and 1024 connections&lt;/p&gt;

&lt;p&gt;Thread Stats Avg Stdev Max +/- Stdev&lt;/p&gt;

&lt;p&gt;Latency 1.61ms 3.37ms 57.94ms 89.52%&lt;/p&gt;

&lt;p&gt;Req/Sec 128.50k 24.87k 160.21k 81.75%&lt;/p&gt;

&lt;p&gt;Requests/sec: 2038979.20&lt;/p&gt;

&lt;p&gt;Transfer/sec: 99.17MB&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;High throughput:&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;wrk -t16 -c256 --latency &lt;a href="http://127.0.0.1:3000/68kb.jpg"&gt;http://127.0.0.1:3000/68kb.jpg&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Running 10s test @ &lt;a href="http://127.0.0.1:3000/68kb.jpg"&gt;http://127.0.0.1:3000/68kb.jpg&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;16 threads and 256 connections&lt;/p&gt;

&lt;p&gt;Thread Stats Avg Stdev Max +/- Stdev&lt;/p&gt;

&lt;p&gt;Requests/sec: 307312.06&lt;/p&gt;

&lt;p&gt;Transfer/sec: 19.50GB&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Execute Node.js function (simple calculation + string manipulation)&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;wrk -t16 -c256 --latency &lt;a href="http://127.0.0.1:3000/tests/simple"&gt;http://127.0.0.1:3000/tests/simple&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Running 10s test @ &lt;a href="http://127.0.0.1:3000/tests/simple"&gt;http://127.0.0.1:3000/tests/simple&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;16 threads and 256 connections&lt;/p&gt;

&lt;p&gt;Thread Stats Avg Stdev Max +/- Stdev&lt;/p&gt;

&lt;p&gt;Latency 799.45us 0.98ms 36.20ms 94.11%&lt;/p&gt;

&lt;p&gt;Req/Sec 23.18k 3.32k 64.08k 91.03%&lt;/p&gt;

&lt;p&gt;3704901 requests in 10.10s, 1.89GB read&lt;/p&gt;

&lt;p&gt;Requests/sec: 366835.61&lt;/p&gt;

&lt;p&gt;Transfer/sec: 192.06MB&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Lightweight real-time server monitoring with Node.js</title>
      <dc:creator>Joseph Benguira</dc:creator>
      <pubDate>Fri, 01 Jan 2021 10:18:59 +0000</pubDate>
      <link>https://dev.to/jbenguira/lightweight-real-time-server-monitoring-with-node-js-1997</link>
      <guid>https://dev.to/jbenguira/lightweight-real-time-server-monitoring-with-node-js-1997</guid>
      <description>&lt;p&gt;I've made for my own needs a very simple and lightweight real-time monitoring tool, it's open source. You can check it here: &lt;a href="https://github.com/elestio/ws-monitoring"&gt;https://github.com/elestio/ws-monitoring&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rn33TTUD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.terasp.net/CDN/ws-monitoring.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rn33TTUD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.terasp.net/CDN/ws-monitoring.jpg" alt="ws-monitoring" title="ws-monitoring"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Super light real time monitoring tool / Small CPU/RAM Usage&lt;/li&gt;
&lt;li&gt;Easy to run once or as a service&lt;/li&gt;
&lt;li&gt;Click on tiles to enable or disable graphing for a metric&lt;/li&gt;
&lt;li&gt;REST &amp;amp; Websocket APIs (soon)&lt;/li&gt;
&lt;li&gt;Responsive design &amp;amp; Embeddable&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;My goal is not to compete with Netdata or other advanced tools but to have something working in few MB rather than few GB&lt;/p&gt;

&lt;p&gt;Also frontend is Vanilla JS under 10KB and backend is 300 lines of code. That would be a good start for someone wanting to learn about server metrics, websockets and simple charts in SVG.&lt;/p&gt;

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