Announcing Django-Zappa - Serverless Django on AWS Lambda + API Gateway

267 views
Skip to first unread message

Rich Jones

unread,
Feb 8, 2016, 9:23:47 AM2/8/16
to Django developers (Contributions to Django itself)
Hey guys!

(I also made this post to django-users, but I think the discussion here can be about ways that we can improve Django to work better on AWS Lambda. Forgive the double-post.)

I'm pleased to announce the release of Django-Zappa - a way to run serverless Django on AWS Lambda + API Gateway.

Now, with a single command, you can deploy your Django apps in an infinitely scalable, zero-configuration and incredibly cheap way!

Read the announcement post here: https://gun.io/blog/announcing-zappa-serverless-python-aws-lambda/
Watch a screencast here: https://www.youtube.com/watch?v=plUrbPN0xc8&feature=youtu.be
And see the code here: https://github.com/Miserlou/django-zappa

Comments, questions and pull requests are welcome!

It seems quite performant already, but I bet there are ways that we can improve Django to work better on Lambda.

Enjoy,
Rich Jones

Florian Apolloner

unread,
Feb 8, 2016, 11:02:00 AM2/8/16
to Django developers (Contributions to Django itself)
Hi Rich,

to quote from your blog post:
the server is created after the HTTP request comes in through API Gateway. It then turns the API Gateway request into normal Python WSGI, processes the request, and returns it back through the API Gateway to the client.

Doesn't that effectively mean you are running in a CGI like mode? If yes, performance will suck, if no, you are still running persistent servers somewhere, which would make me wonder why you do not have to pay for them (memory…)

Cheers,
Florian

Rich Jones

unread,
Feb 8, 2016, 3:01:16 PM2/8/16
to Django developers (Contributions to Django itself)
Yes, it calls is in a WSGI mode. I've found that response time is around 80-100ms.

Cristiano Coelho

unread,
Feb 8, 2016, 6:40:17 PM2/8/16
to Django developers (Contributions to Django itself)
Hello, I would like to suggest that you include the limitations AWS Lambda and API Gateway has, since I have used them and it is not suitable for every use case.

For example, one of the biggest limitations is that an Lambda can run for at most 5 minutes, but if paired with API Gateway, it can only run for 1 minute before returning a time out, I know 1 minute is quite a lot, but if you have any kind of multimedia processing (like uploading a file, or downloading one that is generated on the server like a PDF) you will need to re write some code to use other amazon services such as S3.
Other limitations include things such as 100 concurrent requests at a time and 500 requests per second, payload for request and respose size limits of 6mb and other things that can be read here http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html

Some (most) of those limits can be increased by request to Amazon.

Leaving the limitations aside, AWS Lambda is really a great product I highly recommend!
Reply all
Reply to author
Forward
0 new messages