question

Kenvin-4983 avatar image
0 Votes"
Kenvin-4983 asked Kenvin-4983 answered

Random 504 Gateway timeout while doing load test with application gateway

I have 1 application gateway which having 2 backends (Azure VM) which is hosting ASP CORE REST API. And both is using port 80 to communicate.

Everything is working fine with manual test until when we use jmeter to do 2500 Threads POST request load test, some of the request get "504 gateway timeout" as response.

I tried to run the exactly same load test towards the backend straight and didnt received any bad response.

Am i misconfigured something on my application gateway?

Configurations
111484-image.png

HTTP Settings
111420-image.png

Probes
111522-image.png



azure-application-gateway
image.png (23.8 KiB)
image.png (12.6 KiB)
image.png (40.9 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Kenvin-4983 avatar image
0 Votes"
Kenvin-4983 answered

We modified the settings on backend pools by changing the Target Type from IP Address to Virtual Machine, and the performance get much better afterwards

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

RaviVarmanMSFT-5919 avatar image
0 Votes"
RaviVarmanMSFT-5919 answered

Hi @Kenvin-4983

Thanks for reaching us.

The image attached for http setting is the screen shot of health probe not Http settings.

Under Http settings check the value of Request time-out (seconds)

The request timeout is the number of seconds that the application gateway will wait to receive a response from the backend pool before it returns a “connection timed out” error message. If it exceeds the timeout value you see 504 response sent by application gateway to the clients.

Increase the value of the Request time-out based on your backend response time to avoid 504-connection timed out.

To verify if the backend is taking time for the response you can enable diagnostic logs on application gateway and you can check access logs for the time taken by backend for the response.

Access log: You can use this log to view Application Gateway access patterns and analyze important information. This includes the caller's IP, requested URL, response latency, return code, and bytes in and out. An access log is collected every 60 seconds.

How to enable logging : https://docs.microsoft.com/en-us/azure/application-gateway/application-gateway-diagnostics#enable-logging-through-the-azure-portal

Hope this was helpful. Please let us know in case of any additional questions or concerns.

Please "Accept the answer" if the information helped you. This will help us and others in the community as well


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.