summaryrefslogtreecommitdiff
path: root/deps/node/benchmark/http/cluster.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/node/benchmark/http/cluster.js')
-rw-r--r--deps/node/benchmark/http/cluster.js41
1 files changed, 0 insertions, 41 deletions
diff --git a/deps/node/benchmark/http/cluster.js b/deps/node/benchmark/http/cluster.js
deleted file mode 100644
index 35d0ba98..00000000
--- a/deps/node/benchmark/http/cluster.js
+++ /dev/null
@@ -1,41 +0,0 @@
-'use strict';
-const common = require('../common.js');
-const PORT = common.PORT;
-
-const cluster = require('cluster');
-if (cluster.isMaster) {
- var bench = common.createBenchmark(main, {
- // unicode confuses ab on os x.
- type: ['bytes', 'buffer'],
- len: [4, 1024, 102400],
- c: [50, 500]
- });
-} else {
- const port = parseInt(process.env.PORT || PORT);
- require('../fixtures/simple-http-server.js').listen(port);
-}
-
-function main({ type, len, c }) {
- process.env.PORT = PORT;
- var workers = 0;
- const w1 = cluster.fork();
- const w2 = cluster.fork();
-
- cluster.on('listening', () => {
- workers++;
- if (workers < 2)
- return;
-
- setImmediate(() => {
- const path = `/${type}/${len}`;
-
- bench.http({
- path: path,
- connections: c
- }, () => {
- w1.destroy();
- w2.destroy();
- });
- });
- });
-}