3 On-Demand Scaling
Oracle WebLogic Server supports on-demand scaling, which is the ability to scale a dynamic cluster up or down by manually adding or removing running dynamic server instances as needed. On-demand scaling is the simplest and most basic form of incorporating elasticity into a WebLogic domain.
This chapter includes the following sections:
What is On-Demand Scaling?
When you expand the cluster, the size must not exceed the limit set in Maximum Dynamic Cluster Size. WebLogic Server adds only running dynamic server instances up to the Maximum Dynamic Cluster Size limit. Also, when you shrink the cluster, the number of running dynamic servers cannot be below the limit set in Minimum Dynamic Cluster Size.
To perform on-demand scaling, you must have a dynamic cluster configured. See Dynamic Clusters in Administering Clusters for Oracle WebLogic Server.
You can perform on-demand scaling using the WebLogic Server Administration Console, Fusion Middleware Control, or WLST, as described in the following sections:
Note:
Before performing on-demand scaling of a dynamic cluster, make sure that the scaling operation will not have adverse effects on the rest of the system. For example, before a scale up, it may be necessary to adjust JDBC connection pool sizes and Work Manager parameters to avoid exceeding database capacity. Before a scale down, make sure that any inflight work has a chance to finish before the dynamic server instances are shut down. Also, if you are using JMS or JTA, do not use a scale down approach that lowers the dynamic cluster size configuration setting. See Best Practices for Using Clustered JMS Services in Administering JMS Resources for Oracle WebLogic Server.
On-Demand Scaling Using the WebLogic Server Administration Console
You can perform on-demand scaling using the WebLogic Server Administration console.
- In the left navigation pane, select Environment > Clusters.
- In the Clusters table, select the name of the dynamic cluster you want to scale up or scale down.
- Select Control > Scaling.
- In the Desired Number of Running Servers field, enter the number of running dynamic server instances you want in the dynamic cluster.
- Click Ok.
See Perform on-demand scaling for a dynamic cluster in the Oracle WebLogic Server Administration Console Online Help.
On-Demand Scaling Using WLST
You can manually scale a dynamic cluster up or down using the WLST commands.
To manually scale your dynamic cluster using WLST:
-
Use the
scaleUp
command to increase the number of running dynamic servers in your dynamic cluster. When you use thescaleUp
command and enable theupdateConfiguration
argument, WLST will increase the size of the dynamic cluster by the specified number of dynamic servers and start these server instances. -
Use the
scaleDown
command to decrease the number of running dynamic servers in your dynamic cluster. When you use thescaleDown
command and enable theupdateConfiguration
argument, WLST will gracefully shut down the specified number of running dynamic servers and remove them from the dynamic cluster.Note:
ThescaleDown
command lowers the cluster dynamic cluster size setting when itsupdateConfiguration
option is enabled, which in turn can abandon JMS persistent messages and JTA transactions that are associated with retired servers. If you are using JMS or JTA, do not usescaleDown
with itsupdateConfiguration
option enabled. See Best Practices for Using Cluster Targeted JMS Services in Administering JMS Resources for Oracle WebLogic Server.
See scaleUp and scaleDown commands in WLST Command Reference for WebLogic Server.
See Expanding or Reducing Dynamic Clusters in Administering Clusters for Oracle WebLogic Server.
Example 3-1 demonstrates how to use WLST to scale a dynamic cluster named DynamicCluster
up by two running dynamic server instances and then scale it back down by one running dynamic server instance.
Example 3-1 On-Demand Scaling Using WLST
wls:/offline> connect('weblogic','weblogic','t3://localhost:7001') Connecting to weblogic server instance running at t3://localhost:7001 as username weblogic... Successfully connected to Admin Server 'AdminServer' that belongs to domain 'mydomain'. wls:/mydomain/serverConfig/> scaleUp("DynamicCluster", 2, true ,true) Remote ScaleUp started successfully after 38 seconds. Waiting for 2 servers to reach the running state. The timeout is 600 seconds. All servers are now running. wls:/mydomain/serverConfig/> scaleDown("DynamicCluster", 1, true ,true) Remote ScaleDown started successfully after 0 seconds. The servers were stopped successfully.