Browse Source

updated sort order for nodejs mongodb raw test

Patrick Falls 12 years ago
parent
commit
06c7dc2eca
2 changed files with 13 additions and 8 deletions
  1. 9 2
      nodejs/benchmark_config
  2. 4 6
      nodejs/hello.js

+ 9 - 2
nodejs/benchmark_config

@@ -8,11 +8,18 @@
       "sort": 8
     },
     "mongodb": {
+      "setup_file": "setup",
+      "db_url": "/mongoose",
+      "query_url": "/mongoose?queries=",
+      "port": 8080,
+      "sort": 9
+    },
+    "mongodb-raw": {
       "setup_file": "setup",
       "db_url": "/mongodbdriver",
       "query_url": "/mongodbdriver?queries=",
       "port": 8080,
-      "sort": 9
+      "sort": 47
     },
     "mysql": {
       "setup_file": "setup",
@@ -29,4 +36,4 @@
       "sort": 28
     }
   }]
-}
+}

+ 4 - 6
nodejs/hello.js

@@ -1,8 +1,6 @@
 var cluster = require('cluster')
   , numCPUs = require('os').cpus().length;
 
-var host = "172.16.234.132"
-
 if(cluster.isMaster) {
   // Fork workers.
   for (var i = 0; i < numCPUs; i++) {
@@ -20,11 +18,11 @@ var http = require('http')
   , url = require('url')
   , async = require('async')
   , mongoose = require('mongoose')
-  , conn = mongoose.connect('mongodb://' + host + '/hello_world')
+  , conn = mongoose.connect('mongodb://localhost/hello_world')
   , MongoClient = require('mongodb').MongoClient
   , mysql = require('mysql')
   , pool  = mysql.createPool({
-      host: host,
+      host: 'localhost',
       user     : 'benchmarkdbuser',
       password : 'benchmarkdbpass',
       database : 'hello_world',
@@ -32,7 +30,7 @@ var http = require('http')
     })
   , Sequelize = require("sequelize")
   , sequelize = new Sequelize('hello_world', 'benchmarkdbuser', 'benchmarkdbpass', {
-    host: host,
+    host: 'localhost',
     logging: false,
     define: { timestamps: false },
     maxConcurrentQueries: 100,
@@ -46,7 +44,7 @@ var http = require('http')
 
 var collection = null;
 
-MongoClient.connect('mongodb://' + host + '/hello_world?maxPoolSize=5', function(err, db) {
+MongoClient.connect('mongodb://localhost/hello_world?maxPoolSize=5', function(err, db) {
   collection = db.collection('world');
 });