Skip Navigation
Show nav
Heroku Dev Center
  • Get Started
  • Documentation
  • Changelog
  • Search
  • Get Started
    • Node.js
    • Ruby on Rails
    • Ruby
    • Python
    • Java
    • PHP
    • Go
    • Scala
    • Clojure
  • Documentation
  • Changelog
  • More
    Additional Resources
    • Home
    • Elements
    • Products
    • Pricing
    • Careers
    • Help
    • Status
    • Events
    • Podcasts
    • Compliance Center
    Heroku Blog

    Heroku Blog

    Find out what's new with Heroku on our blog.

    Visit Blog
  • Log inorSign up
View categories

Categories

  • Heroku Architecture
    • Dynos (app containers)
    • Stacks (operating system images)
    • Networking & DNS
    • Platform Policies
    • Platform Principles
  • Command Line
  • Deployment
    • Deploying with Git
    • Deploying with Docker
    • Deployment Integrations
  • Continuous Delivery
    • Continuous Integration
  • Language Support
    • Node.js
    • Ruby
      • Working with Bundler
      • Rails Support
    • Python
      • Background Jobs in Python
      • Working with Django
    • Java
      • Working with Maven
      • Java Database Operations
      • Working with Spring Boot
      • Java Advanced Topics
    • PHP
    • Go
      • Go Dependency Management
    • Scala
    • Clojure
  • Databases & Data Management
    • Heroku Postgres
      • Postgres Basics
      • Postgres Getting Started
      • Postgres Performance
      • Postgres Data Transfer & Preservation
      • Postgres Availability
      • Postgres Special Topics
    • Heroku Data For Redis
    • Apache Kafka on Heroku
    • Other Data Stores
  • Monitoring & Metrics
    • Logging
  • App Performance
  • Add-ons
    • All Add-ons
  • Collaboration
  • Security
    • App Security
    • Identities & Authentication
    • Compliance
  • Heroku Enterprise
    • Private Spaces
      • Infrastructure Networking
    • Enterprise Accounts
    • Enterprise Teams
    • Heroku Connect (Salesforce sync)
      • Heroku Connect Administration
      • Heroku Connect Reference
      • Heroku Connect Troubleshooting
    • Single Sign-on (SSO)
  • Patterns & Best Practices
  • Extending Heroku
    • Platform API
    • App Webhooks
    • Heroku Labs
    • Building Add-ons
      • Add-on Development Tasks
      • Add-on APIs
      • Add-on Guidelines & Requirements
    • Building CLI Plugins
    • Developing Buildpacks
    • Dev Center
  • Accounts & Billing
  • Troubleshooting & Support
  • Integrating with Salesforce
  • Troubleshooting & Support
  • Addressing H12 Errors (Request Timeouts)

Addressing H12 Errors (Request Timeouts)

English — 日本語に切り替える

Last updated February 15, 2022

Table of Contents

  • Remediating a High Number of H12 Errors
  • Restart Dynos
  • Rollback
  • Scale Dynos to Handle Increased Traffic
  • Next Steps

This article contains steps for addressing a sudden increase in the number of H12 Request Timeout errors in your app. These errors occur when an HTTP request takes longer than 30 seconds to complete. They’re often caused by:

  • Long-running requests, such as expensive queries or a slow external API call.
  • Insufficient concurrency resulting in high request queue times during spikes in traffic.

For long-term mitigation, see Preventing H12 Errors (Request Timeouts).

Remediating a High Number of H12 Errors

Execute each remediation step in the following order. It may not be necessary to complete each step to achieve a reduction in H12 errors. Check the Heroku Dashboard after each step to see if the number of errors has decreased.

Restart Dynos

A restart cancels long-running requests. Restarting can resolve H12 issues because freshly-booted dynos receive requests without interference from long-running requests.

Using the Heroku CLI, run heroku ps:restart web to restart all web dynos. or, using the Heroku Dashboard, click More, then Restart all dynos.

Restart all dynos button in the dashboard

Rollback

If the spike in H12 errors coincides with a specific deployment, the code change may have caused long-running requests.

Using the Heroku CLI, run heroku rollback to roll back to the last release.

Or, in the Activity tab of the Heroku Dashboard, click Roll back to here beside the last release.

Scale Dynos to Handle Increased Traffic

Restarting dynos doesn’t help with issues caused by traffic spikes. However, adding or upgrading dynos provides more resources to address the increased throughput.

Check throughput in the Heroku Dashboard or attached monitoring add-on (if applicable). See the Metrics article for more information on throughput.

Add Additional Dynos

A larger dyno pool provides more processes to address increased throughput, reducing timeouts as request queue times shorten.

Add additional dynos via the Heroku Dashboard or the CLI. See Scaling for full instructions.

Upgrade Dynos

The application’s dynos may be undersized for its concurrency settings. Upgrading dynos to a higher tier provides more compute resources for processes to use.

Check the Heroku Dashboard. Upgrade dynos if either are true:

  • Dyno memory usage is near or above 100%.
  • Dyno load is near or above the acceptable load for your dyno type.

Next Steps

The remediation steps in this article serve to address immediate H12 errors. It is important to address any slow-performing code within the application or capacity issues to minimize these errors in the future. Review Preventing H12 Errors (Request Timeouts) for tips for future mitigation.

Keep reading

  • Troubleshooting & Support

Feedback

Log in to submit feedback.

Wrong Version of Ruby or Rake in App Error Pages

Information & Support

  • Getting Started
  • Documentation
  • Changelog
  • Compliance Center
  • Training & Education
  • Blog
  • Podcasts
  • Support Channels
  • Status

Language Reference

  • Node.js
  • Ruby
  • Java
  • PHP
  • Python
  • Go
  • Scala
  • Clojure

Other Resources

  • Careers
  • Elements
  • Products
  • Pricing

Subscribe to our monthly newsletter

Your email address:

  • RSS
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku Blog
    • Heroku News Blog
    • Heroku Engineering Blog
  • Heroku Podcasts
  • Twitter
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku
    • Heroku Status
  • Facebook
  • Instagram
  • Github
  • LinkedIn
  • YouTube
Heroku is acompany

 © Salesforce.com

  • heroku.com
  • Terms of Service
  • Privacy
  • Cookies
  • Cookie Preferences