Issue
Without a change in the app code, my Heroku app on Cedar-generation Common Runtime running Puma as the web server suddenly started recording higher response time along with increased number of H12 - Request timeout and H27 - Client Request Interrupted errors.
Resolution
Please try updating Puma to 6.5.0 or above and adding the following line to config/puma.rb
:
enable_keep_alives false
The change in the app's behavior may have been triggered by migration of the app to Router 2.0 which supports keep alives by default. As explained in the detail in the blog post Pumas, Routers & KeepalivesâOh my!. the interaction between Router 2.0 and Puma with connections kept alive may result with higher response time. Puma 6.5.0 or above has the option to disable keep alives.