Skip to content

Commit 72c0783

Browse files
committed
docs: add PGO information
1 parent f2a6887 commit 72c0783

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

website/content/en/docs/administration/tuning.md website/content/en/docs/administration/tuning/_index.md

+4
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,7 @@ tags: ["tuning", "rust", "performance"]
77
Vector is written in [Rust] and therefore doesn't include a runtime or a virtual machine. There are no special service-level steps you need to undertake to improve performance as Vector takes full advantage of all system resources by default and without any adjustments.
88

99
[rust]: https://rust-lang.org
10+
11+
## Pages
12+
13+
{{< pages >}}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
title: Profile-Guided Optimization
3+
description: How to optimize Vector performance with Profile-Guided Optimization
4+
short: PGO
5+
weight: 3
6+
tags: ["pgo", "tuning", "rust", "performance"]
7+
---
8+
9+
Profile-Guided Optimization (PGO) is a compiler optimization technique where a program is optimized based on the runtime profile.
10+
11+
According to the [tests], we see improvements of up to 15% more processed log events per second on some Vector workloads. The performance benefits depend on your typical workload - you can get better or worse results.
12+
13+
More information about PGO in Vector you can read in the corresponding GitHub [issue].
14+
15+
### How to build Vector with PGO?
16+
17+
There are two major kinds of PGO: Instrumentation and Sampling (also known as AutoFDO). In this guide, is described the Instrumentation PGO with Vector. In this guide we use [cargo-pgo] for building Vector with PGO.
18+
19+
* Install [cargo-pgo].
20+
* Check out Vector sources.
21+
* Go to the Vector sources directory and run `cargo pgo build`. It will build the instrumented Vector version.
22+
* Run instrumented Vector on your test load like `cargo pgo run -- -- -c vector.toml` and wait for some time to collect enough information from your workload. Usually, waiting several minutes is enough (but your case can be different).
23+
* Stop Vector instance. The profile data will be generated in the `target/pgo-profiles` directory.
24+
* Run `cargo pgo optimize`. It will build Vector with PGO optimization.
25+
26+
A more detailed guide on how to apply PGO is in the Rust [documentation].
27+
28+
[tests]: https://github.com/vectordotdev/vector/issues/15631#issue-1502073978
29+
[issue]: https://github.com/vectordotdev/vector/issues/15631
30+
[documentation]: https://doc.rust-lang.org/rustc/profile-guided-optimization.html
31+
[cargo-pgo]: https://github.com/Kobzol/cargo-pgo

0 commit comments

Comments
 (0)