WebSocket loses messages

Hi !
I have a load test in which I begin with a scenario that connects many WebSockets to my microservice system (roughly 5000VUs ws) and then a scenario that sends ramping arrival rate of http requests over those WSs.
In every test, I can see in the metrics that the http messages that were sent are greater than the messages that were received by the WSs, in both I am using the native metrics (http_reqs, ws_msgs_received - statsd format).
The http message sender scenario sends about 300RPS with spikes of 600RPS across all open WSs randomly.

Is there any problem with the bandwidth of the k6/ws (this is what I use) ?
Any suggestion for making this kind of test more efficient in terms of not losing messages ?

Important to mention that I could not see any errors from my servers side and also when using another load testing provider, could not see any problem with messages losing as well.

Hi @idanlisman,

This seems strange to me. Can you provide some script so we can look at the code?

Also any concrete numbers will be nice. As well as actually looking at the cpu and memory usage of the load generator. If it is pinned at 100% CPU that is bad.

Maybe even try to decrease the numbers and see if that makes it better. If the test does not have the desired behaviour at 10RPS it likely won’t at 600 as well.