-
-
Notifications
You must be signed in to change notification settings - Fork 82
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
Implementing readiness probe for Kubernetes #253
Comments
We already have a readiness interface as part of https://github.com/socketry/async-container/blob/main/lib/async/container/notify/client.rb Wondering what would be the best way to expose this to Kubernetes? Maybe a command? Regarding memory usage and pool size, that will be highly application specific. In general, a Rails app will be around ~500MiB per server instance and the number of database connections will depend on the number of clients you are hoping to serve simultaneously. The new activerecord code path with Rails 7.2+ reduces contention on the connection pool. If you can measure then P95 time of your application, and give me a rough idea of how many clients you want to serve, we can figure out the appropriate pool size. |
Thank you for your input @ioquatix. Based on your feedback, we've considered two options for exposing the connection pool as a readiness to Kubernetes. Option A: Leveraging async-container While Option B: Custom Health Check Endpoint Given our experience with Puma, a custom health check endpoint seems like a straightforward approach. We could extend our existing Puma health check endpoint to include connection pool checks for Falcon. This would provide a consistent and well-understood mechanism. Questions: Do you see any significant drawbacks to using a custom health check endpoint? |
I think option B makes more sense if you want control over exactly what kind of things you are checking as healthy. The Can you elaborate on exactly what things you want to check the health of? e.g. ActiveRecord? |
Awesome. Option B is the one we'll like to focus on.
We want to return OK/KO based on the ActiveRecord stats. This check will be done for the readiness probe only* |
Hi,
We're considering replacing Puma with Falcon in our Rails app running on top of Kubernetes, but we're struggling to implement effective readiness probes. Unlike Puma, where thread availability is easily checked, Falcon's use of fibers makes it more challenging.
We're considering using the availability of ActiveRecord connections as a metric for Falcon's readiness probe. However, we're uncertain about its efficiency and reliability. Do you have some best practices for implementing it?
Additionally, we're interested in learning how other users typically handle resource allocation (CPU/memory) and ActiveRecord pool management in their production environments.
Thanks
The text was updated successfully, but these errors were encountered: