AWS’s Elastic Load Balancer is a Strangler
shermanonsoftware.com
shermanonsoftware.com
Having ALB be such a robust, turn-key product does tempt one into giving it a lot of responsibilities which definitely lends itself towards lock-in. I guess its the same with marriage: there are always tradeoffs.
I do wish it was better integrated with ECS + AppMesh + API Gateway, so it could be like a managed GetAmbassador.io. Envoy proxies are a hell of a good idea, and I think are going to be something like the React of the backend. While one can dream about a grand unified request router for the cloud, ALB continues to innovate with things like canary deployments and awesome routing rules, all well continuing to 'just work' at web scale. Is there anything else you can throw up to 50K RPS at and not have to think about it that much?
Lambdas have a 6mb response size. Api gateway has a 10mb response size. If you go ALB to Lambda. And your response is over 1mb. Your response will fail. Because the ALB team decided to introduce a random 1mb limit, not document it as a limitation, and added it to their trouble shooting notes instead.
So if you need to return a small PDF or something from a lambda via ALB. Good luck.
https://docs.aws.amazon.com/elasticloadbalancing/latest/appl...
Right at the top of the page, underneath the header "Limits"
> The maximum size of the response JSON that the Lambda function can send is 1 MB.
https://docs.aws.amazon.com/elasticloadbalancing/latest/appl...
Which I complained about because it wasn't mentioned as lambda as a target docs. I guess they amended it.
The reason they do this is to keep the alb running efficiently by not having to architect for random large responses.
API Gateway: 10mb
Lambda: 6mb
ALB: 1mb
Yet if your target is an ec2 instance, there's no limit on the load balancer. So IMO the limit for a lambda target should be the limit imposed by Lambda itself. 6mb.
ALB to containers or servers is a different beast - here the entire request and response need not be buffered at all (there might still be a very small buffer, mostly negligible), so streaming responses, websockets etc become possible.
We use lambda to resize images, so we do push against these limits a bit, but it's a fair tradeoff for the advantages - no worries about CPU throttling from too many requests, no waiting for servers to start for spiky loads etc.
The two styles are an impedance mismatch.
Also request/response is not inherently synchronous or asynchronous. It's just a protocol design pattern.
Buffering, overcommit, etc are also kust normal facts of life in both sync and async messaging.
Request/response is fundamentally synchronous. If you want to nitpick about other layers not blocking, that’s missing the wood for the trees.
Each Lambda invocation gets a dedicated VM for the duration of the request. It is a great match for synchronous code.
Lambda does reuse VMs, so I hope you aren’t relying on containers being discarded for any integrity or security outcomes.
All the responses in this thread illustrate to me that AWS needs to put more effort into socialising how the product works. Since I was physically in the room for Lambda’s AWS internal launch this is twice disappoint because the technical messaging then was very clear and compelling.
will something like https://www.getambassador.io/reference/core/ingress-controll... , support all the usecases that a nginx ingress can ? (old certificates, spdy, etc etc etc)
It's quite unfortunate, since this means that some use cases are limited to the classic ELB.
[1] https://docs.aws.amazon.com/elasticloadbalancing/latest/user...
Edit: you can do that with iptables
Plus, leaving the pass-through in the codebase lets you do a much wider variety of things. You could run both the original and your replacement, and check the responses against each other. You could do that, or do replacements, at however tiny of a part you can imagine. You could choose which cases to handle where according to any algorithm you can dream up.
Yes load balancers can make decisions on application layer protocols like gRPC, but not in mode TCP which is what the parent comment was asking about. That's because that mode only looks at the TCP header and IP headers which don't contain any information about the application protocols.
An example of a time you might use this mode is if you're terminating TLS on the web servers, so you can't read the encrypted http headers when they hit the load balancer.
https://aws.amazon.com/elasticloadbalancing/features/?nc=sn&...
I have only one small caveat if your work is full of politics: The pressure to provide a replacement of the legacy system disappears and a strangler might transmute into the saving net of the legacy system.
Now you have two problems instead of one: the strangler AND the legacy system.
It's not my opinion that it's not safe, but FedRAMP. I'll just leave that at that.