You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
golem-js can be run in WebBrowsers. To deliver functionality, the page using golem-js is making requests to the yagna running on localhost.
Problem
Unfortunately, we run into the limitation of max 6 requests that can be sent at the same time to the same domain - specifically http://localhost:7465/ . For reference, check out this article.
Each browser has a different default value for the maximum parallel connections. For example, in Google Chrome, the default value is 6 connections per domain. This means that Chrome will only make a maximum of 6 HTTP requests to a single domain at the same time.
Why are having the problem?
golem-js polls information from different event endpoints exposed by yagna. At least 3 requests are on-line at the same time:
demand subscription + proposal events
invoice evens
debit note events
agreeement events
This leaves out only 3 requests of free capacity to schedule exe-script requests or fetch exe-script results. If we're actively waiting for events by doing polling or even waiting for Server Sent Events, we're running into that limitation which makes the golem-based application unusable.
What should we change in the platform?
Solution proposal 1
Ideally, yagna woud deliver a single event endpoint that can emit various types of events (Server Sent Events + Event Source with different event types). This would allow us to keep only 1 connection for all kinds of events opened all the time, feeing the rest of the limit for other operations.
To really benefit from that, all kinds of events, even exec-batch-results would have to be delivered.
That is, ofcourse, relevant only in the context of running golem-related things in the browser. If golem-js won't be the beneficiary here, the requestor/provider dashboard will be as these web-apps would be subject of the same limitations as our demo apps.
Solution proposal 2
It seems that switching to HTTP/2 might do the trick for us.
Solution proposal 3 (by reqc)
Implement STOMP server in yagna and communicate using it. We can break this to 2 phases:
Initiate an operation via REST API and receive results via STOMP queue/topic
Full STOPMP - we initate opration via STOMP call (RPC) and receive the response
The text was updated successfully, but these errors were encountered:
grisha87
changed the title
[Browser] Sending more than 6 requests to yagna is blocked by the Chrome-based browsers
[Browser] Sending more than 6 simultaneously requests to yagna is blocked by the Chrome-based browsers
Jul 18, 2024
Context
golem-js
can be run in WebBrowsers. To deliver functionality, the page usinggolem-js
is making requests to the yagna running onlocalhost
.Problem
Unfortunately, we run into the limitation of max 6 requests that can be sent at the same time to the same domain - specifically http://localhost:7465/ . For reference, check out this article.
Why are having the problem?
golem-js
polls information from different event endpoints exposed by yagna. At least 3 requests are on-line at the same time:This leaves out only 3 requests of free capacity to schedule exe-script requests or fetch exe-script results. If we're actively waiting for events by doing polling or even waiting for Server Sent Events, we're running into that limitation which makes the golem-based application unusable.
What should we change in the platform?
Solution proposal 1
Ideally, yagna woud deliver a single event endpoint that can emit various types of events (Server Sent Events + Event Source with different event types). This would allow us to keep only 1 connection for all kinds of events opened all the time, feeing the rest of the limit for other operations.
To really benefit from that, all kinds of events, even exec-batch-results would have to be delivered.
That is, ofcourse, relevant only in the context of running golem-related things in the browser. If
golem-js
won't be the beneficiary here, the requestor/provider dashboard will be as these web-apps would be subject of the same limitations as our demo apps.Solution proposal 2
It seems that switching to HTTP/2 might do the trick for us.
Solution proposal 3 (by reqc)
Implement STOMP server in yagna and communicate using it. We can break this to 2 phases:
The text was updated successfully, but these errors were encountered: