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

Add per-query or global throttle to subscription rate #89

Open
fnoop opened this issue Jan 27, 2019 · 4 comments
Open

Add per-query or global throttle to subscription rate #89

fnoop opened this issue Jan 27, 2019 · 4 comments

Comments

@fnoop
Copy link
Member

fnoop commented Jan 27, 2019

The subscription update frequency seems to be the same frequency as -api receives messages from its source. If the frequency is too high it overwhelms the various browser mechanisms that take the updates and process and display the data.
Some screens contain several or many queries/subscriptions, each of which update at 10hz or higher. This means the browser may have to process total updates at 50-100+hz which causes performance problems.

We can add two ways to deal with this:

  • Client throttle - add a mechanism within -web code to only allow updates per second per message. This has been implemented within the client in a test component, but to add everywhere throughout the code will be quite extensive addition of code.
  • Server throttle - add a mechanism within -api to restrict the frequency of subscription updates. This would greatly simplify client implementation.
@SamuelDudley
Copy link
Member

I think we could add something into the subscription query and just throttle the data at the -api websocket?

@SamuelDudley
Copy link
Member

Throttling at the web socket seems possible, but we need a way to pass the throttle information with the subscription.
@fnoop I'll add a optional maxHz integer variable to one of the subscriptions (say IMU) and we can experiment with that. If you can think of a cleaner way or have other thoughts let me know.

@SamuelDudley
Copy link
Member

The client would also need to cancel the subscription and reissue it if it wanted to update the maxHz value.
@fnoop Do you see this as an issue?

@fnoop
Copy link
Member Author

fnoop commented Jan 30, 2019

No, sounds good to me :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants