Live data from Hacker News

K6: Like unit testing, for performance

github.com

31–40 of 86 posts

Re: K6: Like unit testing, for performance

#31
post #6

It seems like the hard part is deciding when a change is suspicious enough to be investigated? Simple pass/fail tends not to work at scale because complicated systems tend to be noisy.

Only if you run it on your production instance? If you run it on CI in a fresh test instance you should have a fairly good idea.

Re: K6: Like unit testing, for performance

#32
post #26

Earlier quoted context omitted.

That's more or less it. Source: I am one of the k6 developers, and here's also an answer from our CEO on the topic: https://community.k6.io/t/k6-licensing-agplv3/395/2

The CEOs response doesn't inspire any confidence: If you statically or dynamically link any part of the k6 codebase with some other code (a derivative work), the license’s copyleft virality is triggered and that other code also needs to be made available under AGPLv3. When it comes to using the k6 binary and interacting with it from another process or over a network it is not certain exactly how the copyleft virality…

Happy to answer any questions you have regarding the license and why we chose it. Is your concern the copyleftness of the license?

Re: K6: Like unit testing, for performance

#33

what is the max number of VUS you guys have run through it?

This very much depends on your available hardware and the complexity of the load test. Following the advice in https://k6.io/docs/testing-guides/running-large-tests, and having a beefy load generation machine and network, you should be able to run many thousands of VUs on a single instance pretty comfortably. How many thousands precisely depends on a lot of factors... :)

Re: K6: Like unit testing, for performance

#34
post #27

What is the benefit of this tool over vegeta or wrk2? I do like that vegeta and wrk2 work with simple http requests. If more complex flows and assertions on responses are required I go for Gatling. So maybe K6 is more comparable to gatling.

Gatling is super slow. Suspicious slow in fact. You will likely not be able to really hit your endpoints hard enough by using one machine only.

Personally I use autocannon which in my testing is faster than k6 and easier to use with a node.js environment. It is only a npm package, not a full software you need to install on your machine. Autocannon in my testing is 2 orders of magnitude faster than gatling, but you should do your own testing. PS. I have no affiliations to autocannon, I'm just a very happy user.

The only drawback compared to k6 is lack of websockets, which is unfortunate.

https://github.com/mcollina/autocannon

Re: K6: Like unit testing, for performance

#37
post #21
post #16

In their documentation ( https://k6.io/docs/ ) they claim that > JavaScript is not generally well suited for high performance. To achieve maximum performance, the tool itself is written in Go, embedding a JavaScript runtime allowing for easy test scripting. How is it possible that pure go JavaScript interpreter (goja) with bindings for net/http and some reports would be faster than the same tool written in nodejs usi…

I am not completely sure why the Go stdlib's HTTP client (which k6 uses) is faster than the NodeJS one. I think part of it is the fact that k6 spins up a separate JS runtime for each VU. goja is a much, _much_, slower JS interpreter than V8, but load tests are IO-bound, so that's usually not an issue. And you can spin up thousands of VUs in k6 (especially with --compatibility-mode=base), making full use of the load g…

What do you mean "very long article"? You could have used "extensive" or something ;)

Anyway, what I've seen when comparing the performance of tools, is that Artillery, which is running on NodeJS, is perhaps the wors performer of all the tools I've tested. I don't know if it's because of NodeJS or that Artillery in itself isn't a very performant piece of software (It also consumes a lot of memory, btw).

If you want the highest performance, there is one tool that runs circles around all others (including k6), and that is wrk - https://github.com/wg/wrk - very cool piece of software although it is lacking in terms of functionality so mostly suitable for simpler load testing like hammering single URLs.

(I don't know how fast wrk2 is, haven't benchmarked it)

Re: K6: Like unit testing, for performance

#38
post #34
post #27

What is the benefit of this tool over vegeta or wrk2? I do like that vegeta and wrk2 work with simple http requests. If more complex flows and assertions on responses are required I go for Gatling. So maybe K6 is more comparable to gatling.

Gatling is super slow. Suspicious slow in fact. You will likely not be able to really hit your endpoints hard enough by using one machine only. Personally I use autocannon which in my testing is faster than k6 and easier to use with a node.js environment. It is only a npm package, not a full software you need to install on your machine. Autocannon in my testing is 2 orders of magnitude faster than gatling, but you sh…

2 orders of magnitude faster than Gatling? Would be interesting to see how you ran your tests, and the results.

In my testing, Gatling isn't catastrophically slow by any means. Wrk, which is faster than any other tool I've seen, is about one order of magnitude faster than Gatling, in terms of raw RPS generation. I find it very hard to believe a NodeJS-based tool executing JS would be faster than the fastest tool written in C that just hammers static URLs.

Re: K6: Like unit testing, for performance

#39

How does it compare to Tsung?

Beyond technology stack choices I'd say the biggest differences are that k6 is scriptable in JS whereas Tsung has scripting-like capabilities in XML, and that Tsung supports distributed execution of tests which k6 doesn't support yet (only in our SaaS product). Tsung also supports more protocols than k6 at the moment (eg. AMQP, MQTT, PostgreSQL etc.) but k6 supports HTTP/2 and gRPC which Tsung doesn't so depends on one's needs I suppose.

We have a more comprehensive review of open source load testing tools in our blog (including Tsung): https://k6.io/blog/comparing-best-open-source-load-testing-t...

Re: K6: Like unit testing, for performance

#40
This looks really nice; I think I'm likely to try it out.

What I'm really excited to have discovered is the `HAR` format.

https://en.wikipedia.org/wiki/HAR_(file_format)

Over the past 10 years I have glued together project-specific variants of "parse some proxy or WAF log and spit out test or automation data" at least 4 or 5 times. Including as recently as a couple of weeks ago:

https://git.sr.ht/~tuxpup/parse-charles-log

Knowing HAR files existed would have saved me quite a bit of work and left me time to improve my automation or testing. I'm very happy to have discovered this.

Post reply on HN