Skip to content

Instantly share code, notes, and snippets.

@aedm
Created January 19, 2016 10:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aedm/3a854242b785cd628bc7 to your computer and use it in GitHub Desktop.
Save aedm/3a854242b785cd628bc7 to your computer and use it in GitHub Desktop.
"use strict";
let server = "http://localhost:3000/";
let parallelCount = 500;
let http = require("http");
http.globalAgent.maxSockets = parallelCount;
var queryCount = 0;
function f(i) {
http.get(server, function(r) {
r.resume();
queryCount++;
f(i);
});
}
for (let i=0; i<parallelCount; i++) f(i);
setInterval(function() {
console.log("--------------------------------- queries: " + queryCount);
queryCount = 0;
}, 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment