-
Notifications
You must be signed in to change notification settings - Fork 1
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
Performance degradation in Firefox 130 when accessing localhost and external websites #302
Comments
Thanks for the report. I've just done some testing with Firefox 130.0-1+rpt7 and using Our downstream Firefox package only has minimal changes from the official Firefox releases (specifically making widevine work, a graphics buffer allocation fix, and a couple of compilation-issue patches. There are also a few patches we inherit from Debian's Firefox packages) so this is very likely not a problem specific to the Raspberry Pi Firefox package. I recommend reporting this on the Mozilla bug-tracker as the issue will go to someone with some expertise in the network code. (I've always found people extremely helpful on the mozilla tracker if you're happy to try out their suggestions/diagnostics) If you can reproduce the problem somewhat reliably with official Mozilla builds then you could use mozregression to work out the specific commit which introduced the breakage, at which point I'm sure someone at Mozilla would be able to fix this. I believe mozregression only started including aarch64-linux builds relatively recently so you might need to do it with x86_64 builds. |
Yes, I encountered this issue exactly using python3 http.server with HTTP protocol. I was using it to simulate a local server for debugging code. However, I used different server tweaks in the code because I couldn’t get chunked POST responses to work properly in either Chromium and Firefox. The key changes included switching the protocol to HTTP/1.1 and varying the way I formatted the headers for the chunked response. Eventually, the issues became persistent, so I reverted to using the default HTTP protocol. I was able to implement it in that way to get both browsers to accept the response consistently. But what I notice, is that after switching back to the default HTTP protocol, the problem with Firefox occurred much less frequently. I also encountered several instances in the js debugger (browser console) where the server successfully processed a request and sent a response, but the browser didn’t see the response and continued to wait for it. I was able to reproduce this at least five times in a row. However, it's important to note that the problem is not limited to localhost, it occurs with any site on the internet. The issue is floating and unpredictable, as I cannot reliably reproduce it. When it happens the browser's GUI remains responsive, so it appears to be related to the network stack code. As I mentioned earlier, I checked it with Wireshark, and it turned out that Firefox just doesn't establish a connection at all, even though graphically it shows that the request is being processed... Previous versions didn’t exhibit this behavior. I can’t say for sure whether it started with version 129 or 130, but version 128 definitely worked fine. The issue is quite unusual. I tried to investigate it using Wireshark, but it turned out that when this occurs, the browser doesn’t even send the requests. Something is malfunctioning within the browser, and it's unclear what exactly. This typically happens in the middle of loading a large webpage—some requests are completed, but then something goes wrong, and the browser stops sending further requests, although it graphically shows as sending them and waiting for a response. Wireshark clearly shows that only part of the expected requests for the page load are actually sent. I also noticed very strange behavior when modifying the code generating POST responses on the server. It seemed that Firefox was retrieving responses from the cache, even though it was making requests and receiving responses. Initially, I couldn’t figure out why the code wasn’t working in Firefox, but after restarting the browser, it suddenly started working, despite no changes being made on the server side. At first, I suspected packet routing issues, but adding the route with I also occasionally encountered strange issues with websites failing to load, even though they worked fine in Chromium. |
Is it possible that there's some kind of filesystem corruption on your SD card? Are you able to reproduce this problem on a freshly-written Bookworm image? |
Some new findings: this issue can be reproduced if you click the 'Reload' button on Firefox in a loop for a heavy page. It goes into a strange state where you click the Reload button, but it doesn't send a request to the server anymore. Steps to reproduce:
Expected result: the page is reloaded with no issue Actual result: nothing happens, the browser even don't send request to the server Additional info: there are no log messages about errors when you run Firefox from the console and no errors in The same issue happens for other sites as well as for a site hosted on localhost. The Chomium browser don't have this issue. |
Good reproducer, I've just managed to immediately see this issue on my Pi5. But I can also reproduce it on my amd64 debian laptop, so it's not Raspberry Pi specific. Please could you report this on https://bugzilla.mozilla.org/ as they will be much more able to help. With this simple and reliable reproducer I'm certain that they'll get this fixed quickly. |
I can also reproduce this with Firefox 131.0 on Windows 10. Could you link me to the BMO issue when you make it, I'm curious to follow along and see what causes this. Also interesting is that the whole tab is totally dead - even if you try to navigate to a different URL, nothing happens. But when you switch a different tab it's just fine. |
I have no account on bugizlla and I'm too lazy to register. Could you please add it? |
it is not dead, if you open dev-tools (F12) before reproduce it, you can continue use dev-tools on that tab. But page area is really dead and don't respond. I also was seen the same issue which happens in the middle of page load... |
Ok, reported upstream at https://bugzilla.mozilla.org/show_bug.cgi?id=1923881 |
thanks I read the issue on bugzilla and as Andrew Sutherland said:
I can also say that I had many similar issues when debugging my custom XHR response format on the server side. Therefore, it is quite likely that the problem is somehow related to the implementation of XHR in Firefox's code. He also wrote:
But I reproduced this bug with a localhost running on Python3 using In fact, Firefox simply doesn't send the request to the server at all, which was confirmed with a Wireshark capture. |
After upgrading to Firefox version 130, I noticed significant performance issues compared to version 128. Pages, including those hosted on a localhost server, experience intermittent hangs, with some pages failing to load entirely. The browser sometimes gets stuck with the loading indicator spinning indefinitely, and no requests are sent to the server.
Notes: The issue is noticeable even with external websites, though I initially attributed it to internet connectivity issues. The problem became more apparent when testing with localhost, where no external factors could influence the connection. The behavior change was observed immediately after the upgrade to version 130.
I also noticed that switching the POST response from chunked mode to regular mode on web server side might resolve the issue, though I can't say for sure since the problem is floating and cannot be consistently reproduced.
At a glance, it looks like an issue in the Firefox network stack code. I suspect this might be related to DNS, as when the issue occurs, the browser doesn't even send some of the requests that it should be sending.
I want to emphasize that while reproducing the issue in Firefox, I ran Chromium in parallel, and it worked without any problems, whereas Firefox just hangs when refreshing the page or opening the same site. It can be definitively stated that this issue is not related to cookies, as the problem occurred on a local server that doesn't use cookies. It might be some issue with request caching.
The text was updated successfully, but these errors were encountered: