5 ms·
For us, serverless is running Django monolith on AWS Lambda in a container. and we LOVE it. I think the serverless revolution is here just not in the way peopl
by irjustin 3y ago
For us, serverless is running Django monolith on AWS Lambda in a container. and we LOVE it.
I think the serverless revolution is here just not in the way people originally dreamed.
- xrisk 3y agoWhat’s your QPS like and what’s the value-add over running it on something like EC2? (or AppEngine etc if you want something more managed?)
- irjustin 3y agoQuite low. We're a b2b application, so each customer is worth a lot but very very underutilized CPU and relatively few customers. Main advantages: Server $$ significantly lower than CI/CD; Bottleneck becomes DB, can have 1000x instances no problem (but never use more than 5x). No EC2 to manage just deploy the docker.
- danielvaughn 3y agoHow are the cold starts? I tried a similar setup with GCP cloud functions and I was running into (I shit you not) 5-7 second cold start times.
- JanSt 3y agoThere will likely be very few cold starts when the whole monolith is running in it
- SOLAR_FIELDS 3y agoAt that point you’re just paying an exorbitant rate for… the same thing you would get from hosting it on EC2
- danpalmer 3y agoOr if you can take a bit of up-front setup cost, running it on GKE with Autopilot means you've got many of the benefits of lambda on a K8s cluster (e.g. immutable container-driven development, no need to manage long-running VMs) and only pay for used resources (not idle machines). The main caveat is no scale-to-zero, but as mentioned previously, that's unlikely to happen.
- mplewis 3y agoIMXP, autopilot is multiple times the price of a VM on a non-GCP platform.
- danpalmer 3y agoHow come? I see Autopilot is $0.10 per cluster hour, or ~$75 a month, add the standard GKE cluster management overhead of $150, that's $225 a month for a cluster which rounds to zero given any reasonable load. Then in my experience GCP VMs have always been price competitive with basically any other cloud provider. The issue we had was getting the bin-packing right on our cluster, and we often ended up with 20% unallocated capacity per VM. Autopilot basically solves that (and probably pays for itself with only a few VMs) as you only pay for the K8s defined resources, and therefore only have 1 level of cost optimisation at the pod level, rather than 2 at the pod and VM level.
- JanSt 3y agoYeah, I wouldn‘t do it
- irjustin 3y ago<3s is our target 95% is <2.5s. We have a keep warm function that always keeps 5x "warm"-ish so we rarely hit cold starts. Keep warm is not fool proof as AWS got smart about people constantly doing keep warms, but it definitely helps.
- sjducb 3y agoI had no idea you could do this. I’m going to migrate my personal django projects onto lambda this week.
- irjustin 3y ago+1, take a look at Mangum: https://github.com/jordaneremieff/mangum/ https://github.com/jordaneremieff/mangum/
- aidos 3y agoWhat’s the process / worker model when it’s run like that? Is there a continuous process running listening on a port waiting for a request?
- pmontra 3y agoThat's a very fat function to run on Lambda. What's the advantage compared to run the same container in Fargate? Compared to a VM I guess you're saving the sysadmin time. Do you have some recurring activities to babysit Lambda or is it zero maintenance for your team?
- kikimora 3y agoBest thing about Lambda it is typically zero maintenance.
- PurpleRamen 3y agoHow is that different from just a normal Webhoster? Except, being more expensive, I guess?
- CuriouslyC 3y agoIt gives you the flexibility to easily swap in pieces in another language without making architectural changes while being as simple to work with (after devops work) as a monolith. If you have an orchestration setup to manage your functions rather than using Lambda/etc it doesn't cost any more than a monolith either (aside from competent devops salary).
- PurpleRamen 3y ago> It gives you the flexibility to easily swap in pieces in another language Which you can also do with a Webhoster. Well, it depends a bit on what languages or environment they offer of course. > without making architectural changes I guess those pieces have a way to communicate with each other? So the point here is more that you are forced to work with an architecture which is from the beginning designed for pluggable pieces.
- irjustin 3y agoI should've put context, but we are a b2b and barely have any CPU utilization and mostly in bursts. Normally we would have at minimum 2x Fargate "mediums" sitting around for redundancy. ~US$130/mth now our server costs <$5/mth. Our CI/CD is WAY more expensive.