AmericanRedCross / damage-assessment-bot

Chatbot for immediate damage and needs assessments
BSD 3-Clause "New" or "Revised" License
7 stars 3 forks source link

Add app insights availability tests for health check endpoint to keep functions runtime warm #139

Closed maxnorth closed 5 years ago

maxnorth commented 5 years ago

Adds availability tests to the deployment template. These ping the health check endpoint every 5 minutes from several locations globally and prevent the app from being deallocated by the functions runtime for lack of use. This prevents cold starts which are quite slow for the api currently, often taking more than 30 seconds.

Note: We should return to this later and investigate how to improve cold start so that a keep warm ping is not as crucial. Possible optimizations include using a common chunk webpack bundling strategy to reduce the size of the deployed app files. Also possible the slow cold start is related to the fact that in the azure functions V2 runtime, certain triggers (like queue) need extensions to be installed. Should determine if these are pre-installed on the vm's or being installed on every cold start. If the latter, should try to find out if we can include these in the app deployment.