Create client and server to coordinate benchmarking tasks

Problem

Currently benchmarking creates a single Gitaly node and runs tests sequentially against it using Ansible. However, this is quite slow, testing just 3 RPCs at ~1 minute per run, 5 repos per RPC, takes 15 minutes. At this pace testing the top 25 RPCs will take over 2 hours.

Solution

Creating multiple Gitaly nodes from a common image and running jobs in parallel will allow us to speed things up significantly, but Ansible does not support fanning out jobs between servers like this. Adding a new binary to Gitaly, gitaly-bench seems like the best option here. Ansible can start these processes on the client and servers, waiting until they exit.

Client

  • Reads in the details of the tests and Gitaly servers from a file written by ansible to the client machine.
    • We'll probably need to make the client machine beefier to run multiple requests in parallel.
  • The client-side can directly embed ghz as a library, sending gRPC requests via Gitaly's standard connection.
  • Request to start/stop Gitaly server will be sent over a separate TCP connection using JSON-encoded messages.

Server

  • Listens for requests to start/stop Gitaly on a separate TCP connection.
    • This is done for ease of log collection, journalctl can be queried for the logs of a specific pid.
  • Starts the existing profiling shell script, which is a good fit for coordinating multiple processes.
Edited by Will Chandler (ex-GitLab)