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

Comments

Projects
None yet
4 participants
@maxcherednik

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

This comment has been minimized.

Show comment
Hide comment
@moozzyk

This comment has been minimized.

Show comment
Hide comment
@moozzyk

moozzyk Nov 21, 2016

Contributor

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.

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@SaroTasciyan

SaroTasciyan 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?

@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

This comment has been minimized.

Show comment
Hide comment
@davidfowl

davidfowl Nov 29, 2016

Member

@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.

Member

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