5

I have hosted a site in two VM's and added it in Application Gateway back end pool. We have a form submit which will do DB update and a confirmation page will be shown.

If both the server is up. The changes are updated properly on DB and confirmation page is shown even if the Form Filled from VM1 and submitted to VM2.

Consider the below case. The user comes into the page from VM1 and filling the details. After the VM1 is unavailable. Now when the user submites the code. The page loads and shows 502 proxy error. But the DB update are properly done through VM2. But the confirmation page is not shown.

502 error

hari prasath
  • 324
  • 2
  • 9
  • I think it is a default behavior. When the Probe for VM1 fails, and the user still connects to the VM1, Application Gateway kills the connection. Hence you see 502. Can you try configuring "Connection Draining" property in the HTTP settings and test the behavior? – msrini-MSIT Jun 06 '19 at 11:23
  • @msrini-MSIT I have enable the connection draining for all my HTTP setting and tested. Still i face the same problem. Also i tried with enabling and Disabling the Cookie Base Affinity Still the issue is not resolved. – hari prasath Jun 07 '19 at 04:20
  • Can you share the access logs where you can see AppGW sending out 502? I would be interested to see the time the backend server took to the request AppGW forwarded. – msrini-MSIT Jun 07 '19 at 04:27
  • @msrini-MSIT. Please find the Access log below .{ "resourceId": "/****", "operationName": "ApplicationGatewayAccess", "time": "2019-06-07T05:12:42Z", "category": "ApplicationGatewayAccessLog", "properties": { "instanceId":"ApplicationGatewayRole_IN_0", "clientIP":"61.12.45.122", "clientPort":61831, "httpMethod":"GET", "requestUri":"/company/confirmation", "requestQuery":"*****", "httpStatus":502, "httpVersion":"HTTP/2.0", "receivedBytes":1107, "sentBytes":1636, "timeTaken":21257, "sslEnabled":"on", "host":"****", "originalHost":"****" } } – hari prasath Jun 07 '19 at 08:44
  • What is the time out value configured in HTTP Settings? What is the SKU which you are using ? – msrini-MSIT Jun 07 '19 at 09:09
  • The health probe setting is Interval: 120s Timeout: 120s HTTP Setting Request Timeout is Request time out : 180s – hari prasath Jun 07 '19 at 09:14
  • Not the Heath probe Interval. I am asking about the HTTP Timeout – msrini-MSIT Jun 07 '19 at 09:15
  • HTTP Setting Request Timeout is Request time out : 180s. Its SKU Size is small – hari prasath Jun 07 '19 at 09:16
  • What is the response code from the backend for this request. Ideally I should be able to get this from the Access logs. Can you get that info from your application logs? – msrini-MSIT Jun 07 '19 at 09:17
  • do you have any update for me? – msrini-MSIT Jun 11 '19 at 06:29
  • 1
    @msrini-MSIT Actually its due to the timeout value is set. The server is kept active in the health probe for 4 minutes. So it request to the same server and showed server error. After reducing the time i couldn't reproduce the issue – hari prasath Jun 21 '19 at 11:12
  • Thank you for letting the community know. I will mention that as answer to your question. – msrini-MSIT Jun 22 '19 at 07:28

1 Answers1

0

The issue was due to the incorrect timeout value set on Health Probe. When your server is down, the requests will be sent to the backend unhealthy server for 4 minutes as the timeout value is too long. Once the timeout value is reduced, the issue is resolved.

msrini-MSIT
  • 1,444
  • 1
  • 7
  • 11