Using compatibility-mode base

That seems a bit much and given that I would expect around 1/4-1/2 of that. As I mentioned above, compatibility-mode=base will at this point no longer help you (a lot) with this problem).

I would ask you whether:

  1. You are using the latest k6 version, (v0.33.0 was released yesterday) if not - upgrade to it.
  2. Are you reading any files that you need as input, if yes - use SharedArray
  3. Are you importing a lot of js code? Js code needs to be copied and ran per each VU as they are completely separate JS VMs. So if you are importing some big library this can be a problem.
  4. (maybe this should be 1) if the memory usage isn’t a problem for you, you should probably not optimize it, just saying :wink:

Also please read running large test for other general. For the record I ran 10k VUs with less than 3.5GB for one minute.

This part for example is especially relevant for long running tests as k6 otherwise needs to keep all the metrics locally, while you already output them to some output for future investigation.

Hope this helps you, and if not a representative code sample, will help with a more relevant advice :wink: