-
Notifications
You must be signed in to change notification settings - Fork 10.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
gatsby develop can only serve 5 pages at a time #12225
Comments
@jeffrafter This is a limitation of the browser you are using. When you are developing with GatsbyJS there is a connection to the GraphQL endpoint open and all of the pages queries are then rendered based on the live queries, this is how getting live data to the pages you are editing works in the back ground. However, each browser has a limited set of connections that it uses to connect to the same end point. In chrome, this limit is 5, when you exceed that limit, chrome restricts the connection until one has been freed up and can connect. I hope this helps. |
@adamclifford whoa! Today I learned! Could you provide a source on that? Would be helpful to document for posterity. In any case--this doesn't seem like an issue we can resolve within Gatsby, and we're not doing anything outside the ordinary (apart from opening up a web socket) that would cause any weirdness here! Going to close as answered--but please reply if we missed something or if the above is off-base. Thanks for using Gatsby! 💜 |
@DSchau the HTTL/1.1 specification stipulates 2 connections as a limit, as can be read here. This is a form of protection against DDoS attacks. I cant find an official list of available limits, but Pushtechnology has a list of the current ones. |
@adamclifford thanks for those links, this is super helpful; I never realized that limit was per browser not per tab!
Is this just for HMR? Do you know if there is a config/fallback strategy for polling instead of open connections? |
Yep! We build out the data from the local GraphQL schema, so there isn't a trace of that in the production code.
Not really. Generally - is this something you do often? 5 open tabs with the same content seems to be a little overkill, but maybe there's a use case we're missing here with our current strategy! |
@DSchau it isn't a great use case... I just keep a lot of tabs open and forget some on a desktop here or there. Then I open a new tab and it is empty and I wait and then 10-15 seconds later realize "Oh, I must have 5 other tabs open somewhere" and go hunt them down through my mess of desktops and tabs and disorganization. Often it is different pages with different styling and I want to see the impact of a new header or something across them. So I have to open/close open/close. My understanding is that this is not a problem in HTTP/2 because of multiplexing. I wonder if there is a way to move to HTTP/2 or some other connection mechanism that is more forgiving of disorganized people like myself 🤹♂️ |
Huh, this is an unfortunate bug. We could change from websockets to long-polling to solve this. It shouldn't have much effect on performance. |
Actually, I spent some time digging into this... if we upgrade the development experience to I changed this line to:
Then I ran Note, I tried to run SPDY in non-TLS (this does not work): let server = require(`spdy`).createServer(
{
spdy: {
plain: true,
ssl: false,
},
},
app,
) Running in plain mode with no SSL correctly serves pages with no |
Of course! Consider it done! |
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here. If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open! Thanks for being a part of the Gatsby community! 💪💜 |
Hey again! It’s been 30 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it. Please keep in mind that I’m only a robot, so if I’ve closed this issue in error, I’m Thanks again for being part of the Gatsby community! |
This showed up in Sizzy. cc @kitze |
Yup. It'd be cool if at least I can change something in Sizzy so it works. |
It looks like there's a workaround in Electron ( |
@jlengstorf I think this has to be implemented on the browser side. Firefox has this setting in |
Could Gatsby listen at multiple ports or hostnames (is the limit per-port or per-hostname)? If so, we could potentially monitor the total number of connections per browser (doesn't have to be perfect: a user-agent heuristic probably works fine) and automatically add another port/hostname to the pool when we get close to the limit. Alternately, there are approaches to allow for sharing data across tabs which would limit the need for multiple websocket connections, but this is enough of an edge case that I don't know that it would merit the complications that such an approach would bring. |
Many component libraries show examples in iframes, so they are isolated from the documentation page. I guess there isn't any workaround to enable opening multiple Gatsby pages in iframes inside one page? |
This comment has been minimized.
This comment has been minimized.
Hi! I'm closing this as a stale issue as in the meantime Gatsby 4 and related packages were released. You can check our Framework Version Support Page to see which versions currently receive active support. Please try the mentioned issue on the latest version (using the Thanks! |
I'm using the latest version of GATSBY (4.15.2) and the problem still exists, this issue needs to be reopened. I turned on HTTPS mode, but I still have the same problem. |
In Firefox, increasing the config value |
Description
When running
gatsby develop
everything works perfectly and fast for the first 5 pages I open (in multiple tabs). Subsequent pages opened in new tabs hang indefinitely. When I close one of the previously opened tabs the last pages load immediately. I've tried to see if this is related to similar issues including (#12143, #11747 #10257 and #11727) but it seems different.Steps to reproduce
Start
gatsby develop
, open a bunch of tabs simultaneously.Expected result
All of them load, HMR is ready.
Actual result
Only the first four load, the others hang.
Environment
The text was updated successfully, but these errors were encountered: