Skip to content

perf: add log buffer #3947

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

Merged
merged 1 commit into from
Feb 25, 2025
Merged

perf: add log buffer #3947

merged 1 commit into from
Feb 25, 2025

Conversation

kolesnikovae
Copy link
Collaborator

@kolesnikovae kolesnikovae commented Feb 25, 2025

Use of unbuffered synchronous logger affects ingestion latency. In the worst case, if the output is redirected to a file, and the disk system does not cope with the log rate, it may cause 10+ sec. p99 spikes. The problem here is that distributors are stateless but may suffer from side-effects caused by neighbours, which makes it hard to identify the culprit.

image image image
@kolesnikovae kolesnikovae added enhancement New feature or request performance If there's anything we have to be really good at it's this labels Feb 25, 2025
@kolesnikovae kolesnikovae marked this pull request as ready for review February 25, 2025 07:05
@kolesnikovae kolesnikovae requested a review from a team as a code owner February 25, 2025 07:05
@kolesnikovae
Copy link
Collaborator Author

kolesnikovae commented Feb 25, 2025

I decided to use dskit BufferedLogger that does block writes while flushing the buffer. This might still be causing latency spikes; I'll revisit this if we encounter any issues

@kolesnikovae kolesnikovae merged commit 2652020 into main Feb 25, 2025
21 checks passed
@kolesnikovae kolesnikovae deleted the perf/log-buffer branch February 25, 2025 07:23
@kolesnikovae
Copy link
Collaborator Author

kolesnikovae commented Feb 25, 2025

Unfortunately, it did not really help: we should make flush non-blocking.

image
shelldandy pushed a commit to shelldandy/pyroscope that referenced this pull request Mar 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request performance If there's anything we have to be really good at it's this
2 participants