Distributing Browser load to hosts that generate it

Hi,

We’re currently using k6 for perf testing our API’s. We’re looking at xk6 browser scripting for UI perf testing. I’m aware it’s still in Beta but when it becomes an official release we would like to use it.

Along those lines I wanted to know what you guys recommend for distributing the load to different nodes/selenium grids when spinning up the browser processes. Curious to know what this tool will support and more critically, what technology integration you recommend for distributing the load to the various nodes and how the nodes can report back.

In my experience, distributing this load can be done through an SQS integration but there are needs to be a controller that knows how to distribute this load.

Please let me know what your team has considered when thinking about this issue. We would love to implement it if possible.

Hi Oliver,

Thanks for your question.You would need to have a central controller in place to distribute the work to all your nodes – execution segments might help distribute the work evenly across your nodes. The nodes themselves would require a lot of resources since they’re working with browser processes. We do something similar with k6 cloud, and it will support browser tests soon.

Cheers

Hi,

Thanks for the reply. Can you tell me a bit more about the central controller? Do you have a 3rd party tool or library I can research or is this something that has to be developed in house? I’m trying to gauge what the level of effort would be and curious about how you guys architected the controller at a high level.

Thanks

Hi Oliver,

I can’t share any of the details unfortunately.

Cheers

Hi,

Could you direct my question to someone who may have more insight? I’m not asking about any specific details about how you guys solved this problem. I’m merely asking for some high level suggestions about how I could direct my architecture research.

I’ve seen this problem be resolved before through an AWS SQS queue, and a consumer that takes those messages and distributes them to different nodes that run the browser process.

What’s unclear is which k6 API’s I would even need to call to transmit those messages. This is an issue that I’m sure you’ll be asked by many people once xk6 goes out of Beta.

Thanks

Hi Oliver,

I’m another developer on the xk6-browser team. Just wanted to chime in with a bit more detail.

As you can imagine, we’re not able to share any implementation details about our k6 Cloud product because it’s proprietary. I’ll try to help you out, but please understand if my answers are vague. :slight_smile:

There are several things you can look into to run distributed tests with k6 (and, thus, xk6-browser):

  • There’s the k6-operator project that allows you to run k6 on Kubernetes, which simplifies many orchestration aspects of distributed tests. See this article for an introduction.

  • You can read the discussion and follow this GitHub issue that aims to add clustering and distributed execution support natively in k6. There was some work done for that, but there are no ETAs for getting it merged. Now that the k6-operator is relatively stable, it would be interesting to discuss whether it makes sense to do this natively in k6 anymore.

  • As Ankur mentioned, take a look at the execution segments documentation, as well as the k6 REST API documentation. We use both of these to distribute and manage tests in k6 Cloud.

  • As for using AWS SQS: sure, that might make sense, since you’ll probably want to have a central test manager of sorts. k6 itself wouldn’t have to know anything about this really, but you would need some component that does and communicates with k6 via, say, the REST API.

Keep in mind that running xk6-browser tests complicates things substantially, as you’ll need much more resources on your test nodes compared to plain k6 tests, due to the browser process overhead.

Hope this helps, and good luck!

Ivan