Multiple Outgoing IP Addresses

Hello,

How can I make k6 use multiple IP addresses as the source of the load testing requests? I have a need to load test a system on Microsoft Azure, but this specific service has a SSL-handshake limit per IP. In order to test, I need to use many IP addresses.

I did find this issue to support multiple NICs: Support for Multiple Network Card · Issue #476 · grafana/k6 · GitHub

Is it possible to assign multiple IP aliases to a single same NIC and make k6 use them (randomly/round robin)?

Thanks!

Hi @srg,

This is currently not supported but there is an open PR that is … well quite outdated probably at this point.
The primary problem with this whole multiple IPs and multiple interface thing (for me at least) is that we haven’t figured out a way to test it in a CI.
I would be okay if you or ofauchon (the original author) rebases that PR on the current master so we can try and possibly work on it, possibly even without CI tests, but this will mean that I (or someone else on the k6 team) will need to setup and test it locally :frowning: .

If you want to try it and rebase it you can (somewhat) follow this instructions on custom building k6, that I gave last week for a different case.

edit: obviously you can spread the test among many computes either by hand or by using Load Impact :wink: .
Also connection reuse (if possible) will lower the amount of connections needed …
But this is all dependent on what exactly you are testing and what the limits are :wink:

Hi @mstoykov, thank you for the timely reply!

It’s unfortunate that multiple IPs are not (yet) supported by k6. Since it’s required for our specific use case, I’ll brainstorm with my coworkers to see if there’s a way to do this. Possibly running some sort of transparent proxy on the load testing server that spreads the requests over all available IPs. I’ve come to enjoy k6 and would rather not switch to another tool.

I’ll also take a look at improving the PR. I have no experience with Golang, but Wikipedia says it’s similar to C, so hopefully I’ll be able to help get it working.

Thank you!

The PR should probably be easily rebased on top of the current master and … well work, I don’t think we’ve changed anything that related to it, but you will need to build a custom k6 build in order to use it.

And golang is … well easy to get started with, so I am sure you will be able to do the rebase and build. As far as I remember the main problem with the PR (apart from non having automatic tests) was that it … well very basic support, but I would argue that is not such a big problem as long as we have a plan on how to extend it properly :wink:

This was finally merged in v0.29.0 and can now be configured with –local-ips