Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I cannot find this in the documentation (I'm sure it's there somewhere) so let me ask here. How long does a function stay warm? As in, a client makes a request that invokes a function, the function processes the request and responds to the client. Now what? Does the same "instance" of a function stay alive to handle another request for a certain period of time or is it immediately released?

I'm asking because sometimes it's necessary to do some expensive work in order to respond to the request and doing the same work on every invocation is not necessary. For example on AWS Lambda, one of our functions launches a Chromium instance which can take a few seconds, but because the function can stay alive after a request is done, the same Chromium instance is immediately ready on the next function invocation. Other use cases involve e.g. connecting a database (which I see CF is tinkering with over at [0]).

[0] https://github.com/cloudflare/db-connect



Isolates stay warm until the memory they consume is needed for something else. We evict the least-recently-used isolate when we need memory for a new one. So how long that is varies depending on how much traffic the isolate gets compared to its neighbors.

This is covered in more detail in my talk: https://www.infoq.com/presentations/cloudflare-v8/


Excuse me if this is a silly question. Some containers take a while to initialize, do you have a way to automatically hibernate their memory state? When will you support Julia?


We don't use containers, we use V8 isolates. V8 is limited to executing JavaScript and WebAssembly, though many other languages can be compiled/transpiled to one of those two. But, we don't run native Linux binaries.

EDIT: It looks like Julia has some Wasm support. I haven't tried it though. https://github.com/Keno/julia-wasm




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: