Open punkeel opened 2 years ago
Interesting, I can see the utility, but can you explain what your use case for this is in more details? You want to test only the performance of your application locally, without any of the interference and overhead from the network?
From the implementation side, it will be somewhat tricky to implement correctly... :thinking: Here are some of the complexities I can think of right now:
Transport
and/or Client
to dial the UNIX socket, it will probably need to wait for the new HTTP API in k6, since the current one has a global transport and client per VU :disappointed: http_req_connecting
and http_req_tls_handshaking
won't make a lot of sense in this context, so they will either have to always be 0
or be omittedk6 run
tests - it probably has to be disabled (since it will always fail) for k6 cloud
tests or maybe even for local distributed tests (e.g. with k6-operator or natively in the future) between multiple k6 instances... :thinking:
Feature Description
It is possible to bind an HTTP server to a UNIX Socket rather than to a TCP socket. This provides better performance, better security (nothing is exposed by default).
Suggested Solution (optional)
Go's
http.Client
can be configured with anhttp.Transport
to connect to UNIX sockets (and more).k6 should provide a way to configure the HTTP transport, and document how to use it.
Already existing or connected issues / PRs (optional)
1493 is about TCP sockets (aka: not HTTP), and is a different issue.