Skip to content

Use webrick, not puma, for gitlab-exporter

Matthias Käppler requested to merge mk-gitlab-exporter-webrick into master

What does this MR do?

We found that Puma is oversized for gitlab-exporter, which is a low traffic system and which does not benefit from concurrency. We have evidence that on SaaS a single-threaded Rack server such as WEBrick is sufficient to serve the relatively low volume of requests caused by Prometheus scrapers (all our in-app *_exporters already serve via WEBrick.)

We think that switching gitlab-exporter to WEBrick will result in lower memory requirements especially on single-node installations that run the GitLab Self-Monitoring service suite.

However, keeping this as a configuration switch leaves the door open to using more powerful servers such as Puma.

Related issues

Test plan

  1. Start cluster
  2. Install chart
  3. Check the pod is running: kubectl get pods -lapp=gitlab-exporter
  4. Verify process is using WEBrick
    • kubectl exec -ti PODNAME -- /bin/bash

    • ps aux | grep gitlab-exporter

    • head /etc/gitlab-exporter/gitlab-exporter.yml

      server:
        name: webrick
        listen_address: 0.0.0.0
        listen_port: 9168

Checklist

See Definition of done.

For anything in this list which will not be completed, please provide a reason in the MR discussion.

Required

  • Merge Request Title and Description are up to date, accurate, and descriptive
  • MR targeting the appropriate branch
  • MR has a green pipeline on GitLab.com

Expected (please provide an explanation if not completing)

  • Test plan indicating conditions for success has been posted and passes
  • Documentation created/updated; this happened here: gitlab-org/gitlab!51322 (merged)
  • [-] Tests added; there was no existing test suite for gitlab-exporter, but I don't think this is worth testing. We already test in gitlab-exporter itself that this config flag works as epected, and we merely emit the relevant config here.
  • [-] Integration tests added to GitLab QA; this shouldn't be necessary as we are not changing application behavior. Any Rack server should serve gl-exporter successfully.
  • Equivalent MR/issue for omnibus-gitlab opened: gitlab-org/omnibus-gitlab!4896 (merged)
Edited by Matthias Käppler

Merge request reports