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

Compress WAL file #47

Open
weeco opened this issue Nov 2, 2021 · 6 comments
Open

Compress WAL file #47

weeco opened this issue Nov 2, 2021 · 6 comments

Comments

@weeco
Copy link

weeco commented Nov 2, 2021

Another WAL related question: Is it expected to grow really fast? I don't scrape a lot of metrics (I'd guess 1000 metrics / 15s), but after 2 minutes the WAL file has already reached 11MB in file size.

Originally posted by @weeco in #37 (comment)

As noticed in the referenced issue the WAL file gets really big quickly. I wanted to create a separate issue for this to possibly introduce a more compressed way how the WAL file is written.

Maybe you can recommend a workaround to reduce the size of the WAL file. I assume smaller partitions could help with that?

@nakabonne
Copy link
Owner

Thank you for the separated issue for that!


To be honest, the current WAL format prioritizes simplicity. I'm in the middle of looking for another format that reduces the size and doesn't slow down writing and recovery.

Originally posted by @nakabonne in #37 (comment)

@nakabonne
Copy link
Owner

Maybe you can recommend a workaround to reduce the size of the WAL file. I assume smaller partitions could help with that?

As you mentioned, the smaller the size of the partition, the smaller the size per file. But in the end, your overall disk consumption will remain the same.

@weeco
Copy link
Author

weeco commented Nov 2, 2021

But in the end, your overall disk consumption will remain the same.

Is that actually the case? If the lifetime of the WAL file is up to partitionRetention before it is rolled, we can reduce the max wal file size by reducing the partition retention as well right?

Since the WAL file is relatively large (compared to the disk files) it could be worth to reduce the partition retention is that right?

@nakabonne
Copy link
Owner

Ah, you're right.

That workaround works well since all except for the first two partitions will be flushed to disk partitions and the WAL files for them will be deleted 👍

@weeco
Copy link
Author

weeco commented Nov 4, 2021

Just to add some numbers:

My 1h partition is 16MB in size and 2 WAL files take 1GB space.

@nakabonne
Copy link
Owner

Hmm... it is common to set PartitionDuration=1h so it's terrible to require 1GB for WAL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants