-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
The Couch DB adapter should use a Shared Worker for the _changes feed #3880
Comments
Should consider implementing Server Side Events at the same time - #3881 |
I've noticed that when running on a local machine, Open MCT cannot be opened in more than 5 tabs even when LocalStorage is being used (instead of CouchDB) because of how webpack works. There is no problem opening more than 5 tabs when NOT running locally. The SharedWorker solution for the changes feed is a good performance improvement regardless of the tabs issue. |
Testing instructions:
On Safari - Start Open MCT in multiple tabs In each tab you should see network requests with this in the URL: "_changes?feed=continuous&style=main_only&heartbeat=50000&filter=_selector" for each tab |
Verified - Testathon - 8/5/2021 |
Verified fixed |
The number of simultaneous HTTP connections is limited to six connections per browser and domain, ie. not per-tab. The Couch DB adapter is currently holding open an HTTP connection, using up one connection, and reducing the number of available connections for everything else to five.
To make matters worse, opening a second tab will hold open a second connection, and so on. Six tabs will use up all available connections to the domain, and hold them open, blocking any other requests.
HTTP/2 would help in this situation, but it is not a good general solution.
A reasonable general solution is to use a dedicated Shared Worker for the _changes feed, which all of the tabs can connect to and receive change events from. This will still reduce our connection pool to five simultaneous connections, but unless Couch DB decide to use WebSockets for the _changes feed I don't see that we have much choice here.
The use of shared workers will mean that the changes feed will not be supported in Safari until they reinstate support for Shared Workers.
The text was updated successfully, but these errors were encountered: