Skip to content
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

[Browser] Sending more than 6 simultaneously requests to yagna is blocked by the Chrome-based browsers #3273

Open
grisha87 opened this issue Jul 18, 2024 · 0 comments
Labels
sdk-request issue requested by SDK team todo

Comments

@grisha87
Copy link
Contributor

grisha87 commented Jul 18, 2024

Context

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:

  1. Initiate an operation via REST API and receive results via STOMP queue/topic
  2. Full STOPMP - we initate opration via STOMP call (RPC) and receive the response
@grisha87 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
@grisha87 grisha87 added the sdk-request issue requested by SDK team label Jul 18, 2024
@prekucki prekucki added the todo label Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sdk-request issue requested by SDK team todo
Projects
None yet
Development

No branches or pull requests

2 participants