AWS Fargate for running a Django application

Has anyone tried using AWS Fargate for running their production Django application on aws? If so how was your experience? Is it worth it? What can be the issues

Yup, works well. Python itself is a bit of a pain to package into docker, especially for larger django apps that have C dependencies (pandas and numpy for example). That isn’t really a fargate thing though.

I think the only notable thing about fargate vs EC2 is the startup time: for larger docker images pulling and starting can be a little sluggish, particularly for frequently running cron jobs (we trigger ours with cloud watch events and run them on EC2 ECS hosts because the startup is so much faster)

It’s nice not to have to manage compute beyond a smallish box to run cron jobs on. Fargate + codedeploy blue/green deployments are really cool.

Not Django, but I’m running a few Pyramid applications on Fargate. Works really nice, much easier to deal with than EC2 + CodeDeploy. Already had all my apps Dockerized for local development, so the transition was fairly easy.

One thing to note: Fargate’s 25%/50% CPU option is not burstable like t2/t3, so it can slow your application to a crawl.

Another hiccup is ALB doesn’t do request buffering, so many WSGI servers (I use gunicorn) will need a reverse proxy like nginx. I put together an easy-to-use Docker option: https://github.com/luhn/docker-gunicorn-proxy

Not Fargate - but you can run Django in a lambda much cheaper and more scalable with zappa https://github.com/zappa/Zappa

Zappa works flawlessly but there are a lot of pitfalls
Your package and code should be less than 250 mb (limitations from lambda.). But zappa slim handler will save us but increasing latency.
I think there are limits for slim_handler as well.
But zappa is a lifesaver for deployment of python codes / api to lambda