Skip to content
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

fix: download speed is 0 on certain platform #617

Merged
merged 1 commit into from
May 18, 2024

Conversation

zypA13510
Copy link
Contributor

@zypA13510 zypA13510 commented May 5, 2024

Reverting this commit fixed #613 for me. Tested with my own build ghcr.io/zypa13510/librespeed.
I'm not exactly sure why, not a PHP expert, but my guess is that the random_byte() call could be using CSPRNG which is slower. If that is the case, I believe it is perfectly fine to not use CSPRNG, as this is just a speed test not a password generator.

Revert: fa0ac8c, #487
Close: #613

@zypA13510
Copy link
Contributor Author

Just proved my guess: I added %^FB (delay in microseconds between when the request arrived and the first byte of the response headers are written) and %D (the time taken to serve the request, in microseconds) to the apache log format inside the container. As it turns out, the TTFB for the version without random_byte() is 1~5 ms, and using random_byte() increased that to more than 15 seconds.
While I'm still not sure why random_byte() is so slow especially on Synology, like I said, not a PHP expert, but it is pretty clear to me now the random_byte() call is the root cause of #613.

@sstidl sstidl self-assigned this May 18, 2024
@sstidl sstidl merged commit 3034bf2 into librespeed:master May 18, 2024
@zypA13510 zypA13510 deleted the revert-487-patch-1 branch May 19, 2024 06:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Synology docker container: download speed is always 0
2 participants