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

Make a background persistence thread (write back) #210

Closed
petethepig opened this issue May 23, 2021 · 1 comment
Closed

Make a background persistence thread (write back) #210

petethepig opened this issue May 23, 2021 · 1 comment
Assignees
Labels
backend Mostly go code storage Low level storage matters

Comments

@petethepig
Copy link
Member

petethepig commented May 23, 2021

Currently the only time pyroscope saves data on disk is when it stops or when the cache is overflowing. On large data sets this takes a long time, sometimes over 10 seconds.

Most service managers, e.g systemd or supervisord have a stop timeout of about 10 seconds. This means that if the process takes more than 10 seconds to stop they SIGKILL the process, leading to data loss.

This problem will become even bigger once we implement #167 because on larger systems it will take even more time to finish writes.

We need to change our cache system in such a way that it would write to disk more often, before we stop the process.

I draw a little illustration for this:

Note May 23, 2021


It's also important to not write too much, because in that case we're risking overloading disk, which would not be great.

@petethepig
Copy link
Member Author

We could also improve write performance with:

  • concurrent writes (multiple goroutines)
  • batched writes

@petethepig petethepig added backend Mostly go code storage Low level storage matters labels May 25, 2021
@petethepig petethepig added this to In progress in Pyroscope Public Roadmap Jun 2, 2021
@petethepig petethepig changed the title Make a background persistence thread Make a background persistence thread (write back) Jun 9, 2021
@petethepig petethepig moved this from In progress to Done in Pyroscope Public Roadmap Jun 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Mostly go code storage Low level storage matters
Development

No branches or pull requests

2 participants