Closed zypA13510 closed 6 months ago
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.
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 therandom_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: fa0ac8cd2336052286cd3556889449660e4d9c83, #487 Close: #613