Testing scalability and performance with k6
The k6 framework (https://k6.io) is a programmable open source load testing tool. We are going to show you how to use it to generate a more realistic load pattern than you could generate using a simple load generator such as Apache Bench (ab).
This framework is quite simple to set up and use thanks to its Docker image, which is available on Docker Hub. You can find the Quick Start instructions at https://k6.io/docs/getting-started/running-k6.
To create a load test using k6, you need to use JavaScript using k6's library routines. To perform a smoke test, your script would need to look something like this:
import http from 'k6/http'; export default function() { Â Â http.get('https://shipit-v8.eks.example.com/'); }
This script is roughly equivalent to using the ab
utility to stress test a web server. Create a file called hello.js
using the preceding source code, replacing shipit-v8.eks.example.com...