struct InstanceRange#

struct InstanceRange#

The InstanceRange struct configures the range of function instance counts, used to schedule/deploy a range of function instances.

Note

Range scheduling is an atomic resource allocation strategy. Based on the user-configured max field, the current scheduling instance count is set to now = max. It first attempts to schedule now instances. If successful, it returns the scheduled instances. If unsuccessful, it decrements now by step (to the maximum of now - step and min) and attempts to schedule now instances again. This process continues until scheduling succeeds, times out, or all attempts fail (considered failed if scheduling still fails after stepping down to min).

Public Members

int min = DEFAULT_INSTANCE_RANGE_NUM#

The minimum allowed number of function instances, default is -1.

int max = DEFAULT_INSTANCE_RANGE_NUM#

The maximum allowed number of function instances, default is -1.

Both min and max default to -1. When both are -1, Range scheduling is disabled. When 1 <= min <= max, Range scheduling is enabled. Any other values are considered invalid and will throw an exception.

int step = DEFAULT_INSTANCE_RANGE_STEP#

The step size for decrementing max towards min, default is 2.

When Range scheduling is enabled, step must be greater than 0; otherwise, an exception will be thrown. If step is larger than max - min, it will step directly from max to min.

bool sameLifecycle = true#

Specifies whether a group of instances configured with Range scheduling share the same lifecycle.

Default value: true.

RangeOptions rangeOpts#

Defines lifecycle parameters for instance Range scheduling, including the total timeout for stepwise scheduling when kernel resources are insufficient.

struct RangeOptions#

The RangeOptions struct is a parameter within the InstanceRange struct of the Eugeo Range scheduling configuration.

It defines lifecycle parameters for instance Range scheduling, including the total timeout for stepwise scheduling when kernel resources are insufficient.

Warning

  1. A single Range can create a maximum of 256 instances in a group.

  2. Concurrent creation supports up to 12 groups, with each group capable of creating a maximum of 256 instances.

  3. Calling the Invoke() interface after NamedInstance::Export() will cause the current thread to hang.

  4. Making function requests directly to stateful function instances without calling Invoke() and then retrieving results will cause the current thread to hang.

  5. Repeatedly calling Invoke() will result in an exception being thrown.

  6. Instances within a Range do not support specifying a detached lifecycle.

Public Members

int timeout = NO_TIMEOUT#

Total timeout for stepwise scheduling when Eugeo kernel resources are insufficient, in seconds.

-1 indicates no timeout, and scheduling will continue until successful or all attempts fail. Any other value less than 0 will throw an exception.