Miserlou / Zappa

Serverless Python
https://blog.zappa.io/
MIT License
11.89k stars 1.2k forks source link

Endpoint request timed out -- sometimes django application while calling apis on ios device #1431

Open codalprashant opened 6 years ago

codalprashant commented 6 years ago

Context

Django application deployed using zappa with production environment. Apis are delivered through django rest framework. Python 3.6

Expected Behavior

When endpoint is called from any device, it should work

Actual Behavior

Sometimes when the endpoint is called from the ios device, it returns endpoint request timeout.

Possible Fix

Not sure what to do for this.

Your Environment

"production": { "aws_region": "us-west-2", "django_settings": "xxxx.settings", "profile_name": "default", "s3_bucket": "zappa-xxxxxxxx", "runtime": "python3.6", "debug": true, "delete_local_zip": true, "delete_s3_zip": true, "exclude": ["*.rar"], "keep_warm": true, "keep_warm_expression": "rate(4 minutes)", "timeout_seconds": 300, "manage_roles": false, "role_name": "xxxxx-ZappaLambdaExecutionRole", "events": [{ "function": "xxxxxxxx", "expression": "rate(7 days)" },{ "function": "xxxxxxxx", "expression": "rate(7 days)" },{ "function": "xxxxxxx", "expression": "rate(12 hours)" }], "slim_handler": true }

paulclarkaranz commented 6 years ago

In case you are not aware the AWS API Gateway has a hard coded request limit of 29 seconds. So while the lambdas can run for 300s you can't synchronously return a response for the whole run time. http://docs.aws.amazon.com/apigateway/latest/developerguide/limits.html#api-gateway-limits

Comm4nd0 commented 5 years ago

has anyone found a way around this? i know the issue is with AWS more than Zappa but if anyone knows how to get around it then i'd be all ears!

uiandwe commented 5 years ago

The same thing happens to me even that the request time limit setting is 5 minutes.