Load testing for Meteor
Last updated 4 years ago by avital .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @avital/meteor-down 
SYNC missed versions from official npm registry.

MeteorDown Build Status

MeteorDown is a load testing tool for Meteor server side components. It uses the DDP protocol to communicate with the Meteor application. You can write your load test in JavaScript and let MeteorDown to invoke it.


Create a file called my_load_test.js with the following content:

var meteorDown = require('@avital/meteor-down');

meteorDown.init(function (Meteor) {
  Meteor.call('example-method', function (error, result) {

  concurrency: 10,
  url: "http://localhost:3000"

Then run your script:

node my_load_test.js

Client API

With the MeteorDown script, you can call methods and invoke subscriptions. The function given to meteorDown.init will receive the ddp client as the first argument.

This ddp client is based on node-ddp-client but with some changes to make it more Meteor like. Let's look at APIs:


Meteor.call('name'[, args*], callback)

Call a Meteor method. Just like the browser client, the callback will receive 2 arguments Error and the Result.


Meteor.subscribe('name'[, args*], callback)

The callback function will be called when the subscription is ready and all initial data is loaded to the client.



Disconnect the current client from the server. As soon as this is called, another client will connect to the server and run load test code.


var Collection = Meteor.collections['name']

A dictionary of all client side collections. Data received from subscriptions will be available here.


Normally, most of the Meteor methods and subscriptions are only available for loggedIn users. So, we can't directly invoke those methods and subscriptions. MeteorDown has a solution for that.

First you need to install the following package:

meteor add meteorhacks:meteor-down

Then you need to start your Meteor app with a key. That could be anything you like. But it's better to have a hard to guess key.


Now, add that key to your MeteorDown script and tell which users you need to authenticated against the load test. This is how you can do it.

  concurrency: 10,
  url: "http://localhost:3000",
  auth: {userIds: ['JydhwL4cCRWvt3TiY', 'bg9MZZwFSf8EsFJM4']}

Then all your method calls and subscriptions will be authenticated for one of the user mentioned above.

You can also get the loggedIn user's userId by invoking Meteor.userId() as shown below:

meteorDown.init(function (Meteor) {
  console.log("userId is:", Meteor.userId());


All test options are optional therefor it's perfectly okay to call mdown.run without any arguments. All available arguments and their default values are given below.

  concurrency: 10,
  url: 'http://localhost:3000',
  key: undefined,
  auth: undefined


The maximum number of clients connects to the application at any given time. The real number of concurrent connections can be lower than this number.


Meteor application url. NOTE: This should only have the domain and the port (example: localhost:3000). Meteor-down does not support routes at the moment.


The secret key to use for MeteorDown authentication.


Authentication information. Currently MeteorDown only supports login by userId.


Calling a Method

// Meteor Application
  add: function (x, y) {return x + y }
// MeteorDown Script
meteorDown.init(function (Meteor) {
  Meteor.call('add', 5, 6, function (err, res) {
    console.log('5 + 6 is ' + res);


// Meteor Application
Items = new Meteor.Collection('items');
  allitems: function () { return Items.find() }
// MeteorDown Script
meteorDown.init(function (Meteor) {
  Meteor.subscribe('allitems', function () {
    console.log('Subscription is ready');

Current Tags

  • 2.6.1                                ...           latest (4 years ago)

1 Versions

  • 2.6.1                                ...           4 years ago
Maintainers (1)
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 1
Last Month 2
Dependencies (3)
Dev Dependencies (1)
Dependents (0)

Copyright 2014 - 2016 © taobao.org |