简体   繁体   中英

How does AWS Fargate handle the health status of ASP.NET Core app hosted in it?

We current have an ASP.NET Core Web API hosted in AWS Fargate service. I have added a few health checks to the .NET Core app, like the database health check and few others for cache reset/reload.

If any of these checks fail, the /status endpoint of the app will return status as "Unhealthy". If AWS receives a call to an unhealthy service, how will it handle it?

Will AWS check for the status of the app and return a message built from its side?

Or will it return a message saying the endpoint is unreachable?

If any of these checks fail, the /status endpoint of the app will return status as "Unhealthy". If AWS receives a call to an unhealthy service, how will it handle it?

You running your app in fargate, if the health check fails, the task will be drained and stopped. Load balancer will stop sending traffic to the node.

Refer AWS docs:
https://docs.aws.amazon.com/elasticloadbalancing/latest/application/target-group-health-checks.html


Will AWS check for the status of the app and return a message built from its side?

Healthchecks are to determine the state of the application & stop redirecting traffic to nodes that are unhealthy & nothing more. If you wish to return messages to the client it's the dev's job to return such messages.

If all your nodes fail simultaneously your load balancer will return a 5XX error (service unreachable).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM