gnmic icon indicating copy to clipboard operation
gnmic copied to clipboard

Question about setting stream window size

Open asagrat opened this issue 1 year ago • 6 comments

Hi All,

Is there any option to explicitly set window size? Or it's hardcoded? What is the value in this case?

Maybe window size is dynamically calculated based on some system/environment factors (so that implicitly we can influence window size)?

asagrat avatar Aug 14 '24 15:08 asagrat

This is handled by the underlying gRPC package. Is there is a specific reason you want to manually set the window size ?

karimra avatar Aug 15 '24 22:08 karimra

Recommendation is coming from the vendor - increasing window size upto 5MB. This is based on the number of subscribed paths and volume of streamed data. Not mandatory but will help with efficiency.

"This is handled by the underlying gRPC package" - anything I can modify there to increase window size?

On Thu, Aug 15, 2024 at 3:26 PM Karim Radhouani @.***> wrote:

This is handled by the underlying gRPC package. Is there is a specific reason you want to manually set the window size ?

— Reply to this email directly, view it on GitHub https://github.com/openconfig/gnmic/issues/508#issuecomment-2292396244, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXLESORGDCKIWHUYMB7XRVDZRUTKHAVCNFSM6AAAAABMQUMJ56VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJSGM4TMMRUGQ . You are receiving this because you authored the thread.Message ID: @.***>

asagrat avatar Aug 21 '24 17:08 asagrat

Not mandatory but will help with efficiency.

Just out of curiosity, how is the efficiency defined in this case?

We can expose the InitialConnWindowSize and InitialWindowSize settings, which disable the dynamic BDP estimator and allow you to manually configure the initial window size for the connection and streams. That should be a trivial change

Maybe window size is dynamically calculated based on some system/environment factors (so that implicitly we can influence window size)?

It is, based on BDP. https://github.com/grpc/grpc-go/blob/master/internal/transport/bdp_estimator.go

LimeHat avatar Aug 21 '24 18:08 LimeHat

It was seen that in some cases the negotiated window size was not the optimal for whatever reasons (too low). This could lead to some negative side effects (without going into much details of it). Correspondingly, switching to a static higher window size has shown an overall 'improvement'. This is especially emphasized in case of a large streaming data volume.

On Wed, Aug 21, 2024 at 11:10 AM Sergey Fomin @.***> wrote:

Not mandatory but will help with efficiency.

Just out of curiosity, how is the efficiency defined in this case?

We can expose the InitialConnWindowSize and InitialWindowSize settings, which disable the dynamic BDP estimator and allow you to manually configure the initial window size for the connection and streams. That should be a trivial change

Maybe window size is dynamically calculated based on some system/environment factors (so that implicitly we can influence window size)?

It is, based on BDP.

https://github.com/grpc/grpc-go/blob/master/internal/transport/bdp_estimator.go

— Reply to this email directly, view it on GitHub https://github.com/openconfig/gnmic/issues/508#issuecomment-2302678509, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXLESOQMKDLJJ3HG255BFVDZSTJX5AVCNFSM6AAAAABMQUMJ56VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBSGY3TQNJQHE . You are receiving this because you authored the thread.Message ID: @.***>

asagrat avatar Aug 21 '24 23:08 asagrat

You can increase the target buffer size to move more messages at once from gRPC to the output(s).

targets:
  router1:
    # other fields
    buffer-size: 1000 # defaults to 100

If you consider that the window size is not enough, it's probably that gNMIc is not able to write fast enough to the output and the gRPC congestion control is kicking in. There are ways to improve that depending on which output you are using.

karimra avatar Aug 22 '24 19:08 karimra

This issue is stale because it has been open for 12 months with no activity.

github-actions[bot] avatar Oct 10 '25 02:10 github-actions[bot]