DEV Community

Joseph Benguira
Joseph Benguira

Posted on

[BenchP0rn] AMD Ryzen 5950x + Node.js, discover the real power of Node.js Workers

I've just received my new computer based on Ryzen 5950x, it's a real Beast!

One of the first thing I did was to benchmark it with my favorite language, Node.js :)

I've made all the tests below with WRK as the client

for the server part I used Cloudgate which is an open source multi-threaded Node.js application server, more details here: https://github.com/elestio/cloudgate

If you want to run the benchmark on your own hardware:

Install cloudgate:

wget -O - https://cloudgate.terasp.net/CDN/cloudgate.sh | bash

Create a sample project based on a template:

cloudgate --create /tmp/myproj

then type 0 to create a project based on "CatchAll" sample

Finally start cloudgate on your new project path:

cloudgate -r /tmp/myproj

 

My benchmark results:

Single thread test:

wrk -t1 -c256 --latency http://127.0.0.1:3000/cloudgate/debug/raw

Running 10s test @ http://127.0.0.1:3000/cloudgate/debug/raw

1 threads and 256 connections

Thread Stats Avg Stdev Max +/- Stdev

Latency 1.03ms 464.75us 4.59ms 53.66%

Req/Sec 123.98k 6.97k 131.51k 74.00%

Requests/sec: 123391.18

Transfer/sec: 6.00MB

Low concurrency:

wrk -t2 -c16 --latency http://127.0.0.1:3000/cloudgate/debug/raw

Running 10s test @ http://127.0.0.1:3000/cloudgate/debug/raw

2 threads and 16 connections

Thread Stats Avg Stdev Max +/- Stdev

Latency 50.77us 28.37us 2.82ms 93.06%

Req/Sec 111.51k 8.43k 123.75k 59.90%

Requests/sec: 221909.26

Transfer/sec: 10.79MB

High concurrency:

wrk -t16 -c1024 --latency http://127.0.0.1:3000/cloudgate/debug/raw

Running 10s test @ http://127.0.0.1:3000/cloudgate/debug/raw

16 threads and 1024 connections

Thread Stats Avg Stdev Max +/- Stdev

Latency 1.61ms 3.37ms 57.94ms 89.52%

Req/Sec 128.50k 24.87k 160.21k 81.75%

Requests/sec: 2038979.20

Transfer/sec: 99.17MB

High throughput:

wrk -t16 -c256 --latency http://127.0.0.1:3000/68kb.jpg

Running 10s test @ http://127.0.0.1:3000/68kb.jpg

16 threads and 256 connections

Thread Stats Avg Stdev Max +/- Stdev

Requests/sec: 307312.06

Transfer/sec: 19.50GB

Execute Node.js function (simple calculation + string manipulation)

wrk -t16 -c256 --latency http://127.0.0.1:3000/tests/simple

Running 10s test @ http://127.0.0.1:3000/tests/simple

16 threads and 256 connections

Thread Stats Avg Stdev Max +/- Stdev

Latency 799.45us 0.98ms 36.20ms 94.11%

Req/Sec 23.18k 3.32k 64.08k 91.03%

3704901 requests in 10.10s, 1.89GB read

Requests/sec: 366835.61

Transfer/sec: 192.06MB

Top comments (0)