EzDev.org

tsung

tsung - Tsung is a high-performance benchmark framework for various protocols including HTTP, XMPP, LDAP, etc. Tsung - High Performance Benchmarking Framework - ProcessOne tsung is a high-performance benchmarking framework


Sending json with tsung POST request

I'm trying to create a POST request with Tsung

<request> 
  <http url="api.whatever.com" method="POST" version="1.1" contents=""></http>
</request>

How can I send a JSON document in the contents attribute?

contents='{"name": "alex"}' 

is of course invalid...

Is there a way I can send JSON with my POST request?


Source: (StackOverflow)

Failed TCP accept: emfile

I got this error after reaching Current request rate: 11.12 req/sec Current users: 1184 Current connected users: 990 Current phase: 1 ejabberd tsung testing after that i google it some of them suggested to increase the /proc/sys/fs/file-max ulimit -n 100000 there after also i space the same problem is there any solution for this.


Source: (StackOverflow)

Testing a websocket server with tsung

I start to use tsung to test my server with socket.io.

I downloaded the Github Zip, compiled and installed the latest "dev" including Websockets compatibility.

After browsing a lot of Google results and message in this mailing list, I couldn't find any answer to my issue. My problem is that I can't send/receive a message to my socket.io server. I'm able to connect to my socket with handshaking OK but nothing happens when I send the message. I tried to use bidir=true attribute but nothing change.

In my tsung log, I've got this messages:

=INFO REPORT==== 5-Sep-2013::08:08:00 ===

ts_client:(7:<0.93.0>) connect to port 80

=INFO REPORT==== 5-Sep-2013::08:08:00 ===

ts_client:(3:<0.93.0>) Data receive from socket in state think, stop

In my socket log (server side), I've got this messages:

  • debug: client authorized for

  • info: transport end (undefined)

  • debug: cleared heartbeat interval for client b07GKwmOJPQVDwznBzN1

  • debug: discarding transport

You can find my tsung.xml file here: http://pastebin.com/A60PpKrL

Please help,

Kind Regards,

Arnaud


Source: (StackOverflow)

tsung_stats.pl on Mac OS X Mavericks run into "Can't locate Template.pm" error

I'm trying to run tsung_stats.pl from tsung (installed through brew) on Mac OS X 10.9 and got error:

Can't locate Template.pm in @INC (@INC contains: /Library/Perl/5.16/darwin-thread-multi-2level /Library/Perl/5.16 /Network/Library/Perl/5.16/darwin-thread-multi-2level /Network/Library/Perl/5.16 /Library/Perl/Updates/5.16.2 /System/Library/Perl/5.16/darwin-thread-multi-2level /System/Library/Perl/5.16 /System/Library/Perl/Extras/5.16/darwin-thread-multi-2level /System/Library/Perl/Extras/5.16 .) at tsung_stats.pl line 564

I searched and it seems I have to install perl templates, so I ran "sudo cpan Template" and yet still get the same error.

cpan and perl are all in /usr/bin/. Tsung is in /usr/local/Cellar/tsung/1.5.0/bin/tsung

Versions are: perl: perl 5, version 16, subversion 2 (v5.16.2) cpan: 1.57 tsung: 1.5.0

I searched my system and found no file name Template.pm. The closest I found was two TextTemplate.pm files in

/System/Library/Perl/Extras/5.16/Locale/Maketext/Extract/Plugin/
/System/Library/Perl/Extras/5.12/Locale/Maketext/Extract/Plugin/

The following code snippet in question starts from line 563:

sub html_report {
    require Template;
    my $titre     = 'Tsung ';
    my $version   = $tagvsn;
    my $contact   = 'tsung-users@process-one.net';
    my $output   = 'index.html';

    my $tt = Template->new({
                            INCLUDE_PATH => $template_dir,
                            PRE_CHOMP    => 1,
                            INTERPOLATE  => 1,
                           }) or die "Template error " . Template->error();
    my $xml_conf;
    opendir (DIR, ".") or warn "can't open directory .";
    while (my $file = readdir (DIR) ) {
        if ($file =~ /.xml$/) {
            $xml_conf= $file;
        }
    }
    foreach my $type ("mean", "maxmean", "minmean") {
        foreach my $data (keys % {$maxval->{$type}} ) {
            next if ($data =~ m/^size/);
            if ($data =~ m/os_mon/) {
                $maxval->{$type}->{$data} = sprintf "%.2f",$maxval->{$type}->{$data};
                next;
            }
            next if not ($data eq "session" or $data eq "connect" or $data eq "request" or $data eq "page" or $data =~ m/^tr_/);
            $maxval->{$type}->{$data} = &formattime($maxval->{$type}->{$data});
        }
    }
    foreach my $size ("size_rcv", "size_sent") {
        if ($maxval->{rate}->{$size}) {
            $maxval->{rate}->{$size} = &formatsize($maxval->{rate}->{$size}*8,"bits");
            $maxval->{maxmean}->{$size} = &formatsize($maxval->{maxmean}->{$size},"B");
        } else {
            warn "$size is equal to 0 !\n";
        }
    }

    my $vars =
        {
         version     => $version,
         os_mon      => $extra,
         errors      => $errors,
         title       => $titre,
         subtitle    => "Stats Report",
         http        => $http,
         stats_subtitle => "Stats Report ",
         graph_subtitle => "Graphs Report ",
         contact     => $contact,
         data        => $maxval,
         cat_data    => $category,
         conf        => $xml_conf
        };
    $tt->process("report.thtml", $vars, "report.html") or die $tt->error(), "\n";
    $vars =
        {
         version     => $version,
         os_mon      => $extra,
         errors      => $errors,
         http        => $http,
         match       => $match,
         async       => $async,
         bosh       => $bosh,
         title       => $titre,
         subtitle    => "Graphs Report",
         stats_subtitle => "Stats Report ",
         graph_subtitle => "Graphs Report ",
         os_mon_other=> $os_mon_other,
         contact     => $contact,
         conf        => $xml_conf,
         ext         => $imgfmt
        };
  if (not $dygraph) {
    $tt->process("graph.thtml", $vars, "graph.html") or die $tt->error(), "\n";
  } else {
    $tt->process("graph_dy.thtml", $vars, "graph.html") or die $tt->error(), "\n";
    copy (($template_dir . "/dygraph-combined.js"), ".") or die "copy failed : $!";
  }
}

I believe $template_dir is in this piece of code (start from line 71):

my $prefix ="/usr/local/Cellar/tsung/1.5.0";

unless ($template_dir) {
    if (-d (dirname($0) . "/templates/")) {
        $template_dir = dirname($0)."/templates/";
    } elsif (-d "$ENV{HOME}/.tsung/templates/") {
        $template_dir = "$ENV{HOME}/.tsung/templates/";
    } elsif (-d "${prefix}/share/tsung/templates") {
        $template_dir = "${prefix}/share/tsung/templates";
    } elsif (-d "/usr/share/tsung/templates") {
        $template_dir = "/usr/share/tsung/templates";
    } elsif (-d "/usr/local/share/tsung/templates") {
        $template_dir = "/usr/local/share/tsung/templates";
    } else {
        warn "Can't find template directory !";
    }
}

I checked those locations and found some .pm files, but none were Template.pm.

Any help would be appreciated.


Source: (StackOverflow)

Can anyone post an example of how to enable SSL in Tsung?

I'm load testing a CouchDB server from another machine using Tsung, and need to establish a secure connection. Unfortunately, I've not been able to find an example of the syntax in the documentation or online...

Any help would be greatly appreciated!


Source: (StackOverflow)

Launching a web server inside ruby tests

I'm writing a library to wrap tsung's functionality in a way that can be better used by rails applications. I want to write some integration tests that boil down to the following:

  1. launch a simple web server
  2. run tsung-recorder via the library
  3. launch selenium, with a firefox profile configured to use the tsung proxy, and have this fetch a page from the server launched in step 1
  4. examine the recorded library (it exists, it's in the correct location, etc.)

For step 1, while I could launch a vanilla rails app externally (e.g., %x{rails s} ), I'm pretty sure there's a better way to programmatically create a simple web server suitable for testing.

tl;dr - What's a way to programmatically launch a simple web server inside a test?


Source: (StackOverflow)

Tsung. contents_from_file attribute with variable value

I've got a problem using tsung:

I've got several files in one dir wich I have to send to the server. I create file with list of this files (fullpath) and add an option to tsung config:

 <option name="file_server" id="xml_files" value="/home/ubuntu/.tsung/files"></option>

My goal is to pick a random filepath from this file and send to the server. To do so I wrote this part of config:

  <setdynvars sourcetype="file" fileid="xml_files" delimiter=";"
order="random">
       <var name="file_name" />
     </setdynvars>

     <request subst="true">
           <http url="/" version="1.1" method="POST"
contents_from_file="%%_file_name%%"></http>
     </request>

But this do not work. When I set attr contents_from_file as constant everything works fine. Is there any way to do this with variable?


Source: (StackOverflow)

Simulating online user in eJabberd with Tsung

I'm testing eJabberd server with Tsung on local computer. This is my config file. Everything is working and running correctly.

<?xml version="1.0"?>
<!DOCTYPE tsung SYSTEM "/usr/local/share/tsung/tsung-1.0.dtd">
<tsung loglevel="notice" dumptraffic="false" version="1.0">
  <clients>
    <client host="localhost" maxusers="28000" use_controller_vm="true">
    </client>
  </clients>

<servers>
   <server host='127.0.0.1' port='5222' type='tcp'/>
</servers>

<monitoring>
          <monitor host="localhost" type="erlang"/>
  </monitoring>

<!-- register 15000 users in less than 15 minutes  -->
<load>
  <arrivalphase phase="1" duration="5" unit="minute">
    <users maxnumber="15000" interarrival="0.0025" unit="second"></users>
  </arrivalphase>
  </load>

<options>
  <option type="ts_jabber" name="global_number" value="15000"></option>
  <option type="ts_jabber" name="userid_max" value="15000"></option>
  <option type="ts_jabber" name="domain" value="localhost"></option>
  <option type="ts_jabber" name="username" value="test"></option>
  <option type="ts_jabber" name="passwd" value="password"></option>
</options>

<sessions>
  <session probability="100" name="jabber-example" type="ts_jabber">

       <request> <jabber type="connect" ack="global"></jabber> </request>

    <thinktime value="2"></thinktime>

    <transaction name="authenticate">
      <request> <jabber type="auth_get" ack="global"></jabber> </request>
      <request> <jabber type="auth_set_plain" ack="global"></jabber> </request>
    </transaction>

    <thinktime value="10"></thinktime>

    <request> <jabber type="presence:initial" ack="no_ack"/> </request>

    <thinktime value="30"></thinktime>

    <transaction name="online">
      <request> <jabber type="chat" ack="global" size="16" destination="online"/></request>
    </transaction>

    <thinktime value="30"></thinktime>

    <transaction name="close">
      <request> <jabber type="close" ack="local"> </jabber></request>
    </transaction>

  </session>
</sessions>
</tsung>

Results:

Here you can see that there are simultaneous users and connections. However, when i look in my ejabberd console, there is absolutely no online has been connected. enter image description here enter image description here


Source: (StackOverflow)

tsung websocket testing garble message

I am trying to load test a websocket server. Server accepts and sends application/json and interactions seems to be rather fine.

Server accepts correctly messages sent from client (tsung). Unfortunately from the client perspective it can't read responses and I think might be related to the fact messages are garble at least looking at tsung.dump I see ASCII characters like NUL, SOH, SI, etc but I also see json responses from the server somehow ok.


This is my tsung.xml file snippet:

<?xml version="1.0"?>
<!DOCTYPE tsung SYSTEM "/usr/local/Cellar/tsung/1.5.0/share/tsung/tsung-1.0.dtd">
<tsung loglevel="debug" dumptraffic="true">
  <clients>
    <client host="localhost" use_controller_vm="true" maxusers="1000" />
  </clients>

  <servers>
    <server host="127.0.0.1" port="8282" type="tcp" />
  </servers>

  <load>
    <arrivalphase phase="1" duration="120" unit="second">
      <users maxnumber="1" arrivalrate="1" unit="second" />
    </arrivalphase>
  </load>

  <sessions>
    <session name="websocket" probability="100" type="ts_websocket">
        <request subst="true">
             <websocket type="connect" path="/fancyurl?Content-Type=application/json"></websocket>
        </request>
        <transaction name="getsession">
          <request subst="true">
            <dyn_variable name="sessionid" jsonpath="session"/>
            <websocket type="message">{"type": "EventMessageCmd", "user": "lnramirez", "eventCode" : "epfl"}
            </websocket>
          </request>
        </transaction>
        <thinktime value="10"/>
        <request>
          <dyn_variable name="boothAck" jsonpath="commandStatus" />
          <websocket type="message">
          {
            "user": "lramirezmonterosa",
            "eventCode": "epfl",
            "type": "BoothMessageCmd",
            "boothCode": "ic",
            "commandStatus": "REQUESTED",
            "boothRequest": "JOIN"
          }
          </websocket>
        </request>
        <request>
            <websocket type="close"></websocket>
        </request>
    </session>
  </sessions>
</tsung>

tsung.dump:

Send:1390970727.56257:<0.84.0>:‚ìÝju¦`U_ýJU_ýJU_ýJU_ÿ¸HO_ÿ/³8®¸)ÿFU]¨
ÿPU]±´°¸¼HY_ÿ³6¹W_çJW­]×JU_ýJU_ýJU_ýJU
Recv:1390970727.588689<0.84.0>:~{"type":"HeartBeatMessageCmd","timeCmdBroadcasted":1390970727588,"timeCmdGenerated":1390970727588,"commandStatus":"REQUESTED","user":"lramirezmonterosa","eventCode":"epfl","uuid":"a91e2c1b-859d-4299-99fd-e7ba63ba1f42","userSession":"25bb5627-4eb3-4a23-a1c9-edd5b8231808"}`

Source: (StackOverflow)

How to write xml scripts for load testing "XMPP over BOSH" using Tsung?

I have to perform a comparison of "simple XMPP" with "XMPP over BOSH" for our mobile client(chat based). I want to use same tool to compare both. I searched on internet and found a tool called tsung which supports both HTTP and XMPP. I have setup and able to run tsung for XMPP with given example scripts.

Now the problem is that I am unable to write Tsung xml scripts for "XMPP over BOSH". I tried searching on internet but couldn't find any.

Can somebody please guide me in setting up Tsung for "XMPP over BOSH"?

Please let me know if there exist a tool other than Tsung which can serve my purpose.


Source: (StackOverflow)

Ejabberd limits online users count at 64,464. Descriptors already increased

I am being restricted to bring more than roughly 64000 (64,464 precisely) users online on an Ejabberd node. I am using xml script (Tsung) to bring the users online on the node.

I have raised the limit of descriptors already:

Eshell V5.10.4  (abort with ^G)
1> os:cmd("ulimit -n").
"1045000\n"

One weird observation is this (expect available port count as integer value here):

2> os:getenv("ERL_MAX_PORTS").
false

Besides, the "ERL_MAX_PORTS" in the ejabberdctl.cfg file is set to 704500.

ERL_MAX_PORTS=704500

I guess One Ejabberd node has some limit for maximum users to be online. This could be memory dependent on the machine or something.

Additonally, this is how the /etc/security/limits.conf looks:

#*               soft    core            0
#*               hard    rss             10000
#@student        hard    nproc           20
#@faculty        soft    nproc           20
#@faculty        hard    nproc           50   
#ftp             hard    nproc           0
#@student        -       maxlogins       4
root             soft    nofile          1045000
root             hard    nofile          1045000

I can give a try by creating another Virtual host runing on the same Linux machine as:

hosts:
  - "devlab"
  - "devlab2"

But i am not sure how this would be any different.

Pointers would be appreciated.

Thanks!


Source: (StackOverflow)

Tsung load test from mac os x

I am trying to fire off a Tsung request from my Mac OS X machine and i'm not having much luck.

I have edited the ~/.tsung/tsung.xml config file and even tried changing the location of that file on several occasions with the -f parameter.

When I run tsung start it returns this output

dave:/Applications/MAMP/htdocs/barebonessite/wp-content/themes/barebones $ tsung -f      ~/.tsung/tsung.xml -l . start
Starting Tsung
"Log directory is: /Applications/MAMP/htdocs/barebonessite/wp-   content/themes/barebones/./20130503-1325"
Config Error, aborting ! {{case_clause,{error,enoent}},
                      [{xmerl_scan,fetch_DTD,2,
                           [{file,"xmerl_scan.erl"},{line,1283}]},
                       {xmerl_scan,scan_doctype2,3,
                           [{file,"xmerl_scan.erl"},{line,1227}]},
                       {xmerl_scan,scan_prolog,4,
                           [{file,"xmerl_scan.erl"},{line,722}]},
                       {xmerl_scan,scan_document,2,
                           [{file,"xmerl_scan.erl"},{line,563}]},
                       {xmerl_scan,file,2,
                           [{file,"xmerl_scan.erl"},{line,249}]},
                       {ts_config,read,2,
                           [{file,"src/tsung_controller/ts_config.erl"},
                            {line,68}]},
                       {ts_config_server,handle_call,3,
                           [{file,
                                "src/tsung_controller/ts_config_server.erl"},
                            {line,198}]},
                       {gen_server,handle_msg,5,
                           [{file,"gen_server.erl"},{line,588}]}]}

My config file looks like this:

<?xml version="1.0"?>
<!DOCTYPE tsung SYSTEM "/usr/share/tsung/tsung-1.0.dtd">
<tsung loglevel="notice" version="1.0">

  <clients>
    <client host='localhost' use_controller_vm='true'/>
  </clients>    

<servers>
    <server host="54.225.212.193" port="80" type="tcp"></server
</servers>

<load>
    <arrivalphase phase="1" duration="10" unit="minute">
        <users maxnumber="650" arrivalrate="8" unit="second"/>
    </arrivalphase>
</load>

<sessions>
    <session probability="100" name="ab" type="ts_http">
        <for from="1" to="20" var="i">
            <request> <http url="/" method="GET" version="1.1"/>   </request>
        </for>
    </session>
</sessions>
</tsung>

Being new to Tsung I cannot work out the problem here and the error reporting is pretty low level stuff and makes little sense.


Source: (StackOverflow)

Tsung: Using iterator in loop

I'm trying to create load testing scenario for ejabberd with tsung.

I want simulate thousands of XMPP events from thousands clients. According tsung's manual I can create repeated actions using for loop:

<for from="1" to="10" incr="1" var="counter">
  [...]
  <request> <http url="/page?id=%%_counter%%"></http> </request>
  [...]
</for>

But this example don't working for me:

alex@alex:~/.tsung$ tsung -f jabber.xml start
Starting Tsung
"Log directory is: /home/alex/.tsung/log/20130417-1404"
3306- fatal: {error,{validity_constraint_Name_Token,37}}
Config Error, aborting ! {fatal,{{error,{validity_constraint_Name_Token,37}},
                                 {file,"jabber.xml"},
                                 {line,10},
                                 {col,29}}}

Full config file:

<?xml version="1.0"?>
<!DOCTYPE tsung SYSTEM "/usr/share/tsung/tsung-1.0.dtd">
<tsung loglevel="notice" version="1.5">
    <clients>
        <client host="localhost" use_controller_vm="true"></client>
    </clients>
    <!-- Server side setup -->
    <servers>
        <for from="1" to="1000" incr="1" var="counter">
            <server host="t%%_counter%%.testserver.org" port="5222" type="tcp"></server>
        </for>
    </servers>
    <load>
        <arrivalphase phase="1" duration="1" unit="minute">
            <users interarrival="2" unit="second"></users>
        </arrivalphase>
    </load>
    <!-- JABBER parameters -->
    <!-- to synchronise users,  use a global acknoledgement -->
    <options>
        <option type="ts_jabber" name="global_number" value="100"></option>
        <option type="ts_jabber" name="userid_max" value="10000"></option>
        <option type="ts_jabber" name="domain" value="mydomain.org"></option>
        <option type="ts_jabber" name="username" value="user"></option>
        <option type="ts_jabber" name="passwd" value="pass"></option>
    </options>
    <sessions>
        <session probability="100" name="jabber-loadtest" type="ts_jabber">
            <request><jabber type="presence:broadcast" show="online" status="Status: online" ack="no_ack"/></request>
            <thinktime value="1"></thinktime>
            <request><jabber type="presence:broadcast" show="offline" status="Status: offline" ack="no_ack"/></request>
        </session>
    </sessions>
</tsung>

How can I use loops in tsung configuration file?


Source: (StackOverflow)

Erlang: Cannot start slave - {error,timeout}

I'm currently trying to set up a distributed Tsung load testing environment which uses the Erlang slave functionality, however I have been unsuccessful in getting the controller node to start a slave node. E.g.

(musicglue@load1)1> net:ping(musicglue@load2).
pong
(musicglue@load1)2> slave:start(load2,musicglue,"-setcookie tom").
{error,timeout}

BACKGROUND

My env:

Controller - hostname: load1, user: musicglue, Ubuntu 10.04 LTS, Erlang R15B01 compiled from source Slave - hostname: load2, user: musicglue, Ubuntu 10.04 LTS, Erlang R15B01 complied from source Firewall disabled SELinux not installed

Things that are working:

  • I can SSH from load1 onto load2 and vice versa
  • I can start an erl sessions on load1 and load2
  • I can start an erl session on load2 from load1; ssh load2 erl
  • I can successfully ping load2 from load1 from an erl session using the same cookie on both nodes.

Ping output:

musicglue@load1:~$ erl -rsh ssh -sname musicglue -setcookie tom
Erlang R15B01 (erts-5.9.1) [source] [64-bit] [smp:4:4] [async-threads:
0] [hipe] [kernel-poll:false]
Eshell V5.9.1  (abort with ^G)
(musicglue@load1)1> net:ping(musicglue@load2).
pong

THE ISSUE

My problem occurs when attempting to start a slave session from load1 on load2:

musicglue@load1:~$ erl -rsh ssh -sname musicglue -setcookie tom
Erlang R15B01 (erts-5.9.1) [source] [64-bit] [smp:4:4] [async-threads:
0] [hipe] [kernel-poll:false]

Eshell V5.9.1  (abort with ^G)
(musicglue@load1)1> net:ping(musicglue@load2).
pong
(musicglue@load1)2> slave:start(load2,musicglue,"-setcookie
tom").
{error,timeout}

Here is the output I get from epmd when I run the slave:start command:

epmd: Thu May 24 10:01:57 2012: Non-local peer connected
epmd: Thu May 24 10:01:57 2012: opening connection on file descriptor
4
epmd: Thu May 24 10:01:57 2012: got 12 bytes
***** 00000000  00 0a 7a 6d 75 73 69 63 67 6c 75 65
|..zmusicglue|
epmd: Thu May 24 10:01:57 2012: ** got PORT2_REQ
epmd: Thu May 24 10:01:57 2012: got 2 bytes
***** 00000000  77 01                                             |w.|
epmd: Thu May 24 10:01:57 2012: ** sent PORT2_RESP (error) for
"musicglue"
epmd: Thu May 24 10:01:57 2012: closing connection on file descriptor
4
epmd: Thu May 24 10:01:57 2012: Local peer connected
epmd: Thu May 24 10:01:57 2012: opening connection on file descriptor
4
epmd: Thu May 24 10:01:57 2012: got 24 bytes
***** 00000000  00 16 78 ca d6 4d 00 00  05 00 05 00 09 6d 75 73
|..x..M.......mus|
***** 00000010  69 63 67 6c 75 65 00 00                           |
icglue..|
epmd: Thu May 24 10:01:57 2012: ** got ALIVE2_REQ
epmd: Thu May 24 10:01:57 2012: registering 'musicglue:1', port 51926
epmd: Thu May 24 10:01:57 2012: type 77 proto 0 highvsn 5 lowvsn 5
epmd: Thu May 24 10:01:57 2012: got 4 bytes
***** 00000000  79 00 00 01                                       |
y...|
epmd: Thu May 24 10:01:57 2012: ** sent ALIVE2_RESP for "musicglue"
epmd: Thu May 24 10:01:57 2012: unregistering 'musicglue:1', port
51926
epmd: Thu May 24 10:01:57 2012: closing connection on file descriptor
4

Any help or suggestions anyone has would be much appreciated,

Many thanks

EDIT

I should also mention that I can see the ssh connection being successfully acknowledged by load2 but then immediately disconnecting:

May 30 13:49:27 load2 sshd[16169]: Accepted publickey for musicglue from 173.45.236.182 port 51843 ssh2
May 30 13:49:27 load2 sshd[16171]: Received disconnect from 173.45.236.182: 11: disconnected by user

In response to below comments I have also tried to start the slave using different node names for the slave:

musicglue@load1:~$ erl -rsh ssh -sname musicglue -setcookie tom
Erlang R15B01 (erts-5.9.1) [source] [64-bit] [smp:4:4] [async-threads:0] [hipe] [kernel-poll:false]

Eshell V5.9.1  (abort with ^G)
(musicglue@load1)1> slave:start(load2,bar,"-setcookie tom").
{error,timeout}

and for the controller:

musicglue@load1:~$ erl -rsh ssh -sname foo -setcookie tom
Erlang R15B01 (erts-5.9.1) [source] [64-bit] [smp:4:4] [async-threads:0] [hipe] [kernel-poll:false]

Eshell V5.9.1  (abort with ^G)
(foo@load1)1> slave:start(load2,musicglue,"-setcookie tom").
{error,timeout}

and for both:

musicglue@load1:~$ erl -rsh ssh -sname foo -setcookie tom
Erlang R15B01 (erts-5.9.1) [source] [64-bit] [smp:4:4] [async-threads:0] [hipe] [kernel-poll:false]

Eshell V5.9.1  (abort with ^G)
(foo@load1)1> slave:start(load2,bar,"-setcookie tom").
{error,timeout}

But to no avail

SOLUTION

Turns out that my problem was that my slave was unable to SSH onto the controller and therefore could not respond to any commands.

After fixing this port of communication between the two nodes everyone worked perfectly.


Source: (StackOverflow)

Tokumx VS mongodb read performance

I was doing a read performance stress testing by comparing Tokumx and pure Mongodb.

Both tokumx and mongodb were running in the same machine.

Hardware Overview:

Model Name: Mac mini
Model Identifier: Macmini6,1
Processor Name: Intel Core i5
Processor Speed: 2.5 GHz
Number of Processors: 1
Total Number of Cores: 2
L2 Cache (per Core): 256 KB
L3 Cache: 3 MB
Memory: 10 GB

There are only one collection in each instance. There are 100,000 entries in each collection.

For tokumx, it was created as partitioned collection. But for mongodb, it was created as a normal collection:

db.createCollection("sample", {partitioned: true, primaryKey:  {field1:1, _id: 1}});

And for both instance the index looks like following:

db.sample.ensureIndex({field1:1});
db.sample.ensureIndex({field2:1});
db.sample.ensureIndex({field3:1});
db.sample.ensureIndex({field4:1});
db.sample.ensureIndex({geo:"2d"});
db.sample.ensureIndex({"created_at":1});

I was using Tsung to do the stress testing. In test plan, I did a simple search by looking field2 and geo fields order by created_at desc.

<clients>
<client host="localhost" use_controller_vm="false" maxusers="8000"/>
</clients>
<servers>
<server host="jchimac.thenetcircle.lab" port="8080" type="tcp"/>
</servers>
<load duration="5" unit="minute">
<arrivalphase phase="1" duration="5" unit="minute">
<users interarrival="0.03" unit="second"/>
</arrivalphase>
</load>

According to official document, the transaction should be like TOKUMX™ BENCHMARK VS. MONGODB – HDD

enter image description here

But in my testing:

TOKUMX:

enter image description here

enter image description here

MongoDB:

enter image description here

enter image description here

I am asking here to know is anyone can give any hint about this? Did I miss something in the whole testing?


Updates:

I did another round testing on Linux(CentOS) machine:

CentOS release 6.5 (Final)
2.6.32-504.1.3.el6.x86_64 GNU/Linux
MemTotal:       24589896 kB
CPU: 12* (Intel(R) Xeon(R) CPU E5645  @ 2.40GHz)

Sample Data looks like:

{
  "_id": ObjectId("54867dc8ffbc15aa2bc3ee0e"),
  "_iid": 15,
  "_pid": 15,
  "uid": 102296,
  "nickname": "nickname_102296",
  "gender": 3,
  "image_id": 15,
  "created_at": 1418100168,
  "tag": 1,
  "geo": {
    "lat": 51.590449999999997033,
    "lon": 6.9671900000000004383
  }
}

Each collection has 1,000,000 entries.

Indices on each collection(Normal collections are created):

db.createCollection("coll", {primaryKey:  {_pid:1, _id: 1}});
db.tokumx_coll.ensureIndex({gender:1}); 
db.tokumx_coll.ensureIndex({uid:1}); 
db.tokumx_coll.ensureIndex({geo:"2d"}); 
db.tokumx_coll.ensureIndex({_pid:1}); 
db.tokumx_coll.ensureIndex({_iid:1}); 
db.tokumx_coll.ensureIndex({"created_at":1}); 

Test plan is also quite simple:

{'$query', {gender,3,geo, {'$geoWithin', {'$center', [[48.72761, 9.24596], 0.005]}}}, '$orderby',{'_pid',-1}} 

Tsung stress testing running for 1 hour for each testing. And the concurrency is 1 request per second.

  <load>
    <arrivalphase phase="1" duration="60" unit="minute">
      <users interarrival="1" unit="second"/>
    </arrivalphase>
  </load>

Here is the report in screenshot:

TOKUMX:

tokumx summary
tokumx reports

MONGODB:

mongodb summary mongodb reports


Updates @2014.12.12 Found this: https://github.com/Tokutek/mongo/issues/1014


Source: (StackOverflow)