Skip to content

Instantly share code, notes, and snippets.

@mark-rushakoff
Created November 26, 2013 07:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mark-rushakoff/7654423 to your computer and use it in GitHub Desktop.
Save mark-rushakoff/7654423 to your computer and use it in GitHub Desktop.
Benchmarking NATS connectivity in a CloudFoundry deployment

On nats_z2/0 (only NATS server):

$ sudo su
$ cd /var/vcap/bosh/bin
$ ./nats-server --port 12121 --user foo --pass bar

On api_z1/1 (Working CC, different AZ from NATS):

$ sudo su
$ cd /tmp
$ wget https://github.com/derekcollison/nats/archive/master.zip
$ unzip master.zip
$ cd nats-master/benchmark
$ NATS_URI=nats://foo:bar@10.10.80.11:12121 ruby latency_perf.rb
Sending 10000 request/responses
+++++++++
Test completed : 3.00 ms avg request/response latency
$ NATS_URI=nats://foo:bar@10.10.80.11:12121 ruby pub_perf.rb
Sending 100000 messages of size 16 bytes on [test]
+++++++++++++++++++++++++++++++++++++++
Test completed : 90085 msgs/sec (1.4 MB/sec)
$ NATS_URI=nats://foo:bar@10.10.80.11:12121 ruby pub_sub_perf.rb
Sending 100000 messages of size 16 bytes on [test]
+++++++++++++++++++++++++++++++++++++++
Test completed : 38343 sent/received msgs/sec (0.6 MB/sec)
Received 100000 messages

On api_z2/1 (Working CC, same AZ as NATS):

$ sudo su
$ cd /tmp
$ wget https://github.com/derekcollison/nats/archive/master.zip
$ unzip master.zip
$ cd nats-master/benchmark
$ NATS_URI=nats://foo:bar@10.10.80.11:12121 ruby latency_perf.rb
Sending 10000 request/responses
+++++++++
Test completed : 1.39 ms avg request/response latency
$ NATS_URI=nats://foo:bar@10.10.80.11:12121 ruby pub_perf.rb
Sending 100000 messages of size 16 bytes on [test]
+++++++++++++++++++++++++++++++++++++++
Test completed : 103486 msgs/sec (1.6 MB/sec)
$ NATS_URI=nats://foo:bar@10.10.80.11:12121 ruby pub_sub_perf.rb
Sending 100000 messages of size 16 bytes on [test]
+++++++++++++++++++++++++++++++++++++++
Test completed : 37170 sent/received msgs/sec (0.6 MB/sec)
Received 100000 messages

On api_z2/0 (Broken CC, same AZ as NATS):

$ sudo su
$ cd /tmp
$ wget https://github.com/derekcollison/nats/archive/master.zip
$ unzip master.zip
$ cd nats-master/benchmark
$ NATS_URI=nats://foo:bar@10.10.80.11:12121 ruby latency_perf.rb
Sending 10000 request/responses
+++++++++
Test completed : 1.19 ms avg request/response latency
$ NATS_URI=nats://foo:bar@10.10.80.11:12121 ruby pub_perf.rb
Sending 100000 messages of size 16 bytes on [test]
+++++++++++++++++++++++++++++++++++++++
Test completed : 94297 msgs/sec (1.4 MB/sec)
$ NATS_URI=nats://foo:bar@10.10.80.11:12121 ruby pub_sub_perf.rb
Sending 100000 messages of size 16 bytes on [test]
+++++++++++++++++++++++++++++++++++++++
Test completed : 39319 sent/received msgs/sec (0.6 MB/sec)
Received 100000 messages

On api_z1/0 (Broken CC, different AZ from NATS):

$ sudo su
$ cd /tmp
$ wget https://github.com/derekcollison/nats/archive/master.zip
$ unzip master.zip
$ cd nats-master/benchmark
$ NATS_URI=nats://foo:bar@10.10.80.11:12121 ruby latency_perf.rb
Sending 10000 request/responses
+++++++++
Test completed : 2.47 ms avg request/response latency
$ NATS_URI=nats://foo:bar@10.10.80.11:12121 ruby pub_perf.rb
Sending 100000 messages of size 16 bytes on [test]
+++++++++++++++++++++++++++++++++++++++
Test completed : 103319 msgs/sec (1.6 MB/sec)
$ NATS_URI=nats://foo:bar@10.10.80.11:12121 ruby pub_sub_perf.rb
Sending 100000 messages of size 16 bytes on [test]
+++++++++++++++++++++++++++++++++++++++
Test completed : 37679 sent/received msgs/sec (0.6 MB/sec)
Received 100000 messages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment