Instead of one off execution, keep container running for a while and take requests.
The first version executes a container per function call/request. Which is fine for many things, but we may want a way to run for longer periods of time to increase performance due to things like keeping db connections open, etc.
This would probably require a more lambda like code format and language libraries. See https://github.com/iron-io/lambda for existing work on lambda style code format.
I created a prototype of this years ago that routed traffic into IronWorker containers, should dig that out and look into that implementation.
@ccirello brought up that container performance degrades over time and would not increase or improve performance! How do we proceed?
It does improve the performance, because it wouldn't involve the cost of starting the container - but the tradeoff is that eventually the docker daemon degrades. That's what the rotation is all about, in the end no?
My first intuition is to say that we shouldn't do it. But I think we'd better to think a little longer about the idea. Also there's the problem of the shared state between executions within the scope of the same container.
Some useful info here https://aws.amazon.com/blogs/compute/container-reuse-in-lambda/
This is unrelated to runner rotation really. I agree waiting on this is a good idea.
#332 fixes this