4 Elastic Actions

The Policies and Actions component of the WebLogic Diagnostics Framework (WLDF) in Oracle WebLogic Server provides two actions for performing elastic operations in a dynamic cluster: scale up, and scale down.The following sections describe the two elastic actions and the roadmap for configuring the elastic actions:

Introducing the Elastic Actions

The scale up and scale down actions are used to start or stop running dynamic server instances in a dynamic cluster during scaling operations.

Elastic actions are associated with policies. As a policy's conditions are met, the elastic action is triggered and the scaling operation begins. This type of scaling is called policy based scaling. See Policy-Based Scaling.

Only one elastic action can be assigned to a policy. However, any number of non-scaling actions can be assigned to a policy, and elastic actions can be used in conjunction with non-scaling actions.

Note:

To configure automated elasticity for a dynamic cluster, you must create a domain-scope diagnostic system module in which you define the scaling policies, along with their corresponding elastic actions, and then target that diagnostic module to the Administration Server.

See Configuring Policies and Actions in Configuring and Using the Diagnostics Framework for Oracle WebLogic Server for information on the Policies and Actions component of WLDF.

Configuring Scale Up Actions

When an associated policy is triggered, the scale up action adds running dynamic server instances to the specified dynamic cluster.

Example 4-1 shows a scale up action that will scale a dynamic cluster up by one running dynamic server instance.

Example 4-2 shows how to create and configure the scale up action shown in Example 4-1 using WLST. This scale up action is used as part of the policy-based scaling demo in Policy-Based Scaling Example.

Example 4-1 Sample Configuration for a Scale Up Action (in DIAG_MODULE.xml)

<wldf-resource>
   <name>ClusterManager</name>
   <watch-notification>
     <!-- One or more policy configurations -->
     <scale-up-action>
        <name>scaleUp</name>
        <cluster-name>DynamicCluster</cluster-name>
        <scaling-size>1</scaling-size>
     </scale-up-action>
     <!-- Other action configurations -->
   </watch-notification>
</wldf-resource>

Example 4-2 Configuring a Scale Up Action

startEdit()
scaleUp=wn.createScaleUpAction('scaleUp')
  scaleUp.setScalingSize(1)
  scaleUp.setClusterName(DynamicCluster)
save()
activate()

Configuring Scale Down Actions

When an associated policy is triggered, the scale down action shuts down running dynamic server instances in the specified dynamic cluster.

Example 4-3 shows a scale down action that will scale down a dynamic cluster by one dynamic server instance.

Example 4-4 shows how to create and configure the scale down action shown in Example 4-3. This scale down action is used as part of the policy-based scaling demo in Policy-Based Scaling Example.

Shutting down server instances during a scale down operation can take a significant amount of time if there are, for instance, unreplicated sessions. Until they time out, the server instance will not shut down.

To reduce the time it takes to complete a scale down operation, the following DynamicServersMBean attributes are used:

  • DynamicClusterShutdownTimeoutSeconds

  • IgnoreSessionsDuringShutdown

  • WaitForAllSessionsDuringShutdown

By specifying a timeout period or ignoring sessions during server shutdown, the shutdown time can be limited. However, remaining sessions may be lost. See Table 2-1 for descriptions of these attributes.

Example 4-3 Sample Configuration for a Scale Down Action (in DIAG_MODULE.xml)

<wldf-resource>
   <name>ClusterManager</name>
   <watch-notification>
     <!-- One or more policy configurations -->
     <scale-down-action>
        <name>scaleDown</name>
        <cluster-name>DynamicCluster</cluster-name>
        <scaling-size>1</scaling-size>
     </scale-down-action>
     <!-- Other action configurations -->
   </watch-notification>
</wldf-resource>

Example 4-4 Configuring a Scale Down Action

startEdit()
scaleDown=wn.createScaleDownAction('scaleDown')
scaleDown.setScalingSize(1)
scaleDown.setClusterName(DynamicCluster)
save()
activate()

Shutting down server instances during a scale down operation can take a significant amount of time if there are, for example, unreplicated sessions. Until those unreplication sessions time out, the server instance is not shut down.

To reduce the time it takes to complete a scale down operation, you can configure the following DynamicServersMBean attributes:

  • DynamicClusterShutdownTimeoutSeconds

  • IgnoreSessionsDuringShutdown

  • WaitForAllSessionsDuringShutdown

By specifying a timeout period or ignoring sessions during server shutdown, the shutdown time can be reduced. However, remaining sessions may be lost. See Configuring Dynamic Clusters for descriptions of these attributes.