Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relocate libbeat output & instrumentation #9247

Merged
merged 4 commits into from
Oct 12, 2022

Conversation

axw
Copy link
Member

@axw axw commented Oct 1, 2022

Motivation/summary

Move the automaxprocs adjustment code to package beatcmd, since it should run only once for the process's lifetime. Move creation of the libbeat output pipeline, and APM instrumentation, to package beater, as these can both be reloaded/reconfigured.

Checklist

- [ ] Update CHANGELOG.asciidoc
- [ ] Update package changelog.yml (only if changes to apmpackage have been made)
- [ ] Documentation has been updated

How to test these changes

N/A

Related issues

Part of #8928

Closes #9074

@mergify
Copy link
Contributor

mergify bot commented Oct 1, 2022

This pull request does not have a backport label. Could you fix it @axw? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-7.x is the label to automatically backport to the 7.x branch.
  • backport-7./d is the label to automatically backport to the 7./d branch. /d is the digit

NOTE: backport-skip has been added to this pull request.

@mergify mergify bot added the backport-skip Skip notification from the automated backport with mergify label Oct 1, 2022
@axw axw force-pushed the relocate-libbeat-output branch 2 times, most recently from 736635a to 03f4125 Compare October 1, 2022 11:12
@apmmachine
Copy link
Contributor

apmmachine commented Oct 1, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-10-12T09:21:17.821+0000

  • Duration: 28 min 41 sec

Test stats 🧪

Test Results
Failed 0
Passed 150
Skipped 0
Total 150

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate and publish the docker images.

  • /test windows : Build & tests on Windows.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@apmmachine
Copy link
Contributor

apmmachine commented Oct 1, 2022

📚 Go benchmark report

Diff with the main branch

name                                                                                              old time/op    new time/op    delta
pkg:github.com/elastic/apm-server/internal/agentcfg goos:linux goarch:amd64
FetchAndAdd/FetchFromCache-12                                                                       46.2ns ± 1%    41.3ns ± 1%  -10.72%  (p=0.008 n=5+5)
FetchAndAdd/FetchAndAddToCache-12                                                                    107ns ± 1%      98ns ± 2%   -8.61%  (p=0.008 n=5+5)
pkg:github.com/elastic/apm-server/internal/beater/request goos:linux goarch:amd64
ContextResetContentEncoding/empty-12                                                                 134ns ± 2%     121ns ± 2%   -9.87%  (p=0.008 n=5+5)
ContextResetContentEncoding/uncompressed-12                                                          164ns ± 1%     146ns ± 2%  -10.63%  (p=0.008 n=5+5)
pkg:github.com/elastic/apm-server/internal/model/modelindexer goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/internal/processor/stream goos:linux goarch:amd64
BackendProcessor/events.ndjson-12                                                                    133µs ±27%     180µs ±20%  +35.40%  (p=0.032 n=5+5)
BackendProcessor/heavy.ndjson-12                                                                    3.57ms ±16%    4.83ms ±14%  +35.08%  (p=0.008 n=5+5)
BackendProcessor/invalid-json-metadata.ndjson-12                                                    17.1µs ± 8%    22.6µs ±32%  +32.42%  (p=0.016 n=5+5)
BackendProcessor/ratelimit.ndjson-12                                                                46.5µs ± 7%    53.9µs ±14%  +15.92%  (p=0.032 n=5+5)
RUMV3Processor/rum_errors.ndjson-12                                                                 7.82µs ±16%    9.84µs ± 6%  +25.73%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel2/optional-timestamps.ndjson-12           5.31µs ±10%    4.79µs ± 7%   -9.73%  (p=0.032 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel8/errors_2.ndjson-12                      7.88µs ± 0%    7.95µs ± 1%   +0.77%  (p=0.040 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel8/optional-timestamps.ndjson-12           1.80µs ± 1%    1.90µs ± 8%   +5.56%  (p=0.016 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel8/otel-bridge.ndjson-12                   3.72µs ± 1%    3.89µs ± 1%   +4.64%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel8/ratelimit.ndjson-12                     6.11µs ± 1%    6.68µs ± 1%   +9.29%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel8/span-links.ndjson-12                    1.53µs ± 1%    1.59µs ± 1%   +4.24%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel8/spans.ndjson-12                         10.6µs ± 1%    11.4µs ± 0%   +7.51%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel8/transactions-huge_traces.ndjson-12      5.55µs ± 2%    5.70µs ± 1%   +2.72%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel8/transactions_spans.ndjson-12            11.0µs ± 1%    11.3µs ± 0%   +2.40%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel8/transactions_spans_rum.ndjson-12        2.02µs ± 2%    2.07µs ± 1%   +2.77%  (p=0.016 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel8/transactions_spans_rum_2.ndjson-12      1.94µs ± 1%    2.00µs ± 0%   +3.01%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel8/unknown-span-type.ndjson-12             7.25µs ± 0%    7.46µs ± 1%   +2.85%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/errors.ndjson-12                      7.28µs ± 2%    7.57µs ± 1%   +4.06%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/errors_2.ndjson-12                    6.83µs ± 1%    7.04µs ± 2%   +3.05%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/errors_rum.ndjson-12                  1.95µs ± 2%    2.01µs ± 1%   +3.09%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/errors_transaction_id.ndjson-12       5.41µs ± 1%    5.56µs ± 1%   +2.76%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/events.ndjson-12                      13.1µs ± 1%    13.4µs ± 1%   +2.32%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/invalid-event-type.ndjson-12           796ns ± 2%     819ns ± 2%   +2.85%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/invalid-event.ndjson-12               3.32µs ± 0%    3.43µs ± 1%   +3.32%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/invalid-json-metadata.ndjson-12       1.89µs ± 0%    1.94µs ± 1%   +2.76%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/invalid-metadata-2.ndjson-12           490ns ± 1%     506ns ± 1%   +3.25%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/invalid-metadata.ndjson-12             492ns ± 1%     506ns ± 1%   +2.70%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/metadata-null-values.ndjson-12         758ns ± 0%     785ns ± 1%   +3.47%  (p=0.016 n=4+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/metadata.ndjson-12                    1.24µs ± 1%    1.27µs ± 2%   +2.47%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/metricsets.ndjson-12                  4.42µs ± 1%    4.53µs ± 1%   +2.50%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/minimal-service.ndjson-12              958ns ± 1%     987ns ± 1%   +3.06%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/minimal.ndjson-12                     1.96µs ± 2%    2.03µs ± 2%   +3.64%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/optional-timestamps.ndjson-12         1.44µs ± 1%    1.50µs ± 2%   +3.74%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/otel-bridge.ndjson-12                 3.15µs ± 1%    3.31µs ± 1%   +4.96%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/ratelimit.ndjson-12                   5.49µs ± 1%    5.73µs ± 2%   +4.50%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/span-links.ndjson-12                  1.18µs ± 2%    1.21µs ± 1%   +2.16%  (p=0.040 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/spans.ndjson-12                       9.27µs ± 1%    9.65µs ± 2%   +4.08%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/transactions-huge_traces.ndjson-12    4.64µs ± 1%    4.75µs ± 1%   +2.34%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/transactions.ndjson-12                9.37µs ± 1%    9.57µs ± 2%   +2.19%  (p=0.032 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/transactions_spans.ndjson-12          9.30µs ± 0%    9.61µs ± 1%   +3.36%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/transactions_spans_rum.ndjson-12      1.56µs ± 1%    1.65µs ± 2%   +5.75%  (p=0.008 n=5+5)
ReadBatch/minimal-service.ndjson-12                                                                 10.4µs ±19%    12.9µs ±17%  +24.27%  (p=0.032 n=5+5)
pkg:github.com/elastic/apm-server/internal/publish goos:linux goarch:amd64
Publisher-12                                                                                         1.00s ± 0%     1.00s ± 0%   +0.09%  (p=0.008 n=5+5)
pkg:github.com/elastic/apm-server/x-pack/apm-server/aggregation/spanmetrics goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/x-pack/apm-server/aggregation/txmetrics goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/x-pack/apm-server/sampling goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/x-pack/apm-server/sampling/eventstorage goos:linux goarch:amd64
WriteTransaction/json_codec-12                                                                      12.1µs ±22%     4.3µs ±10%  -64.88%  (p=0.008 n=5+5)
WriteTransaction/json_codec_big_tx-12                                                               13.5µs ±53%     4.8µs ± 4%  -64.72%  (p=0.008 n=5+5)
ReadEvents/json_codec/0_events-12                                                                    352ns ±13%     315ns ±10%  -10.32%  (p=0.032 n=5+5)
ReadEvents/json_codec/1_events-12                                                                   10.3µs ± 9%     9.2µs ± 1%  -11.36%  (p=0.016 n=5+4)
ReadEvents/json_codec/399_events-12                                                                 2.90ms ± 5%    2.79ms ± 1%   -3.60%  (p=0.016 n=5+5)
ReadEvents/json_codec_big_tx/0_events-12                                                             334ns ± 5%     306ns ± 4%   -8.37%  (p=0.008 n=5+5)
ReadEvents/nop_codec/0_events-12                                                                     338ns ± 6%     307ns ± 6%   -9.13%  (p=0.016 n=5+5)
ReadEvents/nop_codec_big_tx/0_events-12                                                              332ns ± 5%     301ns ± 8%   -9.26%  (p=0.032 n=5+5)
IsTraceSampled/sampled-12                                                                           77.6ns ± 3%    67.3ns ± 2%  -13.26%  (p=0.008 n=5+5)
IsTraceSampled/unsampled-12                                                                         79.1ns ± 1%    69.1ns ± 6%  -12.66%  (p=0.008 n=5+5)
IsTraceSampled/unknown-12                                                                            421ns ± 2%     379ns ± 2%   -9.93%  (p=0.008 n=5+5)

name                                                                                              old alloc/op   new alloc/op   delta
pkg:github.com/elastic/apm-server/internal/agentcfg goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/internal/beater/request goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/internal/model/modelindexer goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/internal/processor/stream goos:linux goarch:amd64
BackendProcessor/events.ndjson-12                                                                   39.7kB ± 1%    40.2kB ± 1%   +1.27%  (p=0.016 n=5+5)
BackendProcessor/optional-timestamps.ndjson-12                                                      4.48kB ± 1%    4.59kB ± 2%   +2.25%  (p=0.032 n=5+5)
BackendProcessor/ratelimit.ndjson-12                                                                11.4kB ± 1%    11.5kB ± 2%   +1.24%  (p=0.032 n=5+5)
BackendProcessor/span-links.ndjson-12                                                               4.67kB ± 1%    4.79kB ± 1%   +2.54%  (p=0.008 n=5+5)
BackendProcessor/transactions_spans_rum_2.ndjson-12                                                 5.52kB ± 1%    5.59kB ± 1%   +1.31%  (p=0.032 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel2/minimal-service.ndjson-12               4.10kB ± 1%    4.04kB ± 1%   -1.42%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/errors_transaction_id.ndjson-12       19.4kB ± 0%    19.4kB ± 1%   +0.39%  (p=0.032 n=5+5)
ReadBatch/heavy.ndjson-12                                                                            824kB ± 0%     823kB ± 0%   -0.17%  (p=0.008 n=5+5)
ReadBatch/invalid-json-event.ndjson-12                                                              3.23kB ± 0%    3.23kB ± 0%   -0.03%  (p=0.029 n=4+4)
ReadBatch/minimal.ndjson-12                                                                         4.67kB ± 0%    4.68kB ± 0%   +0.12%  (p=0.016 n=5+5)
ReadBatch/transactions-huge_traces.ndjson-12                                                        13.8kB ± 0%    13.8kB ± 0%   +0.05%  (p=0.048 n=5+5)
ReadBatch/transactions_spans.ndjson-12                                                              22.8kB ± 0%    22.8kB ± 0%   +0.06%  (p=0.040 n=5+5)
ReadBatch/unknown-span-type.ndjson-12                                                               16.8kB ± 0%    16.8kB ± 0%   +0.09%  (p=0.016 n=5+5)
pkg:github.com/elastic/apm-server/internal/publish goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/x-pack/apm-server/aggregation/spanmetrics goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/x-pack/apm-server/aggregation/txmetrics goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/x-pack/apm-server/sampling goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/x-pack/apm-server/sampling/eventstorage goos:linux goarch:amd64
WriteTransaction/json_codec-12                                                                      3.00kB ± 0%    3.00kB ± 0%   -0.03%  (p=0.008 n=5+5)
WriteTransaction/json_codec_big_tx-12                                                               3.90kB ± 0%    3.90kB ± 0%   -0.04%  (p=0.008 n=5+5)
ReadEvents/nop_codec_big_tx/1000_events-12                                                          2.19MB ± 1%    2.17MB ± 0%   -0.61%  (p=0.016 n=5+4)

name                                                                                              old allocs/op  new allocs/op  delta
pkg:github.com/elastic/apm-server/internal/agentcfg goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/internal/beater/request goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/internal/model/modelindexer goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/internal/processor/stream goos:linux goarch:amd64
BackendProcessor/events.ndjson-12                                                                      716 ± 0%       717 ± 0%   +0.14%  (p=0.016 n=4+5)
ReadBatch/heavy.ndjson-12                                                                            22.1k ± 0%     22.1k ± 0%   -0.01%  (p=0.000 n=5+4)
pkg:github.com/elastic/apm-server/internal/publish goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/x-pack/apm-server/aggregation/spanmetrics goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/x-pack/apm-server/aggregation/txmetrics goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/x-pack/apm-server/sampling goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/x-pack/apm-server/sampling/eventstorage goos:linux goarch:amd64

name                                                                                              old speed      new speed      delta
pkg:github.com/elastic/apm-server/internal/processor/stream goos:linux goarch:amd64
BackendProcessor/events.ndjson-12                                                                 57.3MB/s ±23%  42.0MB/s ±22%  -26.77%  (p=0.032 n=5+5)
BackendProcessor/heavy.ndjson-12                                                                   113MB/s ±18%    83MB/s ±15%  -26.15%  (p=0.008 n=5+5)
BackendProcessor/invalid-json-metadata.ndjson-12                                                  26.3MB/s ± 8%  20.5MB/s ±27%  -22.07%  (p=0.016 n=5+5)
BackendProcessor/ratelimit.ndjson-12                                                              90.8MB/s ± 7%  78.7MB/s ±13%  -13.34%  (p=0.032 n=5+5)
RUMV3Processor/rum_errors.ndjson-12                                                                124MB/s ±14%    97MB/s ± 6%  -21.27%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel2/optional-timestamps.ndjson-12          194MB/s ±10%   215MB/s ± 7%  +10.51%  (p=0.032 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel8/errors_2.ndjson-12                     598MB/s ± 0%   593MB/s ± 1%   -0.76%  (p=0.032 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel8/optional-timestamps.ndjson-12          570MB/s ± 1%   541MB/s ± 8%   -5.08%  (p=0.016 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel8/otel-bridge.ndjson-12                  506MB/s ± 1%   483MB/s ± 1%   -4.43%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel8/ratelimit.ndjson-12                    689MB/s ± 1%   630MB/s ± 1%   -8.50%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel8/span-links.ndjson-12                   447MB/s ± 1%   428MB/s ± 1%   -4.08%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel8/spans.ndjson-12                        759MB/s ± 1%   706MB/s ± 0%   -6.99%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel8/transactions-huge_traces.ndjson-12     572MB/s ± 2%   556MB/s ± 1%   -2.66%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel8/transactions_spans.ndjson-12           527MB/s ± 1%   515MB/s ± 0%   -2.34%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel8/transactions_spans_rum.ndjson-12       573MB/s ± 2%   558MB/s ± 1%   -2.69%  (p=0.016 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel8/transactions_spans_rum_2.ndjson-12     576MB/s ± 1%   559MB/s ± 0%   -2.93%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel8/unknown-span-type.ndjson-12            456MB/s ± 0%   443MB/s ± 1%   -2.77%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/errors.ndjson-12                     872MB/s ± 2%   838MB/s ± 1%   -3.91%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/errors_2.ndjson-12                   691MB/s ± 1%   670MB/s ± 2%   -2.95%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/errors_rum.ndjson-12                 973MB/s ± 2%   944MB/s ± 1%   -3.00%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/errors_transaction_id.ndjson-12      707MB/s ± 1%   688MB/s ± 1%   -2.68%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/events.ndjson-12                     569MB/s ± 1%   556MB/s ± 1%   -2.27%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/invalid-event-type.ndjson-12         491MB/s ± 2%   478MB/s ± 2%   -2.77%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/invalid-event.ndjson-12              231MB/s ± 0%   223MB/s ± 1%   -3.21%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/invalid-json-metadata.ndjson-12      236MB/s ± 0%   230MB/s ± 1%   -2.68%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/invalid-metadata-2.ndjson-12         890MB/s ± 1%   862MB/s ± 1%   -3.14%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/invalid-metadata.ndjson-12           906MB/s ± 1%   882MB/s ± 1%   -2.63%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/metadata-null-values.ndjson-12       694MB/s ± 0%   671MB/s ± 1%   -3.35%  (p=0.016 n=4+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/metadata.ndjson-12                  1.00GB/s ± 1%  0.98GB/s ± 2%   -2.41%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/metricsets.ndjson-12                 576MB/s ± 1%   562MB/s ± 1%   -2.43%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/minimal-service.ndjson-12            444MB/s ± 1%   430MB/s ± 1%   -2.97%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/minimal.ndjson-12                    526MB/s ± 2%   507MB/s ± 2%   -3.51%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/optional-timestamps.ndjson-12        711MB/s ± 1%   686MB/s ± 2%   -3.59%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/otel-bridge.ndjson-12                597MB/s ± 1%   569MB/s ± 1%   -4.72%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/ratelimit.ndjson-12                  768MB/s ± 1%   735MB/s ± 2%   -4.30%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/spans.ndjson-12                      866MB/s ± 1%   832MB/s ± 2%   -3.92%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/transactions-huge_traces.ndjson-12   683MB/s ± 1%   667MB/s ± 1%   -2.29%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/transactions.ndjson-12               603MB/s ± 1%   590MB/s ± 2%   -2.13%  (p=0.032 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/transactions_spans.ndjson-12         626MB/s ± 0%   605MB/s ± 1%   -3.25%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/transactions_spans_rum.ndjson-12     739MB/s ± 1%   699MB/s ± 2%   -5.43%  (p=0.008 n=5+5)
ReadBatch/minimal-service.ndjson-12                                                               41.3MB/s ±22%  33.2MB/s ±15%  -19.65%  (p=0.032 n=5+5)

report generated with https://pkg.go.dev/golang.org/x/perf/cmd/benchstat

@axw axw force-pushed the relocate-libbeat-output branch 2 times, most recently from 27b4e88 to 188a8f5 Compare October 2, 2022 04:04
axw added 2 commits October 9, 2022 17:58
This is something that should run just once for
the lifetime of the process. I'm intending to
move the reload logic out of beater and into
beatcmd (or a subpackage).
Move initialisation of libbeat output (publisher/pipeline)
and instrumentation (APM tracer) to package beater. Some of
the complexity around reloading is reduced as now have full
control over creating the libbeat output. Similarly, we can
reduce complexity related to the "tracer server" by running
it per reloaded server.
@axw axw force-pushed the relocate-libbeat-output branch from 188a8f5 to 3669a35 Compare October 9, 2022 10:00
@axw axw requested a review from a team October 10, 2022 03:13
@axw axw marked this pull request as ready for review October 10, 2022 03:13
Copy link
Contributor

@simitt simitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The seperation into beatcmd and beater makes this much more readable. Only left one question ..

ctx, reload.ReloadableFunc(reloader.reloadOutput),
)
})
reload.Register.MustRegister("output", reload.ReloadableFunc(reloader.reloadOutput))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this done in its own go routine before (and is not necessary anymore)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously libbeat registered the reloader, and we added our own reloader. IIRC there was a timing issue that meant we had to register the hook before the "reloader" was created. So what we did was created a channel, and then received requests off that channel after starting the server.

We no longer handle output reloading in libbeat or in beatcmd, so we can simplify it all.

@axw axw enabled auto-merge (squash) October 12, 2022 09:21
@axw axw merged commit 681525b into elastic:main Oct 12, 2022
@axw axw deleted the relocate-libbeat-output branch October 12, 2022 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-skip Skip notification from the automated backport with mergify
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TestServerTracingEnabled is flaky
3 participants