5 Elastic Actions

This chapter introduces and describes the two elastic actions, scale up and scale down, for configuring elasticity in WebLogic Server 12.2.1.

This chapter includes the following sections:

Introducing the Elastic Actions

The scale up and scale down actions are used to add or remove running dynamic server instances from a dynamic cluster during scaling operations.

Elastic actions can be 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. For more information on policy-based scaling, see Chapter 7, "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 those 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 5-1 shows a scale up action that scales up a dynamic cluster by one running dynamic server instance.

Example 5-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 5-2 shows how to create and configure the scale up action shown in Example 5-1 using WLST. This scale up action is used as part of the policy-based scaling demo in Policy-Based Scaling Example.

Example 5-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 5-3 shows a scale down action that scales down a dynamic cluster by one dynamic server instance.

Example 5-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 5-4 shows how to create and configure the scale down action shown in Example 5-3. This scale down action is used as part of the policy-based scaling demo in Policy-Based Scaling Example.

Example 5-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 Table 3-1 for descriptions of these attributes.

Roadmap for Creating and Configuring Elastic Actions

You can also create and configure scale up and scale down actions using the WebLogic Server Administration Console or Fusion Middleware Control. See Table 5-1 for more information.

Table 5-1 Elastic Actions Roadmap

For more information on... See...

Creating actions in the WebLogic Server Administration Console

"Create actions for policies in a diagnostic system module" in the Oracle WebLogic Server Administration Console Online Help

Creating elastic actions in the WebLogic Server Administration Console

"Create a scale up action" and "Create a scale down action" in the Oracle WebLogic Server Administration Console Online Help

Configuring elastic actions in the WebLogic Server Administration Console

"Configure a scale up action" and "Configure a scale down action" in the Oracle WebLogic Server Administration Console Online Help

Creating elastic actions in Fusion Middleware Control

"Create a scale up or scale down action" in Administering Oracle WebLogic Server with Fusion Middleware Control

Configuring elastic actions in Fusion Middleware Control

"Configure a scale up action" and "Configure a scale down action" in Administering Oracle WebLogic Server with Fusion Middleware Control