4 ms·
It'd be good if AWS Lambda provided a wasm runtime option. Cold start times for WebAssembly can be sub-millisecond. It'd also be interesting to see comparisons
by breve 1y ago
It'd be good if AWS Lambda provided a wasm runtime option. Cold start times for WebAssembly can be sub-millisecond.
It'd also be interesting to see comparisons to the Java and .NET runtimes on AWS Lambda.
- syrusakbary 1y agoIf you want to run in a WebAssembly runtime, perhaps Wasmer can be a good choice for you. Note: we don't support .NET or Java atm, but we support PHP and Python is about to be fully supported! https://wasmer.io/products/edge https://wasmer.io/products/edge
- hylaride 1y agoJava startup times would almost certainly be worse, depending on what's going on. A previous job I worked at ran Java on AWS Lambda. We ran our busiest Java lambda in a docker layer as our whole build system was designed around docker and from a compute performance point of view it was just as fast. The main issues were: * Longer init times for the JRE (including before the JIT kicks in). Our metrics had a noticeable performance hit that lined up to the startup of freshly initialized lambdas. It was still well within a tolerable range for us, though. * Garbage collection almost never ran cleanly due the code suspension between invocations, which means we had to allocate more memory than we really needed. The native AWS Lambda Java's 'snap start' would have helped, but the startup times were just not a big deal for our use case - we didn't bother with provisioning lambdas either. Despite the added memory costs, it was also still cheap enough that it was not really worth us investigating Java's parallel GC. So as always, what language one should use depends on your use case. If you have an app that's sensitive to "random" delays, then you probably want something with less startup overhead.
- alserio 1y agoYou can use graalvm AoT. It mitigates the issues for some use cases when you need to use Java. Standard Java on Lambda has not been feasible for me either
- tealpod 1y agoYes, We used GraalVM for data encryption project, side-effect is super fast performance. The number of req/sec also 3x.
- zokier 1y agoRust/C++ lambda cold starts are in the 15ms ballpark, it is very unlikely that you are going to get anything much faster than that. Spinning up firecracker vm just inherently takes some time no matter what you run inside it. https://maxday.github.io/lambda-perf/ https://maxday.github.io/lambda-perf/
- Hamuko 1y agoI can't bring myself to use Rust for AWS Lambda since the runtime is still marked as "experimental". >The Rust runtime client is an experimental package. It is subject to change and intended only for evaluation purposes.
- Hamuko 1y agoCloudflare offers Wasm for their Workers service. Haven't tested it though. https://developers.cloudflare.com/workers/runtime-apis/webassembly/ https://developers.cloudflare.com/workers/runtime-apis/webas...