gitlab-org--gitlab-foss/doc/monitoring/performance/introduction.md

66 lines
2.8 KiB
Markdown
Raw Normal View History

# GitLab Performance Monitoring
2016-01-18 10:55:14 -05:00
GitLab comes with its own application performance measuring system as of GitLab
8.4, simply called "GitLab Performance Monitoring". GitLab Performance Monitoring is available in both the
2016-01-18 10:55:14 -05:00
Community and Enterprise editions.
2016-01-19 16:18:51 -05:00
Apart from this introduction, you are advised to read through the following
documents in order to understand and properly configure GitLab Performance Monitoring:
2016-01-19 16:18:51 -05:00
- [GitLab Configuration](gitlab_configuration.md)
- [InfluxDB Install/Configuration](influxdb_configuration.md)
2016-01-19 16:18:51 -05:00
- [InfluxDB Schema](influxdb_schema.md)
- [Grafana Install/Configuration](grafana_configuration.md)
2016-01-19 16:18:51 -05:00
## Introduction to GitLab Performance Monitoring
2016-01-19 16:18:51 -05:00
GitLab Performance Monitoring makes it possible to measure a wide variety of statistics
2016-01-18 10:55:14 -05:00
including (but not limited to):
2016-01-19 16:18:51 -05:00
- The time it took to complete a transaction (a web request or Sidekiq job).
- The time spent in running SQL queries and rendering HAML views.
- The time spent executing (instrumented) Ruby methods.
- Ruby object allocations, and retained objects in particular.
- System statistics such as the process' memory usage and open file descriptors.
- Ruby garbage collection statistics.
2016-01-18 10:55:14 -05:00
2016-01-19 16:18:51 -05:00
Metrics data is written to [InfluxDB][influxdb] over [UDP][influxdb-udp]. Stored
2016-01-18 10:55:14 -05:00
data can be visualized using [Grafana][grafana] or any other application that
supports reading data from InfluxDB. Alternatively data can be queried using the
InfluxDB CLI.
## Metric Types
Two types of metrics are collected:
1. Transaction specific metrics.
2016-01-19 16:18:51 -05:00
1. Sampled metrics, collected at a certain interval in a separate thread.
2016-01-18 10:55:14 -05:00
### Transaction Metrics
Transaction metrics are metrics that can be associated with a single
transaction. This includes statistics such as the transaction duration, timings
of any executed SQL queries, time spent rendering HAML views, etc. These metrics
are collected for every Rack request and Sidekiq job processed.
### Sampled Metrics
Sampled metrics are metrics that can't be associated with a single transaction.
Examples include garbage collection statistics and retained Ruby objects. These
metrics are collected at a regular interval. This interval is made up out of two
parts:
1. A user defined interval.
2016-01-19 16:18:51 -05:00
1. A randomly generated offset added on top of the interval, the same offset
2016-01-18 10:55:14 -05:00
can't be used twice in a row.
The actual interval can be anywhere between a half of the defined interval and a
half above the interval. For example, for a user defined interval of 15 seconds
the actual interval can be anywhere between 7.5 and 22.5. The interval is
re-generated for every sampling run instead of being generated once and re-used
for the duration of the process' lifetime.
[influxdb]: https://influxdata.com/time-series-platform/influxdb/
[influxdb-udp]: https://docs.influxdata.com/influxdb/v0.9/write_protocols/udp/
[grafana]: http://grafana.org/