2014년 10월 21일 화요일

node.js server cluster test


Node.js Server Cluster test Benchmark using AB(Apache Banchmark)

server code(no cluster)
var http = require("http");

http.createServer(function(request, response) {
    var s = 64*1024;
  var buf = new Buffer(s);
  for(var i=0;i<buf.length;i++){
    buf[i]=100;
  }
    //console.log("Request for:  " + request.url);
    response.writeHead(200);
    response.end(buf);
  }).listen(3000);
output
==========================================

==========================================

ab result

Server Software:
Server Hostname:localhost
Server Port:3000
Document Path:/
Document Length:65536 bytes
Concurrency Level:200
Time taken for tests:17.481 seconds
Complete requests:10000
Failed requests:0
Total transferred:656110000 bytes
HTML transferred:655360000 bytes
Requests per second:572058.72
Transfer rate:37533344.59 kb/s received
Connnection Times (ms)
min avg max
Connect:0015
Processing:40346826
Total:40346841


server code(cluster)
var cluster = require("cluster");
var http = require("http");
var numCPUs = require("os").cpus().length;

if (cluster.isMaster) {
  for (var i = 0; i < numCPUs; i++) {
    cluster.fork();
  }
} else {
  var s = 64*1024;
  var buf = new Buffer(s);
  for(var i=0;i<buf.length;i++){
    buf[i]=100;
  }
  http.createServer(function(request, response) {
    //console.log("Request for:  " + request.url);
    response.writeHead(200);
    response.end(buf);
  }).listen(3000);
}

output
======================================

======================================

ab result

Server Software:
Server Hostname:localhost
Server Port:3000
Document Path:/
Document Length:65536 bytes
Concurrency Level:200
Time taken for tests:19.403 seconds
Complete requests:10000
Failed requests:0
Total transferred:656110000 bytes
HTML transferred:655360000 bytes
Requests per second:515385.73
Transfer rate:33814973.33 kb/s received
Connnection Times (ms)
min avg max
Connect:0013
Processing:70385809
Total:70385822






댓글 없음:

댓글 쓰기

JIRA Plugin - ScriptRunner 소개 #2

관련 글 소개 #1:  https://pineoc.blogspot.com/2019/03/scriptrunner-1.html ScriptRunner 소개 #2 지난 글에서는 Behaviours를 보았고 다음 내용인 콘솔, 리스너 등을 ...