-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
What's the best way to close open connections on forking? #183
Comments
No, you don't need to do the same for AnyCable, as there is no forking or child process spawning in AnyCable RPC part as far as I know. Refer to AnyCable architecture for details. |
Yep, @Envek is correct. AnyCable RPC server uses a single process, no forking. So, no special attention is required. |
Thank you both for your input 👌 |
@palkan, I'm curious about Embedded mode though. What happens when AnyCable RPC is embedded into clustered Puma for example? Does it stay in master process? 🤔 |
That's a good question.
Yeah, I think it should, but only if we preload the app. In a clustered Puma setup, I run an RPC server within a single worker process. Here is an example: https://github.com/anycable/anycable-twilio-hanami-demo/blob/35aa3ad6dbcb47420a0b9c86af1a0290b242675d/kaisen/config/puma.rb#L17-L26 |
Tell us about your environment
Ruby version: 3.0.4
Rails version: 6.1
anycable
gem version: 1.3.0anycable-rails
gem version: 1.3.7grpc
gem version: 1.54.0What did you do?
I am migrating my app from running ActionCable with Puma to AnyCable. I have the following code in my Puma config file:
Which closes open connections to MongoDB on forking (see the MongoDB documentation link for more details).
My questions are:
Thanks for AnyCable !!
The text was updated successfully, but these errors were encountered: