Request for Assistance in Reducing Memory Usage of K6 Script (Diameter protocol)

Hi K6 Community,

Hope you’re doing well. I need your help with a problem I’m facing in my K6 script.

I’m currently working on testing a Diameter Credit-Control Application, which is essential for evaluating how well ISP online charging systems perform. But, I’ve hit a snag with memory usage in my script. Even after trying different ways to make it more efficient, the memory it uses during tests is still higher than expected.

The script is stored in this GitHub repository

I’ve tried things like using SharedArrays more, avoiding importing large JavaScript modules, and skipping setup() and teardown() functions to reduce overhead. But, nothing seems to bring the memory usage down.

I’m reaching out to see if anyone has any suggestions or tips on how I could optimize my script better to tackle this memory issue.

Any help would be greatly appreciated.


Hi @mohammadheidari !

Welcome to the community forums! :wave:

One possible optimization to reduce memory usage is to attempt to run k6 in compatibility-mode=base. That way, you could avoid using a babel, which could be memory-hungry in k6. However, it might be that you need to adjust your scripts first, see more details:

I also see that your script is using a custom extension, k6/x/diameter. It might be worth checking what memory management is there and see if it could be improved somehow.

Hope that answers a bit.

Let me know what you think :+1: