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

Why --max-instances 1? #4

Open
nick-youngblut opened this issue Oct 26, 2023 · 4 comments
Open

Why --max-instances 1? #4

nick-youngblut opened this issue Oct 26, 2023 · 4 comments

Comments

@nick-youngblut
Copy link

I'm curious why you used --max-instances 1 for gcloud run deploy.

Was that necessary to deal with the GCR http 400 errors?

@randy3k
Copy link
Owner

randy3k commented Oct 27, 2023

It was needed because Shiny is a stateful application and GCR didn't route the traffic of the same user to the same container.
Having just 1 container makes sure that all traffic are routed to the same place.

This is no longer needed since GCR introduced session affinity. https://cloud.google.com/run/docs/configuring/session-affinity

Additionally, I believe that GCR now supports websocket, you probably do not need to use the customized shiny config.

@randy3k
Copy link
Owner

randy3k commented Oct 27, 2023

Judging from your message in the other thread, sounds like that the webdocket patch is still needed.

@nick-youngblut
Copy link
Author

nick-youngblut commented Oct 27, 2023

Thanks @randy3k for the info!

This is no longer needed since GCR introduced session affinity.

My problems persisted after adding the webdocket patch. Adding --max-instances 1 fixed the issue.

@randy3k
Copy link
Owner

randy3k commented Oct 28, 2023

Thanks @randy3k for the info!

This is no longer needed since GCR introduced session affinity.

My problems persisted after adding the webdocket patch. Adding --max-instances 1 fixed the issue.

you will need to enable session affinity.

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

2 participants