Application gateway 502 bad gateway error intermittent - Microsoft Q&A (2024)

@Ricardo Gabriel Nima Montalban

Welcome to the Microsoft Q&A forum.

Based on my understanding of your question above you are getting intermittent 502 bad gateway errors when performing load tests with JMeter on an Application Gateway v2 Standard (as Load Balancer) in front of 2 VMs with a Java Spring Boot application as a backend pool. However, when using the same backend with a different architecture (LB external --> 2 Nginx VMs --> LB internal --> 2 VMs backend pool), you got zero errors in JMeter. They use the same custom probe with a successful status in both architectures.

Regarding your test with Application Gateway as your load balancer. The bad gateway error might be due to Request time-out. When a user request is received, the application gateway applies the configured rules to the request and routes it to a backend pool instance. It waits for a configurable interval of time for a response from the backend instance. By default, this interval is 20 seconds. In Application Gateway v2, if the application gateway doesn't receive a response from the backend application in this interval, the request will be tried against a second backend pool member. If the second request fails, the user request gets a 502 error. The solution in cases will be to increase the request-timeout. Application Gateway allows you to configure this setting via the BackendHttpSetting. You can run the PowerShell command below to increase the time. The Request timeout maximum to private backend is 24 hours as per the limitation documentation. You can try this suggestion and see if that resolves the issue, if this does not help in resolving the issue you can enable diagnostic logging for your application gateway to help dig deeper into the issue.

New-AzApplicationGatewayBackendHttpSettings -Name 'Setting01' -Port 80 -Protocol Http -CookieBasedAffinity Enabled -RequestTimeout 60

Regarding your test using Azure Load Balancer, you observed no errors it might be because Azure Load Balancer is Azure's most performant Load Balancer all while keeping latency ultra-low. Additionally, unlike Application gateway Azure Load Balancer doesn't close or originate flows and idle timeout for Azure Load Balancer is set to 4 minutes by default.

Additional reference:

https://learn.microsoft.com/en-us/azure/application-gateway/application-gateway-troubleshooting-502#request-time-out

https://learn.microsoft.com/en-us/azure/architecture/guide/technology-choices/load-balancing-overview

Hope this answers your query. Please let me know if you have any additional questions. Thank you!

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

Application gateway 502 bad gateway error intermittent - Microsoft Q&A (2024)
Top Articles
Pokemon: 10 Best Vivillon Patterns
How Does the Monthly Expiry of Futures and Options Work in India?
Woodward Avenue (M-1) - Automotive Heritage Trail - National Scenic Byway Foundation
Gamevault Agent
Retro Ride Teardrop
Poplar | Genus, Description, Major Species, & Facts
Www Movieswood Com
What Was D-Day Weegy
Little Rock Arkansas Craigslist
Cincinnati Bearcats roll to 66-13 win over Eastern Kentucky in season-opener
Winterset Rants And Raves
Keniakoop
Dumb Money
Colts seventh rotation of thin secondary raises concerns on roster evaluation
Fairy Liquid Near Me
7543460065
R Cwbt
U Break It Near Me
/Www.usps.com/International/Passports.htm
How many days until 12 December - Calendarr
Evil Dead Rise Showtimes Near Pelican Cinemas
THE FINALS Best Settings and Options Guide
Craigslist Dubuque Iowa Pets
Blackboard Login Pjc
Unable to receive sms verification codes
Cable Cove Whale Watching
Giantbodybuilder.com
Section 408 Allegiant Stadium
Sandals Travel Agent Login
Best Town Hall 11
Tu Housing Portal
Blush Bootcamp Olathe
Mark Ronchetti Daughters
RUB MASSAGE AUSTIN
Aliciabibs
The Best Restaurants in Dublin - The MICHELIN Guide
Sukihana Backshots
Armageddon Time Showtimes Near Cmx Daytona 12
Sand Castle Parents Guide
Anderson Tribute Center Hood River
Florida Lottery Claim Appointment
Shell Gas Stations Prices
Breaking down the Stafford trade
Interminable Rooms
Euro area international trade in goods surplus €21.2 bn
300+ Unique Hair Salon Names 2024
Blog Pch
Wrentham Outlets Hours Sunday
Renfield Showtimes Near Regal The Loop & Rpx
Jesus Calling Oct 6
Latest Posts
Article information

Author: Virgilio Hermann JD

Last Updated:

Views: 6727

Rating: 4 / 5 (61 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Virgilio Hermann JD

Birthday: 1997-12-21

Address: 6946 Schoen Cove, Sipesshire, MO 55944

Phone: +3763365785260

Job: Accounting Engineer

Hobby: Web surfing, Rafting, Dowsing, Stand-up comedy, Ghost hunting, Swimming, Amateur radio

Introduction: My name is Virgilio Hermann JD, I am a fine, gifted, beautiful, encouraging, kind, talented, zealous person who loves writing and wants to share my knowledge and understanding with you.