Closed kapyaar closed 6 days ago
Hi,
Are you able to reproduce this on Firefox?
With Firefox I can POST >10KiB and it's usually in the 1-2ms range (wait time), with the odd 3-6ms outliers.
With chromium I'm seeing much longer times in general usually around 8ms upto to 26ms...
Interesting. And sorry, I should have thought of trying another browser before reporting. Yeah, firefox (127.0.1 (64-bit), and ) seems just fine. I went like 20kb or more, and it submits/ refreshes in ~6-8ms. Went back to Brave, and I can see it jump (from ~7ms to ~55ms) at 337 characters right now.
So, this is more of a Brave artefact then?
It would seem so...
That's very, very strange though. I'd love to try to nail down where the bad interaction is.
Does it fail on a fresh Brave profile? Other Chromium-based browsers? What if the container is running on macOS or Linux? What if you request 127.0.0.1
instead of localhost
? etc.
(If this always crops up for Chromium, and other php servers don't show the same issue, then something in our behavior is violating Chromium's expectations sufficiently that we should try to identify and fix it)
I'm seeing basically the same thing with Firefox and Chromium against nginx + php-fpm.
Firefox's timing are nice and stable in the low single digit ms. Chromiums are all over the place spiking to over 25ms.
Testing on windows/ docker. Just did a quick test on Brave to 127.0.0.1, and the issue seems gone!!. 20kb payload submits refreshes in <10ms. Just to be sure, went back to localhost, and the longer wait-for-server-response delay shows up.
On virtualbox with Ubuntu 24.04, Ran same docker configuration, tested with both Chrome, Brave, Firefox. All three of them loads fast, no noticeable difference, like ~5ms for a 20kb payload.
Okay, so this sounds like something that's specific to Windows / Docker networking and not a defect with Unit.
Thank you so much for the issue report, and for digging into diagnosing it, @kapyaar.
https://github.com/nginx/unit/issues/708 Looks similar to this issue
Interesting. And sorry, I should have thought of trying another browser before reporting. Yeah, firefox (127.0.1 (64-bit), and ) seems just fine. I went like 20kb or more, and it submits/ refreshes in ~6-8ms. Went back to Brave, and I can see it jump (from ~7ms to ~55ms) at 337 characters right now.
So, this is more of a Brave artefact then?
Testing a UNIT php server on windows docker, if a form with post data is above a specific number of characters, the server response shows a repeatable increase in "waiting for server response" section from few milliseconds to 50+ms. Significant for large number of connections.
Here is what I have.
Now, add one more character, make it 248 characters, and submit. the submit and reload time jumps to 50+ms.
Screenshots. Brave Browser, Incognito mode [Version 1.67.116 Chromium: 126.0.6478.71 (Official Build) (64-bit)]
Normal test.php load. ~6-10 ms![image](https://github.com/nginx/unit/assets/4372742/6c1d349a-abe5-4758-bb0d-5f51cef0e339)
Ready to Submit Text (Length=247 characters)![image](https://github.com/nginx/unit/assets/4372742/fdca745d-3533-4b15-9d52-dd4c0b8aa473)
Page reloads on Submit![image](https://github.com/nginx/unit/assets/4372742/40b7abc2-9f88-4d5f-b9a9-7e5fcfc5083e)
Form ready with 248 characters![image](https://github.com/nginx/unit/assets/4372742/64125f29-72fe-4bfd-9d15-522fa84173be)
Page reloads on Submit![image](https://github.com/nginx/unit/assets/4372742/24330bc1-e6c3-4cfe-9202-e02aa53596a6)
NOTES:
~~ long string~~)Hope you guys can replicate this. And hopefully get some suggestions to reduce the sudden jump in wait time.