5 ms·
I'm curious how they get around the challenge of slow startup and warmup time of the JVM.
by jshen 9y ago
I'm curious how they get around the challenge of slow startup and warmup time of the JVM.
- AdieuToLogic 9y agoThey may not have to. With a locked-down ClassLoader[0] and strict security settings, they could load up the jars in an already running JVM instance shared by multiple clients. 0 - https://en.wikipedia.org/wiki/Java_Classloader https://en.wikipedia.org/wiki/Java_Classloader
- merb 9y agoGoogle does/did (AppEngine Java8 can't do that because they do not have any strictness) that in AppEngine, but it is hard and challenging to get right. Especially the security bits.
- thesandlord 9y agoGCP employee here. The Java 8 runtime removed the sandbox restrictions. Most developers hated the restrictions. I highly doubt Microsoft would go down to the path of restrictions given the history in this space.
- merb 9y agoyeah I hated it. without it I can play with AppEngine once again, it is a really good platform but many restrictions were aweful. The last thing which would be nice if the bits to call any appengine api from custom threads (currently I copy the environment to every custom thread I do, which needs a custom ThreadFactory).
- oconnore 9y agoI don't think (or at least, the performance doesn't indicate) that AWS Lambda does anything special other than caching your function's JVM for some undefined period of time after every request.
- mccabe 9y agoOpenFaaS have the option of running Java functions in an "Afterburn" mode to mitigate against the JVM startup time. https://blog.alexellis.io/openfaas-serverless-acceleration/ https://blog.alexellis.io/openfaas-serverless-acceleration/
- crandycodes 9y agoI'm one of the devs on Azure Functions. In general, the trick is to basically never be cold. When you get assigned an instance, you keep it for a while before we put it to sleep. On the first call, you get assigned a "pre-warmed" instance that helps optimize load time. You can still help out by making sure your dependencies are lightweight. We've still got some work to do for the JVM before we GA Java, but it's a pattern we're pretty happy with so far.
- bklyn11201 9y agoThe pre-warmed instance is smart and a nice feature that AWS Lambda does not have. AWS Lambdas can be mostly kept warm via cron (incurring usage charges), but end-users will inevitably run into slow, cold-start responses during usage spikes as cold containers are spawned.