4 ms·
This is my wet dream since lambda came out. But how about performance? What's the "cold" response latency compared to lambda?
by sscarduzio 9y ago
This is my wet dream since lambda came out. But how about performance? What's the "cold" response latency compared to lambda?
- alexellisuk 9y agoOther frameworks listed here have 350ms start time - OpenFaas is a number of times faster. It also depends entirely on the disk storage, RAM generation & speed and CPU. Golang and Python are fastest. I am sure it could be further optimized for a given combination. Tested on a Type 3 Packet Bare Metal host with latest Docker Swarm. Golang sample markdown function - 0.024s / 24ms. The NodeJS example called NodeInfo comes back in around 0.1s / 100ms for a round-trip. A bash built-in (cat) is 0.015s / 15ms. Python is similar to Golang for start time.
- notamy 9y agoSorry for the perhaps silly question, but is this completely cold start for the full round-trip, or is the container "pre-warmed" or something like that?
- jdc0589 9y agoid imagine that could be cold-start time so long as required images were already present on whatever host the job/function got run on.
- cnj 9y agoFor languages on the JVM, having a warmed-up JVM makes a big difference (not only because of the JVM startup, but also because the JIT compiler can work it's magic). Lambda optimizes for this and keeps the JVM around. From this example: https://github.com/alexellis/faas/blob/8ec31d9b89430176c834b2a89985289b2ff62458/sample-functions/BaseFunctions/java/Handler.java https://github.com/alexellis/faas/blob/8ec31d9b89430176c834b... and also from the docs, it looks like the JVM is started for each invocation. When I looked into funktion, it did the same. Do you have any plans to optimize for this use case? It looks like most Open-Source FaaS implementations don't even consider the JVM, so it's really great that OpenFaaS does! I'm planning to play around with it during our next techtime either way, but I'm unfortunately afraid it's too limiting if we have to cold-boot a JVM each time.
- alexellisuk 9y agoJoin us on Slack and let's do some testing and figure it out. Email alex@openfaas.com for an invite.
- alexellisuk 9y agoThe response time for the JVM on modern hardware looked good - similar to Node.js, but last night I tried re-using the forked process in Java and it appears to work very well. That would mean you only pay for the JVM boot once. If you or any other Java users/experts are willing to help test you're most welcome in the community.
- alexellisuk 9y agosscarduzio shoot a mail over to alex@openfaas.com and join us on Slack