Slow download speed using HTTPClient

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By gp1

Steps:
1.
Using my iPad and Safari to download a file from S3 takes 3 seconds which is fine considering the size of the file.

Using my Godot app (which uses HTTPClient) installed on the iPad, it takes 13 - 15 seconds to do the same operation as 1.

For number 1 and 2, the connection to S3 is done via my router and a firewall is involved as well.

Using my Godot app installed on the iPad connected to internet via mobile network it takes 3 seconds to do the same operation as 1 which is fine.

Why does HTTPCliect has problems with my router and Safari doesn’t?

(Using HTTPRequest you get the same issue but it is even slower.)

Thank you in advance!

:bust_in_silhouette: Reply From: Calinou

Try increasing the download chunk size to 64 KB. In Godot 3.2.3, the default download chunk size is 4 KB which is way too low for large file downloads. In 3.3, the default will be raised to 64 KB.

Hi Calinou,

I tried increasing the chunk size gradually all the way up to 16mb
maximum. Performance did increase but it was still only a fraction of
that of Safari’s fluctuating between 40-80% of my download link speed.

I noticed download speeds were overall better at night and slower during
the day. Enabling TLS pretty much resolved the problem greatly
improving the speeds and consistency. Now they are pretty much at what
I’m getting with Safari.

While I’m not 100% sure I suspect there might be throttling going on
based on the UserAgent.

Thank you for your input!

gp1 | 2021-03-17 18:38