-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get memory usage down #1543
Comments
hmm we definitely have a lot of things to optimize regarding memory usage (#1167 and many other issues here), but 15 to 17MB per VU is way too much 😕 What's the size of Also, can you try to run the test with |
Also, try enabling discardResponseBodies, (preferably before the compatibility-mode) |
It just contains a few helpers:
|
@mstoykov Thanks, this helps. Now down to 3GB |
3GB is still way too much for that script 😕 IIRC from other issues, you were using Windows, right? Maybe we have some memory usage issues on Windows... Or not having I ran your script, adapted to use https://test-api.k6.io/ instead of your localhost API, without
~1.2GB RAM used 😕 |
@SebastianStehle this still seems high to me ... usually it is expected to be around 2.7-3MB /VU for such small scripts.
with I think this is because you have zero |
@na-- Your test shows the same numbers on my machine, but the throughput is much lower. The average performance is 100ms and with localhost 15ms. I have forgotten to mention that I use influxdb. I have realized that there are gaps in the charts. I guess that k6 can not send the requests to influxdb fast enough and then the stats are buffered somewhere and occupy . Depending on the amount of data it might be necessary to pre-aggregate results before sending them to influxdb. |
This shouldn't be the case anymore, which version of k6 are you running? |
v0.26.2 ... it only happens when there are a lot of requests |
My guess is that you're overloading the InfluxDB instance (k6 generates a ton of metrics), data packets start piling up and eating up memory, and with the test app, k6 and InfluxDB running on the same machine, the CPU (and, consequently, things like garbage collection) are struggling to keep up... Is your CPU coping with the load of this, and do you see a significant difference in CPU and memory usage when you disable InfluxDB for the same testrun? |
Closing this, since there doesn't seem to be a reason to keep this open any longer. We've had further memory-usage reductions in k6 since this, like Edit: probably worth mentioning that all of the suggestions for reducing memory usage discussed above are documented in https://k6.io/docs/testing-guides/running-large-tests |
It is neither a bug nor a feature request, but I think it would be good if you can get the memory usage down.
I have a very simple test:
This test loads a very small payload (around 2kB) from a JSON API.
The system under test stays healthy with around 300MB used, but k6 gets above the roof. It uses around 4GB to 5GB of memory. This is around 15 to 17MB per VU and way too much for my simple test.
The text was updated successfully, but these errors were encountered: