Scaling Composite

The composite.Scaler component allows to dynamically adjust a number of components in your instance. It is used as an ordinary composite component but instantiates his children multiple times. Scaler children are homogeneous and use the same configuration.

Interfaces

There is one static interface in the composite.Scaler component:

scale:
  set-quantity: receive-command(int quantity)

You can invoke the set-quantity command to change a number of scaler children.

Configuration

Name Type Definition
configuration.minQuantity int Minimal quantity of scaler children, 1 by default
configuration.maxQuantity int Maximal quantity of scaler children, 32 by default
configuration.quantity int Use a fixed numer of scaler children, not set by default

If configuration.quantity is not set, it is possible to scale dynamically with set-quantity command calls within the limits enforced by configuration.minQuantity and configuration.maxQuantity.

A scaler will start with configuration.quantity if set, or with configuration.minQuantity otherwise.

Limitations

  • You cannot have mappings that cross scaler boundary, except for the configuration ones.

Example

application:
  interfaces:
    server:
      url: bind(haproxy#server.url)
    scale:
      set-quantity: bind(servers#scale.set-quantity)
  components:
    haproxy: { ... }
    servers:
      type: composite.Scaler
      components:
        tomcat: { ... }
  bindings:
    - [haproxy, servers.tomcat]