# How to handle API Gateway timeout?

**URL:** <https://forum.serverless.com/t/how-to-handle-api-gateway-timeout/11233>\
**Category:** Serverless Architectures\
**Tags:** lambda, api-gateway\
**Created:** [April 22, 2020, 3:34pm UTC](https://forum.serverless.com/t/how-to-handle-api-gateway-timeout/11233 "2020-04-22T15:34:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![NicolasGuary](https://avatars.discourse-cdn.com/v4/letter/n/22d042/32.png) [@NicolasGuary](https://forum.serverless.com/u/NicolasGuary)\
**Post date:** [April 22, 2020, 3:34pm UTC](https://forum.serverless.com/t/how-to-handle-api-gateway-timeout/11233/1 "2020-04-22T15:34:31Z")

</div>

Hello everyone,

I am currently working on an application doing heavy data jobs and I am facing an issue using API Gateway routes.  
For example, I have a Lambda running an Athena query and then calling an API for each row before sending the result. The execution time is approximately 1 minute. But API Gateway maximum timeout is 30 seconds. Is there a way to call the lambda directly from the front-end (React) and if so, is there any drawbacks doing this?

The application will not be public and is intended only to be used inside my company for demonstration purposes.

Thank you for your help !

---

<div class="post-metadata">

**Author:** ![beenmeckel](https://avatars.discourse-cdn.com/v4/letter/b/8dc957/32.png) [@beenmeckel](https://forum.serverless.com/u/beenmeckel)\
**Post date:** [August 30, 2020, 1:19pm UTC](https://forum.serverless.com/t/how-to-handle-api-gateway-timeout/11233/2 "2020-08-30T13:19:28Z")

</div>

In my experience API gateway has a 10s time out on waiting for the lambda function to start (ie. For the container to load). Once the function has started it can run for much longer than 10s and still respond Ok.

If you use Java for your lambda function the you’re screwed. Container [9Apps](https://9apps.ooo/) [Showbox](https://showbox.kim/) [Tutuapp](https://tutuapp.uno/) starts for Java are often 40+ seconds, but using Node JS you’re usually Ok.
