131 points · by pierremenard · 2y ago · 51 comments
Really all that I want is for Render.com to have GPU instances (I saw fly.io now has GPUs which is great, but I've both heard bad things about their stability and don't care for their rethinking of server architecture). Please will someone give me PaaS web hosting with GPU instances?
I'm a simple man. If there's a fundamental shift in hosting philosophy I will resist that change. I have loved docker and PaaS as revolutions in development and hosting experiences because the interface is at some level still just running Linux processes like I do on my computer. You can tell me that now my code is hosted in a serverless runtime. But you need to give me that runtime so that I can spin it up on my own computer, on EKS, or whatever if need be.
Perhaps "EC2 on easy mode" is more like it.
The rust lambda SDK is just fine. You can write your rust endpoint on, e.g. Axum, then deploy straightaway.
I run a few full fledged apis with just one lambda in this way. It's not hard mode at all.
Like yourself I use Axum, and pretend AWS lambda doesn’t exist. By default I use the standard HTTP server for local development, I then have an environment variable to toggle lambda mode for when running in lambda. If I wanted to I can run the app anywhere, lambda, ec2, eks, fargate, 3rd party vps/server.
Using Cargo Lambda and its associated AWS CDK plugin it cross compiles to ARM64, sets up AWS stacks with databases or other resources, removes a bunch of manual tasks.
The only thing that is inconvenient is you can not use custom domains for function urls. If you need a vanity name, you have to go via api gateway and associated costs. That’s by design though.
The monolith lambda works well. The KISS approach
Did rust get native JSON support in the year since I last used it?
If you need JSON support in C++ nlohmann json is the defacto just like serde would be for rust.
Now if you just aren't adept at C++ build tooling that is fine as a reason to use Rust for this but "because there is no JSON support" definitely isn't a valid reason.
fundamentally it's a HTTPS server too, you can actually invoke them with direct HTTPS calls, no SDK required. [1]
[1]: https://docs.aws.amazon.com/lambda/latest/dg/urls-invocation...
You're gaining the fact that Function URLs are free while APIGW can be pretty costly, as well as the fact that Function URLs are fantastically less complex than APIGW if your use cases fit it.
EC2 isn't the same compute shape. We run fast-booting (think: seconds, not minutes), dynamic sandboxed containers on a single host (think: gVisor, Firecracker) and optimized file system lookups (FUSE, distributed caching, readahead, profiling). It also means we bill by the CPU cycle, scale rapidly, and bill you only for 100% utilization. You do not manage individual VMs.
This is why scaling the limits of functions-as-a-service is quite different from scaling VMs, and that's what the content of the article focuses on.
Writing a good network load balancer is very hard and we don't intend to suggest that it's our forte. We very much defer to all of the existing systems literature on this (and a couple papers like Maglev are in the post.)
If you’re invoking a heavy-duty, long running function then you’re likely doing something bespoke. Why use HTTP at all? Wouldn’t GRPC be a better fit, because that seems to be what is being reinvented here.
The selling point of HTTP is that it’s ubiquitous and simple. But you’re coupling it with an offering that is specific and complex. Is using a GRPC library such a burden that makes this effort worthwhile?
Which is exactly what you seem to want.
https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2....
Anyone know if there's anything like this, but using Python and self hostable?
> As of 2024, they can only use 3 CPUs (6 threads) and 10 GB of memory
Actually you get 1vCPU (eg a hyperthread) per 1769MB of memory[1]
[1] -https://docs.aws.amazon.com/lambda/latest/dg/configuration-f...
> Response bandwidth is 2 Mbps
This is shockingly low, and I wouldn't believe it without data. 16Mbps (2MB/s) would be more believable. In my experience you can reliably get 25MB/s (~400Mbps) in the network layer of things in AWS.
>Uncapped for the first 6 MB of your function's response. For responses larger than 6 MB, 2MBps for the remainder of the response
Some of the other numbers in the article are also incorrect. Lambda functions using containers can use a 10 GB container image (the article claims 50 MB), and container images are actually the faster/preferred way to do it these days.
Good point about 2 Mbps vs 2 MBps, I’ll update that. Forgive me for the typo!