Good afternoon, k6 community! I wanted to share an issue I am currently experiencing with a test script we are developing. I will explain it as best I can, but if you have any questions, or I am clearly missing details, please ask or let me know.
We are running the script from github actions. The workflow is running on Ubuntu 20.04 with a 2-core CPU, 7GB of ram, and 14GB of SSD space. I will break this down between an older version of the script, that is working without any issues, and a more recent version that contains xk6, a sql db, and some abstraction by way of helper files. I would also like to add that I am systematically adding things to the functioning script to see what might be causing it to go so wild.
Here is a graph for both the run with the older script and the newer script:
It should be noted that all things in regards to length and load are equal between the tests. Same environment, same ramp up, same sustained load, same ramp down, etc…
As it must already be clear, the graph on the far left is our older script. Quite stable, with zero failed requests out of about 75,000 total over the course of an hour. The total VU’s by the end of the test remained stable at about 56 (split between different requests)
The graph on the right is from a run of our latest script. The numbers were strange and alarming:
There haven’t been any changes to the services we are testing, and we managed a successful test with zero failed requests and good request durations, with our original script, after running running three tests with our latest script just before it.
As a contrast, here is a run using the original script (This run is cut in half, so don’t be alarmed by the number of requests. I just didn’t save a screen grab of the original, full tests.):
We aren’t quite sure why this would be happening, but we suspect it is memory related. Is it possible this is a memory issue? Are any of these signs an indication of it? The original test had most of the code within the script itself (this includes code that randomly generates request bodies). Over time, as we have expanded to test more services, I have moved a lot of this code over to helper files that I import into the script. Side question, but does anyone know of a way to monitor memory usage inside of a github workflow?