Load testing
Overview
Use load testing to ensure that your Blnk deployment can handle expected traffic and maintain performance under various conditions. This is a critical step in setting up your Blnk server.
Blnk use k6, a modern loading testing tool to manage this process. This guide will walk you through setting up and running a load test on your Blnk server using k6 with insights from a sample test result to help you understand and interpret your data.
Before you start
Make sure you have:
- Cloned the Blnk repository to your local machine;
- Docker and Docker Compose installed, for running the Blnk server;
- k6 installed on your machine. Visit k6.io for installation instructions.
Set up your load test
Clone the Blnk repository
If the Blnk repository isn’t already cloned:
Deploy your Blnk server if you haven’t done so yet:
Deploy Blnk
Start here to run your Blnk server
Navigate to the load test directory
Switch to the load test folder within the Blnk repository
Review the load test script
The script.js
file in the load test directory outlines the test:
- It sends HTTP POST requests to the
/transactions
endpoint of the Blnk server. - Each request simulates a transaction with a unique reference ID, generated sing the
uuidv4
function. - The script is set to run with 5 virtual users (VUs) for 30 seconds.
Load test script (script.js)
Run the load test
Within the tests/load
directory:
Need help?
Are you stuck? Do you have a question that isn’t answered in this doc? Have you run into a problem you can’t solve? Want to file a bug report?
Join our Discord server and share your questions/thoughts with other developers building financial applications like you.
Was this page helpful?