grafana / k6

A modern load testing tool, using Go and JavaScript - https://k6.io
GNU Affero General Public License v3.0
25.22k stars 1.25k forks source link

Support HTTP over UNIX Socket #2366

Open punkeel opened 2 years ago

punkeel commented 2 years ago

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 an http.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.

na-- commented 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: