Closed zedtux closed 1 year ago
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? :thinking:
That's a good question.
Does it stay in master process?
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 !!