I have around 250 files ~1.5 Gigs worth of binary files (.png, .mp3, .mp4) that I want to use within my tests for load testing upload scenario. The scenario must load unique files. What is the best way for the tests to get to these files with the tests?
Hi @ryanrosello-og, sorry for the slow reply.
Unfortunately I can’t recommend using k6 for this unless you are literally going to do single digit VUs.
I am not going to explain all the technical details, I have tried to go through most of them here but ultimately due to many different design decisions through internals and export API, k6 will copy files multile times.
All of the proposed solutions at the time this was written were about fixing corner cases which as I explain there ultimately will just make it worse for the cases taht aren’t.
We do currently work on prerequisites to have this. And v0.47.0 (to be releasec in like 7 weeks) is expected to have some improvements but ultimiately bodies will be copied at least once per each request made. Which if you have high RPS is not great.
If you do not care about the files being valid mp3/mp4/png files you just care about uploading bigger binary files, I would recommend just generating them at runtime instead of reading them from disk.
But even this will likely not help you all that much.
I can tell you that you can probably get your way pretty far by writing extensions, but to be honset in this case this will likely be a lot of work, so I can’t really recommend going that route unless you are profecient in writing go and want to learn a bunch of k6 internals.
Hope this helps you somewhat
Thank you @mstoykov , I will explore dynamically creating binary files at runtime.