Skip to content

Extend benchmarking to support sidechannel RPCs

Context

#6732 is extending the Gitaly benchmarking tool to simulate a production workload and perform BPF measurements on the host machine.

The current workload imposes a mix of read (90%) and write (10%) RPCs on the Gitaly host, but does not include RPCs that would be called when a user fetches or pushes to a repository via the Git CLI. This is because the PostUploadPack* and PostReceivePack* RPCs use the sidechannel mechanism which requires the use of the Gitaly client (see how Workhorse establishes the sidechannel as an example).

Proposal

As @qmnguyen0711 suggested on Slack:

As mentioned in one of our sync call, this project demonstrates a bridge between K6 Javascript framework and Golang. We can apply the same method to inject Gitaly client to k6 for hard-to-simulate RPCs such as PostUploadPack.

FWIW, this issue notes down steps of building tool, collecting and analyzing traffic pattern, and benchmarking Redis using extrapolated pattern. We used that data to find out performance characteristics and ceilings of Redis cluster before deploying. Hope these resources would help

we can write a k6 extension in Go which imports the Gitaly client to call the PostUploadPack and PostReceivePack RPCs. This will allow us to simulate fetches and pushes in the benchmark.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information