Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance slowdown on Docker #203

Closed
dalisoft opened this issue Jun 16, 2021 · 1 comment
Closed

Performance slowdown on Docker #203

dalisoft opened this issue Jun 16, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@dalisoft
Copy link
Member

dalisoft commented Jun 16, 2021

Bug Report

Minimal reproducible repository

See https://github.com/nanoexpress/nanoexpress-vps-bench

Current Behavior

When comparing between native and Docker code execution difference is does 100% for me. After patching command it differs only ~35%. Looks like not a much difference, but it's a lot

Expected behavior/code

Maximum ~10% performance difference

Environment

  • Node/npm version: Node.js v10+
  • OS: Ubuntu, Debian, WSL2 Ubuntu/Debian
  • Addinational Info: Docker causes this

Possible Solution

Run code outside Docker, try use pm2 and cluster or Threaded mode

Additional context/Screenshots

See wrk results

Docker
~ 
❯ wrk -c8 -t8 -d60  http://localhost:4200/time
Running 1m test @ http://localhost:4200/time
  8 threads and 8 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   188.99us  218.96us  17.18ms   97.72%
    Req/Sec     5.88k   472.61     8.56k    82.54%
  2808875 requests in 1.00m, 736.66MB read
Requests/sec:  46736.89
Transfer/sec:     12.26MB
~ took 1m 
❯ wrk -c8 -t8 -d60  http://localhost:4100/time
Running 1m test @ http://localhost:4100/time
  8 threads and 8 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    71.53us   48.08us   7.54ms   98.93%
    Req/Sec    14.10k   320.84    14.62k    84.90%
  6745752 requests in 1.00m, 0.90GB read
Requests/sec: 112243.11
Transfer/sec:     15.31MB
~ took 1m 
❯ wrk -c8 -t8 -d60  http://localhost:4300/time
Running 1m test @ http://localhost:4300/time
  8 threads and 8 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    62.87us   37.68us   8.32ms   98.91%
    Req/Sec    15.88k   274.27    16.46k    84.59%
  7597597 requests in 1.00m, 695.58MB read
Requests/sec: 126417.81
Transfer/sec:     11.57MB
~ took 1m 
❯ 
Native on host
~ 
❯ wrk -c8 -t8 -d60  http://localhost:4200/time
Running 1m test @ http://localhost:4200/time
  8 threads and 8 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   158.28us  234.08us  16.64ms   98.04%
    Req/Sec     7.13k     1.27k    9.79k    54.36%
  3408243 requests in 1.00m, 0.87GB read
Requests/sec:  56709.17
Transfer/sec:     14.87MB
~ took 1m 
❯ wrk -c8 -t8 -d60  http://localhost:4100/time
Running 1m test @ http://localhost:4100/time
  8 threads and 8 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    42.81us  483.85us  55.51ms   99.94%
    Req/Sec    27.49k   678.37    29.27k    83.59%
  13154310 requests in 1.00m, 1.75GB read
Requests/sec: 218875.77
Transfer/sec:     29.85MB
~ took 1m 
❯ wrk -c8 -t8 -d60  http://localhost:4300/time
Running 1m test @ http://localhost:4300/time
  8 threads and 8 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    38.90us  394.14us  46.63ms   99.71%
    Req/Sec    33.28k     1.16k   36.65k    86.69%
  15918839 requests in 1.00m, 1.42GB read
Requests/sec: 264874.76
Transfer/sec:     24.25MB
~ took 1m 
❯ 
@dalisoft dalisoft added the bug Something isn't working label Jun 16, 2021
@dalisoft
Copy link
Member Author

As this is Docker issue, not nanoexpress, it's can be closed, but will be pinned

@dalisoft dalisoft pinned this issue Jul 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant