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
maxfield, the current scheduling instance count is set tonow = max. It first attempts to schedulenowinstances. If successful, it returns the scheduled instances. If unsuccessful, it decrementsnowbystep(to the maximum ofnow - stepandmin) and attempts to schedulenowinstances again. This process continues until scheduling succeeds, times out, or all attempts fail (considered failed if scheduling still fails after stepping down tomin).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
minandmaxdefault to -1. When both are -1, Range scheduling is disabled. When1 <= 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
maxtowardsmin, default is 2.When Range scheduling is enabled,
stepmust be greater than 0; otherwise, an exception will be thrown. Ifstepis larger thanmax - min, it will step directly frommaxtomin.
-
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.
-
int min = DEFAULT_INSTANCE_RANGE_NUM#
-
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
A single Range can create a maximum of 256 instances in a group.
Concurrent creation supports up to 12 groups, with each group capable of creating a maximum of 256 instances.
Calling the
Invoke()interface afterNamedInstance::Export()will cause the current thread to hang.Making function requests directly to stateful function instances without calling
Invoke()and then retrieving results will cause the current thread to hang.Repeatedly calling
Invoke()will result in an exception being thrown.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.