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

Cursor payload is too big compared to the useful payload #3811

Closed
maxcherednik opened this issue Nov 18, 2016 · 4 comments
Closed

Cursor payload is too big compared to the useful payload #3811

maxcherednik opened this issue Nov 18, 2016 · 4 comments

Comments

@maxcherednik
Copy link

@maxcherednik maxcherednik commented Nov 18, 2016

Actual behavior

image

image

Steps to reproduce

The logic of the application assumes that there are number of data sources on the server which are handled by groups.
If client wants to subscribe to the specific data source, it calls:
myhub.Subscribe(dataSourceId);

On the server side, we just add the client to the specific group:
await Groups.Add(Context.ConnectionId, dataSourceId.ToString());

Then all the messages are sent with huge cursor payload and the size of it grows with every subscription.
Am I doing something wrong?

@maxcherednik
Copy link
Author

@maxcherednik maxcherednik commented Nov 21, 2016

@moozzyk
Copy link
Contributor

@moozzyk moozzyk commented Nov 21, 2016

Unfortunately this is how cursors work. Cursor contains references to all topics the connection is subscribed to. Besides the cursor getting bigger there is one more limitation to using many groups. The more groups the client is a member of the bigger the groups token. The groups token is sent back to the server when the client is reconnecting and if it gets too big it may exceed the url size limit causing reconnect failures.

@SaroTasciyan
Copy link

@SaroTasciyan SaroTasciyan commented Nov 22, 2016

@moozzyk I'm trying to figure out a way to reduce the size of cursor payload. Apparently it's not possible to reduce it while registering for many groups. Is there any other suggestion? One approach may be handling grouping ourselves on the server side and broadcast separately to each user. Is this a common/suggested scenario?

@davidfowl
Copy link
Member

@davidfowl davidfowl commented Nov 29, 2016

@moozzyk I'm trying to figure out a way to reduce the size of cursor payload. Apparently it's not possible to reduce it while registering for many groups. Is there any other suggestion? One approach may be handling grouping ourselves on the server side and broadcast separately to each user. Is this a common/suggested scenario?

Yes, that's one way to avoid the bloat and possibly the only way if you want to do group membership.

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

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.