QuestionQ47

VerifiedMonitoring, Scaling, and Operations

Universal Containers has recently seen a higher volume of traffic on its mobile app hosted on Heroku. While Universal Containers ran 4 standard-2x dynos with 1 GB of RAM each, it experienced multiple H12 ("request timeout") errors. The app never used more than 800 MB of RAM. It then changed to performance-m dynos with 2.5 GB of RAM and configured autoscaling for a maximum of 2 dynos. However, it continued to experience H12 ("request timeout") errors.

What remediation should an Architect recommend to alleviate this issue?

Explanation

An H12 occurs when a web request takes longer than Heroku’s 30-second routing timeout. Long-running work in a web process holds resources and can cause further requests to queue and time out, especially under increased traffic. Moving that work to asynchronous background jobs on worker dynos frees web dynos to respond promptly. The observed memory use does not justify a larger-memory dyno, and limiting the application to two web dynos does not increase request-handling capacity. Heroku: Request Timeout, Heroku: Worker Dynos, Background Jobs and Queueing

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!