At high rates, k6 errors with `dial tcp 10.0.3.15:443: connect: cannot assign requested address`.
AdvancedTroubleshootingk6 Load Testing
Answer
Likely causes → Ephemeral port exhaustion on the load generator: too many new connections to one destination IP:port, with old sockets stuck in TIME_WAIT. Often caused by noConnectionReuse or noVUConnectionReuse, or the server closing connections after each request.
Diagnose →
ss -tan state time-wait | wc -l
sysctl net.ipv4.ip_local_port_range
Fix → Enable connection reuse, widen the port range (sysctl -w net.ipv4.ip_local_port_range="1024 65000"), and spread load across multiple generators or target IPs.
Prevent → Run large tests distributed with the k6 Operator and check the generator's network metrics as part of the test.
More on k6 Load Testing
k6 prints `WARN[0030] Insufficient VUs, reached 100 active VUs and cannot initialize more executor=constant-arrival-rate scenario=steady`.AdvancedCI fails with `ERRO[0602] thresholds on metrics 'http_req_duration' have been crossed` and exit code 99.BeginnerEvery request fails with `dial tcp: lookup checkout on 10.96.0.10:53: no such host`.BeginnerMany requests fail with `request timeout` after exactly 60 seconds.IntermediateThe test starts fine, then errors switch to `dial tcp 10.96.41.12:8080: connect: connection refused`.IntermediateThe k6 load generator logs `socket: too many open files`.Intermediate