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

Bandwidth-Delay Product algorithm for OkHttp?

Open jmariller opened this issue 3 years ago • 6 comments

Hello,

I have seen that Netty has a BDP feature - any plans to implement the same for OkHttp?

Apologies if this is not the best place to ask.

Many thanks in advance for your support!

jmariller avatar Jun 02 '21 19:06 jmariller

What are the specific use cases for bandwidth-delay product (BDP) in okhttp?

We only enabled the BDP-monitoring logic in netty channel a short while ago that that will increase the window if appropriate.

For now In okhttp you could use manually flow control using OkHttpChannelBuilder.flowControlWindow() setting.

YifeiZhuang avatar Jun 03 '21 01:06 YifeiZhuang

Thank you @YifeiZhuang for the quick feedback!

What are the specific use cases for bandwidth-delay product (BDP) in okhttp?

We are developing an Android application using gRPC, and this app will run on different types of devices (smartphones, screens, smart glasses, etc.) - during our initial tests we noticed that, on some devices - especially the older smart glasses - the data transfer performance could be increased by setting flowControlWindow as you mentioned. However we would prefer to avoid having to set manual flow control, considering that the value may have to be dynamically adjusted per device.

jmariller avatar Jun 03 '21 05:06 jmariller

How much did you need to increase flowControlWindow before you started seeing diminishing returns? Just like 128 KB, or something much higher?

The communication with the older smart glasses, is that going over the Internet to a remote server? Or are you doing some sort of local communication?

ejona86 avatar Jun 08 '21 23:06 ejona86

Thanks for getting back to me @ejona86!

How much did you need to increase flowControlWindow before you started seeing diminishing returns? Just like 128 KB, or something much higher?

It rather started at around 512 KB and became even more noticeable at 1 MB

The communication with the older smart glasses, is that going over the Internet to a remote server? Or are you doing some sort of local communication?

The communication is going via local communication (e.g. WiFi)

jmariller avatar Jun 09 '21 07:06 jmariller

It rather started at around 512 KB and became even more noticeable at 1 MB

The diminishing returns started around 512 KB?

The communication is going via local communication (e.g. WiFi)

Both devices are in the same wifi network though, right?

I can believe that grpc-okhttp could benefit from BDP in some cases. But we probably also want it to be more conservative with its use of PING than grpc-netty for power usage reasons. I'm not sure when we'll get to this.

ejona86 avatar Jun 09 '21 14:06 ejona86

The diminishing returns started around 512 KB?

Yes

Both devices are in the same wifi network though, right?

Yes

I can believe that grpc-okhttp could benefit from BDP in some cases. But we probably also want it to be more conservative with its use of PING than grpc-netty for power usage reasons. I'm not sure when we'll get to this.

I understand. In the meantime we are using Netty on Android device, which seem to be working fine

jmariller avatar Jun 10 '21 05:06 jmariller