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

Certain subscriptions may overload clients #1315

Closed
1 of 3 tasks
BasixKOR opened this issue May 31, 2022 · 2 comments
Closed
1 of 3 tasks

Certain subscriptions may overload clients #1315

BasixKOR opened this issue May 31, 2022 · 2 comments
Labels
api/graphql enhancement New feature or request

Comments

@BasixKOR
Copy link
Contributor

Description

After switching from nodeStatus.tip.index to tipChanged subscription, 9c-launcher has experienced severe performance issues due to too frequent subscription responses.

Although this is not a bug per se, it may help if we could introduce a way to limit the frequency of the response of these subscriptions such as throttling etc.

Reproduction

Using Apollo Client with React, assuming the basic configuration is completed, this snippet will cause the application to be stuck for a while.

import { useSubscription, gql } from "@apollo/client";

const TIP_SUBSCRIPTION = gql`
subscription Tip {
  tipChanged {
    index
  }
}
`;

function Component() {
  useSubscription(TIP_SUBSCRIPTION);
  return null;
}

Executed environment

  • Docker (tag: )
  • Through dotnet run (commit: ...(e.g. ))
  • Through NineChronicles launcher (version: ... (e.g. v1000080)): around v100200

Executed GraphQL query

subscription Tip {
  tipChanged {
    index
  }
}

Expected behaviour

We could let the client limit the frequency by passing some arguments.

Additional context

This subscription has been introduced for easing the load of an RPC server.

@BasixKOR BasixKOR added enhancement New feature or request api/graphql labels May 31, 2022
@BasixKOR
Copy link
Contributor Author

BasixKOR commented Sep 14, 2022

Update on the issue: the launcher currently circumvents this issue via handling the updates manually and scheduling them. See planetarium/9c-launcher#1536 for details.

@moreal
Copy link
Contributor

moreal commented Nov 1, 2023

I'm so sorry because it has taken too long time. I fixed it in #2245 PR.

@moreal moreal closed this as completed Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api/graphql enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants