Azure linux webapp 504 gateway timeout error

A Aathithya 45 Reputation points
2024-11-21T15:25:36.6266667+00:00

I have deployed my FastAPI code in an Azure Linux WebApp. When I hit my POST endpoint with a long input, I receive a 504 Gateway Timeout error. However, it works fine locally in Swagger. The app is in the basic tier, and the input length is 11,000 characters. The API should accept the input, send it to OpenAI, and return a response. Any help would be appreciated.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,931 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Grmacjon-MSFT 19,151 Reputation points Moderator
    2024-11-21T20:22:52.66+00:00

    Hi @A Aathithya we're sorry to hear you're facing this issue. Could you please provide more details about the size of the request and the expected response from the OpenAI API? Are there any specific limitations or constraints imposed by the API that might be contributing to the timeouts?

    A 504 Gateway Timeout error typically indicates that the server failed to process the request within a specific time limit. In your case, the long input length might be contributing to this issue.

    Consider upgrading your App Service plan to a higher tier, like Standard or Premium. These tiers offer more resources (CPU, memory, etc.) to handle larger requests. Also, if you're already on a higher tier, you can scale up your app service to allocate more resources to your specific instance

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.