-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Slow download speed of HTTPRequest node #32807
Comments
Same for me |
I've found some workaround, don't know if it would be suitable for you, but though here is the code that could help you: func _process(delta):
if resource_requested:
var t = OS.get_ticks_msec()
while OS.get_ticks_msec() < t + max_time_ms && resource_requested:
$req.notification(NOTIFICATION_INTERNAL_PROCESS) where: |
Well, I've done some tests and it doesn't solve problem at all. I don't know what you meant Mellondill but the download speed didn't change. Could explain the code you made ? |
Hello @HazmatDemon, I've tried to dive deep in classes HTTPRequest and HTTPClient, and found that actual polling of data from TCP socket is done in Due to default read chunk size is 4096 bytes, and due to some circumstances(response headers don't contain 'content-length' attribute, etc.) that the left body length of response couldn't be determined, I've just thought if I can make polling of data not per frame but in a controlled loop. By 'controlled' I meant limiting of polling data in loop for about 5-10 milliseconds per frame, for your application to not have lags, and have stable FPS while data is polled. So basically I'm speeding up |
cc @Faless What would be a good way to solve this? Would a custom timer work for this purpose? |
I'm not sure, blocking for some milliseconds is not an option. The repro project uses threads, and threads should poll continuously (keep blocking) so I'm not sure why this is happening. |
I haven't had time to investigate this further sadly |
I am not able to reproduce on linux Mint On Windows |
I tested it again (the same code from earlier), this time on Ubuntu and Manjaro and got 10 - 12 MB/s. It seems like Linux doesn't have problems at all. |
I was able to reproduce this on windows, and it seems related to the small chunk size we were using in the |
Same issue here... any progress? |
@vitorventurin Did you increase the download chunk size in HTTPRequest? The default is still 4 KiB, which is slow for downloading large files. See #33862. |
This improves download speeds at the cost of increased memory usage. This change also effects HTTPRequest automatically. See godotengine#32807 and godotengine#33862.
This improves download speeds at the cost of increased memory usage. This change also effects HTTPRequest automatically. See godotengine#32807 and godotengine#33862. (cherry picked from commit 1335709)
This improves download speeds at the cost of increased memory usage. This change also effects HTTPRequest automatically. See godotengine#32807 and godotengine#33862.
This improves download speeds at the cost of increased memory usage. This change also effects HTTPRequest automatically. See godotengine#32807 and godotengine#33862. (cherry picked from commit 1335709)
Godot version:
OS/device including version:
Issue description:
I wanted to download a file from my server ( Ubuntu Server 18.04 ) that is connected to my local network. The file has 100MB. As I found out, the best way to do this is over HTTPRequest node. The problem is with download speed. I have set up new project that prints the download speed (I included the zipped project). I have also done some tests. Here I included them:
Bandwidth: 200 Mb/s
First Test
File: From my local server.
File size: 100 MB
Second Test
File: from https://speed.hetzner.de/
File size: 100 MB
The difference is clearly visible.
Steps to reproduce:
Minimal reproduction project:
To import this project use the import feature at the project manager
HttpTest.zip
The text was updated successfully, but these errors were encountered: