Paul
Paul

Reputation: 199

OpenWhisk Invoker Agent Suspend Time

Deployed Openwhisk on Rancher with kubernetesContainerFactory and Invoker Agent enabled. Invoked hello.js action and wsk created pods wskowdev-invoker-00-1-prewarm-nodejs10 and wskowdev-invoker-00-2-prewarm-nodejs10. Pod 1 got removed after 15 minutes but pod 2 never gets removed by the invoker agent. My understanding is after a specified period of time the pods should be suspended. Please clarify how the invoker agent and pod suspension/removal works.

Upvotes: 0

Views: 200

Answers (1)

user6062970
user6062970

Reputation: 831

One of the pre-warmed containers was removed after because it was used. The other is still pristine and remains around/not reclaimed. This is called a stem cell container. A container is subject to garbage collection later once it is specialized (initialized with user code).

The default idle timeout is 10 minutes though, not 15 per this configuration, unless overridden.

https://github.com/apache/incubator-openwhisk/blob/2f0155fb750ce8b5eef6d5b0f4e2e2db40e5a037/core/invoker/src/main/resources/application.conf#L103-L110

The number of stemcells is specific to a runtime and determined by the runtime manifest. For example: https://github.com/apache/incubator-openwhisk/blob/ce45d54c824ef6c3e5d98ce0b220b924c81e688b/ansible/files/runtimes.json#L45-L50

Once a stem cell container is used, a nanny process will replace it with a new container so that the number of pre-warmed containers should generally be constant.

Upvotes: 3

Related Questions