Right now OpenWhisk looks at an action's namespace and name when selecting
a container from the warm pool. Instead, I'd like to propose that we look
at the action's namespace and a hash of the action's code itself (either
source or binary). This would allow multiple actions that share the same
code to have a higher warm container cache hit rate and decrease overall
churn in the container pool. This change is based on an assumption that it
will not be uncommon to have multiple actions that all live in the same
source tree and share action code with separate `main` classes/methods.
This wouldn't change the concurrency or isolation model of actions; it
would just allow container reuse between actions that share the exact same
code.

We discussed this a bit on Slack and agreed it would be good to talk about
on the list. I'm paraphrasing some of the additional comments from Slack
below so we can discuss those as well.


Rob Allen (akrabat) in Slack - "Thinking about it, I have a feeling that
serverless framework works like that"

Does anyone know if Serverless reuses the same packaged artifact for every
function deployed with `serverless deploy` and just switches out the
`--main` argument?


Michael Marth (mmarth) in Slack - "I would implement that by tracking the
hash of the action code along with the action. The reason why I mention the
implementation: if we were to track the content hash of the action code (a
bit like content addressed storage) then that would open other benefits
apart from the one @bbrowning described. For example: the action storage
could be slow/remote and action code caches local to the action invocation
could quickly do cache lookups."


Markus Thömmes (markusthoemmes) in Slack pointed out that
https://github.com/apache/incubator-openwhisk/blob/master/core/controller/src/main/scala/whisk/core/loadBalancer/LoadBalancerService.scala#L311
and
https://github.com/apache/incubator-openwhisk/blob/master/core/invoker/src/main/scala/whisk/core/containerpool/ContainerPool.scala#L201
would be the lines to change.

Thoughts?

Ben

Reply via email to