I'm working on an app that basically retrieves data from mongoDB, performs some basic sorting/math, then post the results for the users.
I'm getting H12 errors from Heroku sporadically - seems like some queries are taking more than 30 seconds. I have not been able to replicate this problem once I restart the dyno.
Is there a way to build a middleware to ping the server/client if the request is taking more than 15 seconds to fulfill? or some other way to mitigate this other than crashing the whole application?
First time builder here so appreciate any help. Thanks.
I'm using NodeJS, Express Routers, and Heroku (Hobby Dyno) to host the application. Runs fine until recently, the application has been crashing on Heroku:
2022-08-23T14:05:25.673220+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=GET path="/index?customerType=Buyer&town=&zipcode=01235" host=www.agentometer.com request_id=6350ff01-69ed-4c4b-b958-d880b5ceef73 fwd="98.216.185.71" dyno=web.1 connect=0ms service=30000ms status=503 bytes=0 protocol=https
2022-08-23T14:06:34.759586+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=GET path="/index?customerType=Buyer&town=Boston&zipcode=" host=www.agentometer.com request_id=da8df716-44c9-4c5b-8db6-96d11d299302 fwd="98.216.185.71" dyno=web.1 connect=0ms service=30000ms status=503 bytes=0 protocol=https 2022-08-23T14:26:10.643969+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=GET path="/" host=www.agentometer.com request_id=c7a9472d-5a7a-4250-83f7-827b4416019e fwd="108.26.205.219" dyno=web.1 connect=0ms service=30000ms status=503 bytes=0 protocol=https 2022-08-23T14:26:12.036207+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=GET path="/" host=www.agentometer.com request_id=13978436-5a55-4c41-ad60-2416fd0e853c fwd="108.26.205.219" dyno=web.1 connect=0ms service=30000ms status=503 bytes=0 protocol=https