Skip to content

Conversation

oleg-kozlyuk-grafana
Copy link
Contributor

No description provided.

}

blockFile := bufferpool.GetBuffer(len(stream.heads) * 2 / 1024) // rough estimate, 2kb per head
blockFile := bufferpool.GetBuffer(2 * 1024) // reserve extra to avoid resizes
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we maybe remember the size of the buffer between flushes?

Also 2k is likely too short

Not sure if you have access https://ops.grafana-ops.net/goto/bey8h9q72mu4gd?orgId=1

image

Do you know why was it divided by 1024? Was it a bug?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The division was a typo - sorry about that, already fixed before comment.

Good point about buffer size - I tried to take a safe route, but it looks like - esp. considering how bufferpool works - it won't work. Will rethink

@oleg-kozlyuk-grafana oleg-kozlyuk-grafana marked this pull request as draft September 19, 2025 08:27
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

Successfully merging this pull request may close these issues.

2 participants