Google App Engine health checks spamming app

后端 未结 4 1845
你的背包
你的背包 2020-12-03 00:51

I\'ve deployed a nodejs app running on the Google App Engine Flex runtime using the following app.yaml configuration:

runtime: nodejs
env: flex
         


        
4条回答
  •  北海茫月
    2020-12-03 01:39

    I also run NodeJS in GAE Flex env. Health checks were also spamming the server log. The following few things helped me in reducing them:

    1. Although the google documentation (https://cloud.google.com/appengine/docs/flexible/nodejs/configuring-your-app-with-app-yaml#health_checks) says healthcheck config is not required, I set them explicity anyway to lower the frequency of the health check calls.
    2. Use the "Advanced Log Filter" to remove the health check logging from showing up if they are too distracting.
    3. Google documentation (https://cloud.google.com/appengine/docs/flexible/nodejs/how-instances-are-managed) says it's not required to implement a handler for health check, I explicitly implemented it anyway. I added a handler for "/_ah/healthcheck" endpoint in the express.js server, and have the route at the top of app.js file, so the healthcheck requests are responded right away. This helped reduce some noises caused by the health check requests getting into the express app logic.

提交回复
热议问题