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

Documentation request / question #768

Closed
asg0451 opened this issue Jun 14, 2024 · 1 comment
Closed

Documentation request / question #768

asg0451 opened this issue Jun 14, 2024 · 1 comment

Comments

@asg0451
Copy link
Contributor

asg0451 commented Jun 14, 2024

I've been struggling to understand exactly how franz does batching/buffering of records. If I'm sending in record after record for a given topic-partition, how large will franz's batches be? And is there a way to configure it. What is the procedure it uses? Reading the code and available options did not enlighten me.

@twmb
Copy link
Owner

twmb commented Jun 22, 2024

https://pkg.go.dev/github.com/twmb/franz-go/pkg/kgo#ProducerBatchMaxBytes
https://pkg.go.dev/github.com/twmb/franz-go/pkg/kgo#ProducerLinger

  • Is any data available, and is the client ready to create a batch? If yes, cut batch and send it. This can happen immediately after you Produce one record. If you have high record throughput, eventually you'll reach backpressure while enough produce requests are in flight that you'll send larger batches.
  • If the client cannot send a new batch at the moment (maybe max in flight has been reached, maybe linger is configured), has the maximum amount for a single batch been buffered? If yes, cut batch, begin buffering new batch internally.

@twmb twmb closed this as completed Jun 22, 2024
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