My Wifi keeps dropping while i increase VUs to 500/1000 and CPU - 220%, What could be the reason behind it?

I am trying to load test simple HTTP post request in my local MacBook.

I have increased ulimit -n 250000 and also increased maxFiles limit
sudo launchctl limit maxfiles 1000000 1000000

K6 command -> k6 run --vus 100 --duration 5m --discard-response-bodies=true script.js

I am not able to increase QPS because of not able to increase VUs. I am able to hit through 100 VUs fine, but whenever i am trying to increase to 500 or 1000, My Wifi just disconnects, switches off, CPU goes to 225%.
I am suspecting k6 is interfering with Wifi Network Connection ports. I am a newbie to this, any kind of help is appreciated. I love the K6 tool but now I’m really get stuck with just 100 VUs and RPS is only going around 40 - 50RPS.

My device specs are -
MacBook Pro (15-inch, 2017)
Processor - 3.1 GHz Quad-Core Intel Core i7
Memory - 16 GB 2133 MHz LPDDR3

Hi @chiragb,

There is absolutely nothing that k6 does to your WiFi, it tells your OS it wants to do network requests and your OS uses your WiFi to do. Given the symptoms, I expect that the WiFi driver (or the chip itself) doesn’t work well under heavy load - I have seen it in other machines (including possibly my own new laptop, haven’t had time to diagnose it as I use it mostly with a wired connection).

A quick google search seems to confirm this does happen with your laptop model, and not that uncommonly.

Chances are that (because the RPS you report is low) you have big bodies that just saturate your WiFi bandwidth pretty fast. I would argue that load testing over WiFi is not a … great idea as well as it is pretty easy to saturate and unlikely to be able to support some heavy testing.

I would recommend looking at what bandwidth k6 uses, there is data_received/data_send in the metric summary at the end, to confirm you are hitting the limits of your WiFi connections, just to confirm it. And possibly using a wired connection if possible.

You should also monitor your memory and CPU usage on the load testing machine, the laptop in this case. This is especially important if you are seeing results you don’t like as they might be because the load testing machine can’t generate the traffic required. Depending on what you are load testing, there is a good chance a laptop won’t be able to generate enough traffic :frowning:

1 Like