Node.js Load Testing in the Cloud
Jan 20 2015 06:44pm | | Share

Node.js Load Testing in the Cloud

By Chad Upton

Discover the easiest way to load test a Node.js with tens of thousands of users.

Testing the capacity of your infrastructure is an important part of deploying any high availability application. There are plenty of great load testing services out there, but If your infrastructure includes Node.js (or socket.io in general) you may find it challenging to do load testing in the cloud. This is surprising since Node.js has over 2 million downloads per month.

I set out to find the simplest way to load test our Node.js infrastructure with tens of thousands of simulated users. There are a number of libraries available for creating your own test apps or scripts. I ruled this out since it would require more time and configuration than finding something closer to a turnkey solution. But, this method certainly offers the most customizability if there are very specific things you need to test that aren't supported in the other platforms.

I looked through the docs of most cloud based load testing platforms I could find. After a number of days of research, trial and error, the easiest solution I've found is creating a jMeter test and deploying it on BlazeMeter's cloud solution. Now, jMeter doesn't support sockets yet (it's on the roadmap), but Maciej Zaleski wrote a plug-in to add the functionality.

I won't reinevent the wheel, BlazeMeter has an excellent tutorial here for doing WebSocket testing with their service. However, I will suggest that you put all of Maciej Zaleski's plug-in and BlazeMeter's related files in jMeter's lib/ext folder -- even though some will work in the /lib folder (trust me, it will make things easier later).

jMeter

BlazeMeter has a free account with 10 tests included. Before you start using up your 10 free tests, you can (and should) use jMeter's local test runner to configure the tests. However, even if they're working locally they may not work on BlazeMeter.

I wasted 6 of my free tests just trying to get my jMeter test configured to run properly through BlazeMeter's cloud runner. Ultimately, it was my mistake... although I think BlazeMeter could provide a bit more context with the phrase "all the files should be provided along with the script". They don't mean ALL of the jMeter files, just all the jar files that are in the lib/ext folder.

If you're looking for help with developing or testing your applications, please contact us!

Happy stress testing!