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

Connection check in multiplexing #714

Open
ilya2204 opened this issue Oct 5, 2023 · 7 comments
Open

Connection check in multiplexing #714

ilya2204 opened this issue Oct 5, 2023 · 7 comments
Assignees

Comments

@ilya2204
Copy link

ilya2204 commented Oct 5, 2023

The problem I am facing
When using multiplexing for connecting to a large number of documents via one socket the socket constantly spams with connection check messages (as I understand it is pingInterval) and this happens for each document separately.

The solution I would like
Perhaps it can be done so that the connection is checked only for the main socket, and not for each document separately?

@janthurau
Copy link
Collaborator

hi @ilya2204, this shouldnt happen. I think you are seeing awareness updates, which are updated every 30 seconds per document. If you don't need awareness, you can disable it by passing awareness: null to the provider, but make sure that you have at least one provider that uses it (or otherwise receives messages before HocuspocusProviderWebsocket.messageReconnectTimeout

@ilya2204
Copy link
Author

ilya2204 commented Oct 9, 2023

Hello @janthurau, if this is awareness, it still doesn’t seem to make sense that when using multiplexing, each document sends its awareness once every 30 seconds? Is there a way to raise this timeout? With a large number of documents (several hundred), the socket sends messages continuously

@janthurau
Copy link
Collaborator

I dont think you can raise that as this is yjs internals (see https://docs.yjs.dev/api/about-awareness), but you can just disable it if you don't need it for some (or all) documents.

@ilya2204
Copy link
Author

ilya2204 commented Oct 9, 2023

Understood thanks. It's just that there are actually different parameters messageReconnectTimeout, forceSyncInterval, pingInterval, outdatedTimeout quite confusing.

@ilya2204
Copy link
Author

ilya2204 commented Oct 9, 2023

I could be wrong, but at first glance, if you copy Awareness class and replace the timeout with the desired one, then everything should work.

@ilya2204
Copy link
Author

@janthurau but it seems that doing ping/pong for each document on the socket, and not for the entire socket as a whole, is an overhead

@ArihantBapna
Copy link

@ilya2204 were you able to figure out a solution for this?

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

No branches or pull requests

3 participants