Here is the thing:
- We’ve implemented a C++ RESTful API Server, with built-in HTTP parser and no standard HTTP server like apache or anything of the kind
- It has been in use for several months in Amazon structure, using both plain and SSL communications, and no problems have been identified, related to Amazon infra-structure
- We are deploying our first backend using Amazon ELB
- Amazon ELB has a customizable health check system but also as an automatic one, as stated here
- We’ve found no documentation of what data is sent by the health check system
- The backend simple hangs on the socket read instruction and, eventually, the connection is closed
I’m not looking for a solution for the problem since the backend is not based on a standard web server, just if someone knows what kind of message is being sent by the ELB health check system, since we’ve found no documentation about this, anywhere.
Help is much appreciated. Thank you.
With customizable you are presumably referring to the health check configurable via the AWS Management Console (see Configure Health Check Settings) or via the API (see ConfigureHealthCheck).
The requirements to pass health checks configured this way are outlined in field Target of the HealthCheck data type documentation:
With automatic you are presumably referring to the health check described in paragraph Cause within Why is the health check URL different from the URL displayed in API and Console?:
The paragraph Solution clarifies the payload being zero here, i.e. it is similar to the non HTTP/HTTPS method described for the configurable health check above:
Summary / Solution
Assuming your RESTful API Server, with built-in HTTP parser is supposed to serve HTTP only indeed, you will need to handle two health checks:
HTTP GETrequest and must answer with200 OKwithin the specified timeout period to be considered healthy.In conclusion it seems that your server might be behaving perfectly fine already and you are just irritated by the 2nd health check’s behavior – does ELB actually consider your server to be unhealthy?