Data upload halts when tab inactive

Skip to first unread message

Andreas Iakobou

Nov 5, 2023, 2:58:55 PM11/5/23
to Chromium-discuss
Hello everyone,

we are experiencing issues with inactive tabs on the Chrome browser, where transfer of data (upload) significantly slows down when the tab is passive/inactive.

Our use case:
We are developing an application that let's users upload big sets of data. Our upload is implemented with fetch requests using the streaming API, so there is only one http request that is open during the whole upload process, which can take up to and exceed 20-30 minutes, depending on the size of the data.

The problem:
On some occasions, when the user initiates an upload and navigates away from the tab, the upload seems to halt and only continue when the tab is in the foreground. The issue to us seems to occur randomly, as we couldn't find a way to reliably reproduce it. On some machines it doesn't occur at all, on some most of the time and on some in about 50% of the cases. We tried turning off the memory saver mode with no success. When we started Chrome with "/Applications/Google\\ Chrome --disable-background-timer-throttling" the issue seemingly went away, however we can't confirm to 100% that it was the cause since reproducibility is not given.

Some information that might be useful:
- There is an active websocket connection to our backend.
- There are no workers in the background.
- I'm using Chrome Version 118.0.5993.88 on Mac, the issue however also occurred on Windows.
- Memory saver mode does not have an impact on the issue.
- Starting Chrome with background-timer-throttling disabled did seem to help.

To us it looks like is has to do with the background timer throttling but we cannot find out how to influence it. In our upload process we don't actively use timers, but we can't be sure about how the streaming api works internally.

Would you be able to provide us with some more insights on how Chrome decides to throttle background tabs and do you have an idea how to solve this problem?

Thanks a lot, Andy
Reply all
Reply to author
0 new messages