grpc-go icon indicating copy to clipboard operation
grpc-go copied to clipboard

Provide a way to adjust the initial window size that does not also disable BDP estimation

Open dfawley opened this issue 11 months ago • 2 comments

There are at least a couple options here:

  1. Change the existing Dial/ServerOptions (e.g.) so they do not disabled BDP estimation
  • Optionally, add another set of options that does disable BDP estimation.
  1. Add new Dial/ServerOptions to set the size like the existing ones, but which do not also disable BDP esimation.

dfawley avatar Dec 11 '24 23:12 dfawley

Proposal:

  1. Add new settings:
package grpc

func WithStaticStreamWindowSize(int32) DialOption
func WithStaticConnWindowSize(int32) DialOption

func StaticStreamWindowSize(int32) ServerOption
func StaticConnWindowSize(int32) ServerOption

These will behave the same as the current options.

  1. After 2 releases, with a notice that the behavior is changing in the release notes, change the current options so they do not disable BDP estimation. Also add:
func WithInitialStreamWindowSize(int32) DialOption // just does "return WithInitialWindowSize(n)"

func InitialStreamWindowSize(int32) ServerOption // just does "return InitialWindowSize(n)"

And mark WithInitialWindowSize and InitialWindowSize as deprecated.

Rationale:

  • The current options' names imply they only affect the starting window size, but that the window size is adjustable. Leaving the behavior the same, and adding new options that specify a starting size but adjust over time would be confusing for everyone.

dfawley avatar Dec 17 '24 20:12 dfawley

I'm looking into this. Please assign the issue to me.

vinothkumarr227 avatar May 02 '25 06:05 vinothkumarr227

@vinothkumarr227 is this issue completely addressed?

arjan-bal avatar Jun 17 '25 04:06 arjan-bal

@arjan-bal Yeah, this addresses the issue and has also been merged

vinothkumarr227 avatar Jun 17 '25 04:06 vinothkumarr227

Hey , @arjan-bal I dont think the 2nd part of this has been addressed i.e.

After 2 releases, with a notice that the behavior is changing in the release notes, change the current options so they do not disable BDP estimation. Also add: func WithInitialStreamWindowSize(int32) DialOption // just does "return WithInitialWindowSize(n)" func InitialStreamWindowSize(int32) ServerOption // just does "return InitialWindowSize(n)" And mark WithInitialWindowSize and InitialWindowSize as deprecated.

Currently the new and the old dialoptions have a same behavior of disabling the BDP estimation. Correct me if I have misunderstood @vinothkumarr227

eshitachandwani avatar Jun 17 '25 05:06 eshitachandwani

I see, thanks for catching this!

arjan-bal avatar Jun 17 '25 06:06 arjan-bal

The new DialOptions will go into 1.74. Based on https://github.com/grpc/grpc-go/issues/7923#issuecomment-2549600066, we will make the behaviour change in 1.76.

arjan-bal avatar Jun 17 '25 06:06 arjan-bal

Hey , @arjan-bal I dont think the 2nd part of this has been addressed i.e.

After 2 releases, with a notice that the behavior is changing in the release notes, change the current options so they do not disable BDP estimation. Also add: func WithInitialStreamWindowSize(int32) DialOption // just does "return WithInitialWindowSize(n)" func InitialStreamWindowSize(int32) ServerOption // just does "return InitialWindowSize(n)" And mark WithInitialWindowSize and InitialWindowSize as deprecated.

Currently the new and the old dialoptions have a same behavior of disabling the BDP estimation. Correct me if I have misunderstood @vinothkumarr227

yeah , correct

vinothkumarr227 avatar Jun 17 '25 06:06 vinothkumarr227

@vinothkumarr227 v1.75 is released, we should be unblocked to make the pending behaviour changes.

arjan-bal avatar Sep 17 '25 07:09 arjan-bal

Hello! I can pickup the second part of this issue - I'm working it. Please do assign the issue to me.

Pramodh-G avatar Oct 21 '25 16:10 Pramodh-G

I also want to point out a current bug (behavior change) that happened as a part of #8283.

The behavior before this PR was:

  • disable BDP estimation only if opts.InitialWindowSize >= 64KB,

The behavior after this was:

  • WithInitialWindowSize sets opts.StaticWindowSize = true regardless of what size was set in argument.
  • This means, even calling WithInitialWindowSize(1) would have caused BDP estimation to be disabled.
  • This is a change in behavior / bug.

Pramodh-G avatar Oct 22 '25 20:10 Pramodh-G