Skip to content

mgartner/node-keep-alive-benchmark

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-keep-alive-benchmark

This repository contains benchmarks to compare the performance of outbound HTTP requests with non-reused connections (Node's default behavior) versus reusing connections with HTTP Keep-Alive.

Requirement

Node.js version v10+

Install Depedencies

yarn

Run Benchmarks

First set the TARGET, COUNT, and COUNCURRENCY variables in keep-alive-off.js and keep-alive-on.js.

Then, run the benchmarks.

node keep-alive-off.js
node keep-alive-on.js

Generating a Flamegraph

To profile CPU utilization and generate a flamegraph (introduction to flamegraphs), first generate a v8.log, then run it through the flamebearer tool.

Install flamebearer

yarn global add flamebearer

Generate a v8.log

node --prof --trace-ic --track_gc_object_stats --trace_gc_verbose --log_timer_events keep-alive-off.js

Generate a flamegraph

node --prof-process --preprocess -j isolate*.log | flamebearer

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published