2

I have an Openwhisk setup on Kubernetes using [1]. For some study purpose, I want to have a fixed number of replicas/pods for each action that I deploy, essentially disabling the auto-scaling feature.

Similar facility exists for OpenFaas [2], where during deployment of a function, we can configure the system to have N function replicas at all times. These N function replicas (or pods) for the given function will always be present.

I assume this can be configured somewhere while deploying an action, but being a beginner in OpenWhisk, I could not find a way to do this. Is there a specific configuration that I need to change?

What can I do to achieve this in Openwhisk? Thanks :)

  1. https://github.com/apache/openwhisk-deploy-kube
  2. https://docs.openfaas.com/architecture/autoscaling/#minmax-replicas
Anirban Das
  • 113
  • 2
  • 6

1 Answers1

0

OpenWhisk serverless functions follow closer to AWS lambda. You don’t set the number of replicas. OpenWhisk uses various heuristics and can specialize a container in milliseconds and so elasticity on demand is more practical than kube based solutions. There is no mechanism in the system today to set minimums or maximums. A function gets to scale proportional to the resources available in the system and when that capacity is maxed out, requests will queue.

Note that while AWS allows one to set the max concurrency, this isn’t the same as what you’re asking for, which is a fixed number of pre-provisioned resources.

Update to answer your two questions specifically:

Is there a specific configuration that I need to change?

There isn’t. This feature isn’t available at user level or deployment time.

What can I do to achieve this in Openwhisk?

You can modify the implementation in several ways to achieve what you’re after. For example, one model is to extend the stem-cell pool for specific users or functions. If you were interested in doing something like this, the project Apache dev list is a great place to discuss this idea.

user6062970
  • 831
  • 4
  • 5
  • Thank you for replying. I understand that from a client side perspective, for just deploying functions, there is no way to set fixed number of provisioned resource while deploying the function. However is there a way to achieve this while setting up Openwhisk system as an _admin_ (for lack of better words) from the backend? – Anirban Das Oct 27 '19 at 02:22
  • 1
    The system treats all resources as transient and so there is no way to hold resources indefinitely for a specific function. Even previously allocated resources (warm starts) are eventually reclaimed (either due to load or aging). You’d have to modify the system to do what you want. – user6062970 Oct 27 '19 at 10:15