Return-Path: X-Original-To: apmail-couchdb-dev-archive@www.apache.org Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 820A09018 for ; Fri, 11 May 2012 19:58:18 +0000 (UTC) Received: (qmail 26259 invoked by uid 500); 11 May 2012 19:58:18 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 26207 invoked by uid 500); 11 May 2012 19:58:18 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 26197 invoked by uid 99); 11 May 2012 19:58:17 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 May 2012 19:58:17 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [209.85.161.180] (HELO mail-gg0-f180.google.com) (209.85.161.180) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 May 2012 19:58:08 +0000 Received: by ggnf1 with SMTP id f1so2014555ggn.11 for ; Fri, 11 May 2012 12:57:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-originating-ip:in-reply-to:references:from:date :message-id:subject:to:content-type:x-gm-message-state; bh=U4gk7kcaJYwAil7/gFPNdJeXgDgfMaY7j867n6fCfuk=; b=agk4YMjae1z8Xg7ij9ZoCL1ElY7SnM5tSALqME6Xb6rU7AA9OK8ip5MGKcj83sKSD7 I4TJhjirbHU2dG4T5b2cCDL2V6W5/AlpGYLC59Y0X829ksroO7Rl24Ozgk3zxLIBE5la iyPHJ7+ggXjhS7LAoTE3o24jU6pAn7udSh4IFjCsZOvglzOm5mtbu5jMMDYFhdSimqh2 TALPSni64XtiIqsHk/SWIZHv/qX/STo82FZOujqHa4kmKuCcDg4epbf+f3PYI6ZdZ7Pl INo/A+yOgCHrhRup47dkK3MZRqtzlPEfmcvA0Ec0hkMNaDIylqGy2hHbAfneXqX9uOJq wkXA== Received: by 10.60.154.232 with SMTP id vr8mr1776474oeb.49.1336766266336; Fri, 11 May 2012 12:57:46 -0700 (PDT) MIME-Version: 1.0 Received: by 10.60.16.37 with HTTP; Fri, 11 May 2012 12:57:26 -0700 (PDT) X-Originating-IP: [188.82.193.216] In-Reply-To: References: From: Marco Monteiro Date: Fri, 11 May 2012 20:57:26 +0100 Message-ID: Subject: Re: CouchDB freezes To: dev@couchdb.apache.org Content-Type: multipart/alternative; boundary=bcaec55245ec73e7f004bfc826c4 X-Gm-Message-State: ALoCoQnZrz0r71zaXxR4vjO3BlheixW3ifWQN58bIPon3KUYWPxw1i6i2kvIlCW8r6rz0RJWDstH --bcaec55245ec73e7f004bfc826c4 Content-Type: text/plain; charset=ISO-8859-1 Thanks, Robert. The script worked as expected. The problem is that the I'm running out of tcp ports. I'm passing "Connection: keep-alive" but nodejs is ignoring that, I think. Anyone knows how I can work around that problem? Thanks, Marco On 11 May 2012 16:12, Robert Newson wrote: > Try this, I'm getting about 420 rps on my Air; > > #!/usr/bin/env node > var nl = require('nodeload'); > > function newID () { > return Date.now() + "-" + guid(); > } > > function guid() { > return (S4()+S4()+S4()+S4()); > function S4 () { > return (((1+Math.random())*0x10000)|0).toString(16).substring(1); > }; > }; > > var loadtest = nl.run({ > name: "Insert Test", > host: 'localhost', > port: 5984, > timeLimit: 60, > targetRps: 500, > stats: ['latency', 'result-codes', 'concurrency', > {name: 'http-errors',successCodes: [201],log: > 'http-errors.log'}], > requestGenerator: function(client) { > var newId = newID(); > var id = guid(); > var body = JSON.stringify({ > _id: newId, > sid: id, > pid: id, > time: Date.now(), > ua: "test", > ua_str: > > "asdkcasjkdnckasdlcasndlcknasdlkcasldcnaklsdnclasjkdnclaksdnclkansdcjklasndlckjandc", > > type: "adlkfmaasdcslkdmf", > > data: { str: > > "asdkcasjkdnckasdlcasndlcknasdlkcasldcnaklsdnclasjkdnclaksdnclkansdcjklasndlckjandc" > }, > page: "maisumastring", > uid: id, > > ip: "127.0.0.1", > > id: id, > > page_type: "asdfklandklafnsldkfn", > referrer: > > "asdkcasjkdnckasdlcasndlcknasdlkcasldcnaklsdnclasjkdnclaksdnclkansdcjklasndlckjandc", > width: 1000, > height: 1000 > }) > > var headers = { > 'Content-Type': 'application/json', > 'Content-Length': body.length > ,'Connection':'keep-alive' > }; > var db = '/db1'; > var post = client.request('POST', db, headers); > post.write(body); > return post; > } > }); > loadtest.on('end', function() { console.log('Load test done.'); }); > --bcaec55245ec73e7f004bfc826c4--