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

Sending huge data through custom message Error #545

Open
Mush-A opened this issue Jan 20, 2023 · 1 comment
Open

Sending huge data through custom message Error #545

Mush-A opened this issue Jan 20, 2023 · 1 comment

Comments

@Mush-A
Copy link

Mush-A commented Jan 20, 2023

Context

A shiny application I work on sends processed data through:

session$sendCustomMessage("handler", data)

The Javascript on the front end catches this message and does some visualizations:

Shiny.addCustomMessageHandler('handler', (data) => visualizer(data))

When the fetch data button is clicked this data is sent.

The shiny server is currently hosted on an Amazon EC2 R6a Large instance.

Issue

Depending on the parameters the user selects, the data can be small or huge. When the parameters are such that the data is a huge JSON object, there is an error given and the server disconnects with the following messages:

enter image description here

enter image description here

I have tested the same scenarios but without sending the data through session$sendCustomMessage("handler", data) and am not able to reproduce the error. It seems like sending a huge amount of data through the network causes the shiny server to disconnect.

This error does not occur locally with the same parameters in RStudio and only happens on the shiny server ec2 environment.

What could be the fix for this?

@Mush-A Mush-A changed the title Shiny server - Sending huge data through custom message Error Sending huge data through custom message Error Jan 20, 2023
@Mush-A
Copy link
Author

Mush-A commented Jan 29, 2023

It seems like increasing the sockjs_heartbeat_delay and sockjs_disconnect_delay helped with this. After increasing this, the error seemed to be gone.

The connection simply times out when the huge data is loading and the comment above was correct about it.

https://docs.posit.co/shiny-server/

enter image description here

Simply add these directives in the shiny-server.conf with a reasonable value.

@Mush-A Mush-A closed this as completed Jan 29, 2023
@Mush-A Mush-A reopened this Jan 29, 2023
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

1 participant