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

Closed
maxcherednik opened this Issue Nov 18, 2016 · 4 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?

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment