App Service timeout in 230 sec

%3CLINGO-SUB%20id%3D%22lingo-sub-1526934%22%20slang%3D%22en-US%22%3EApp%20Service%20timeout%20in%20230%20sec%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1526934%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20Team%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWe%20have%20couple%20of%20App%20Service%20which%20takes%20more%20than%20230%20Sec.%20We%20can%20not%20use%20Durable%20function%20or%20Webjobs.%20how%20can%20we%20increase%20the%20request%20time%2C%20as%20we%20have%20a%20task%20running%20which%20takes%20about%2010%20mins.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%2C%3C%2FP%3E%3CP%3EBiplab%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1565902%22%20slang%3D%22en-US%22%3ERe%3A%20App%20Service%20timeout%20in%20230%20sec%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1565902%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F103991%22%20target%3D%22_blank%22%3E%40Biplab%20Sah%3C%2FA%3E%26nbsp%3BIf%20you%20can%2C%20I%20would%20recommend%20moving%20this%20to%20an%20Azure%20Function.%20The%20timeout%20value%20can%20be%2010%20minutes%20if%20you%20use%20a%20consumption%20based%20plan%2C%20or%20if%20you%20use%20premium%20it's%20unlimited.%20If%20the%20trigger%20is%20HTTP%20though%20then%20the%20timeout%20is%20230%20seconds%20regardless%2C%20this%20is%20due%20to%20the%20default%20idle%20timeout%20for%20an%20Azure%20Load%20Balancer.%20If%20this%20situation%20matches%20your%20use%20case%20then%20you%20can%20use%20durable%20functions%2C%20more%20on%20this%20here...%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fazure-functions%2Fdurable%2Fdurable-functions-overview%23async-http%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fazure-functions%2Fdurable%2Fdurable-functions-overview%23async-http%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1951629%22%20slang%3D%22en-US%22%3ERe%3A%20App%20Service%20timeout%20in%20230%20sec%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1951629%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F103991%22%20target%3D%22_blank%22%3E%40Biplab%20Sah%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%20lang%3D%22en-us%22%3EThe%204%20minute%20idle%20timeout%20on%20the%20TCP%20level%20and%20this%20is%20implemented%20on%20the%20%3CSPAN%20style%3D%22font-weight%3A%20bold%3B%22%3EAzure%20hardware%20load%20balancer%3C%2FSPAN%3E.%20This%20timeout%20is%20not%20configurable%20and%20this%20cannot%20be%20changed.%20One%20thing%20I%20want%20to%20mention%20is%20that%20this%20is%20%3CSPAN%20style%3D%22font-weight%3A%20bold%3B%22%3Eidle%20timeout%3C%2FSPAN%3E%20at%20the%20TCP%20level%20which%20means%20that%20if%20the%20connection%20%3CSTRONG%3Eis%20idle%20only%20and%20no%20data%20transfer%20happening%3C%2FSTRONG%3E%2C%20only%20then%20this%20timeout%20is%20hit.%20To%20provide%20more%20info%2C%20this%20will%20hit%20if%20the%20web%20application%20got%20the%20request%20and%20kept%20processing%20the%20request%20for%20%26gt%3B%204minutes%20without%20sending%20any%20data%20back.%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%20lang%3D%22en-us%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3EA%20common%20practice%20to%20keep%20the%20connection%20active%20for%20a%20longer%20period%20is%20to%20use%20TCP%20Keep-alive.%20Packets%20are%20sent%20when%20no%20activity%20is%20detected%20on%20the%20connection.%20By%20keeping%20on-going%20network%20activity%2C%20the%20idle%20timeout%20value%20is%20never%20hit%20and%20the%20connection%20is%20maintained%20for%20a%20long%20period%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%20font-family%3A%20Calibri%3B%20font-size%3A%2011.0pt%3B%22%20lang%3D%22en-us%22%3EIdeally%2C%20in%20a%20web%20application%2C%20it%20is%20not%20good%20to%20keep%20the%20underlying%20HTTP%20request%20open%20and%204%20minutes%20is%20a%20decent%20amount%20of%20time.%20If%20you%20have%20a%20requirement%20about%20background%20processing%20within%20your%20web%20application%2C%20then%20the%20recommended%20solution%20is%20to%20use%20Azure%20WebJobs%2FFunction%20App%20and%20have%20it%20nteract%20with%20the%20Azure%20Webjob%20to%20notify%20once%20the%20background%20processing%20is%20done%20(there%20are%20many%20ways%20that%20Azure%20provides%20like%20queues%20triggers%20etc.%20and%20you%20can%20choose%20the%20method%20that%20suits%20you%20the%20best).%20Azure%20Webjobs%2FFunctions%20are%20designed%20for%20background%20processing%20and%20you%20can%20do%20as%20much%20background%20processing%20as%20you%20want%20within%20them.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Hello Team,

 

We have couple of App Service which takes more than 230 Sec. We can not use Durable function or Webjobs. how can we increase the request time, as we have a task running which takes about 10 mins.

 

Thanks,

Biplab

2 Replies

@Biplab Sah If you can, I would recommend moving this to an Azure Function. The timeout value can be 10 minutes if you use a consumption based plan, or if you use premium it's unlimited. If the trigger is HTTP though then the timeout is 230 seconds regardless, this is due to the default idle timeout for an Azure Load Balancer. If this situation matches your use case then you can use durable functions, more on this here... https://docs.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-overview#async-http

@Biplab Sah 

 

The 4 minute idle timeout on the TCP level and this is implemented on the Azure hardware load balancer. This timeout is not configurable and this cannot be changed. One thing I want to mention is that this is idle timeout at the TCP level which means that if the connection is idle only and no data transfer happening, only then this timeout is hit. To provide more info, this will hit if the web application got the request and kept processing the request for > 4minutes without sending any data back.

 

A common practice to keep the connection active for a longer period is to use TCP Keep-alive. Packets are sent when no activity is detected on the connection. By keeping on-going network activity, the idle timeout value is never hit and the connection is maintained for a long period

 

Ideally, in a web application, it is not good to keep the underlying HTTP request open and 4 minutes is a decent amount of time. If you have a requirement about background processing within your web application, then the recommended solution is to use Azure WebJobs/Function App and have it nteract with the Azure Webjob to notify once the background processing is done (there are many ways that Azure provides like queues triggers etc. and you can choose the method that suits you the best). Azure Webjobs/Functions are designed for background processing and you can do as much background processing as you want within them.