Planning resource capacity with resource capacity planning constraints

You can use the constraints in the topology editor to help ensure that your infrastructure has the capacity that your application requires, such as sufficient memory and processing power.

About this task

With the resource capacity planning constraint, you can specify the amount of a particular system resource, such as memory or processor capacity, that an application component requires. When you use this type of constraint, the topology editor ensures that the hosting stack can support the components.

Unless you specify otherwise, capacity constraints are not additive. For example, if a server has 2 gigabytes of memory, it can host any number of applications as long as none of the individual applications requires more than 2GB. The total memory requirements of the applications may be more than 2GB, but this sum does not invalidate the constraint.

If you want the capacity constraints to be additive, you can specify that the application components each require exclusive access to a certain amount of system resources. For example, if an application requires access to 2GB of memory for its own use at all times, you can specify its need for exclusive access to that memory.

When you create a resource capacity planning constraint on a unit, you identify a capability that provides the resource that the application component needs. In the prior example, an application component required a certain amount of memory. On a piece of hardware, the memorySize attribute on the server.Server capability specifies the amount of memory that is available the system. In this way, the topology editor compares the memory specified in the resource capacity planning constraint on the application component with the amount of memory specified on the server's memorySize attribute.

Example of the resource capacity planning constraint that specifies at least 3GB of memory

Similarly, you can specify that an application component requires a certain amount of processing capacity on the server by specifying the CPU Speed attribute on the server.Server capability.

A similar example of a resource capacity planning constraint that requires a 3GHz processor

As another example, you can specify the disk space that an application requires. However, you must use units that have capabilities with attributes that specify disk space. For example, you can add an os.DataFileUnit unit to represent a particular file or group of files, and host that unit on a os.FileSystemUnit unit. You can add a resource capacity planning constraint to the os.DataFileUnit that specifies a certain amount of free disk space on the freeSpace attribute of the os.fileSystemUnit unit.

An example of a file unit that has a resource capacity planning constraint on the file system that hosts it

Procedure

The following steps illustrate one way to create a resource capacity planning constraint:

  1. In a new topology, create or import units that represent the components of your application. You can use technology-specific units, such as Java™ EE and database components, or you can use generic units.
    An EAR unit
  2. Apply resource capacity planning constraints to the units to specify their resource requirements:
    1. Double-click the unit to open its properties window.
    2. Go to the General tab and click the Constraints tab at the bottom of the properties window.
    3. Click Add new constraint , and select Resource Capacity Planning from the list of constraints.
    4. From the window that opens, set the caption for the constraint, and specify the type of capability that provides the hosting resources. The default capability for this constraint is server.Server, representing the ability of a piece of server hardware to host software.
      Adding a resource capacity planning constraint to a unit
      The resource capacity planning constraint also includes a default child constraint. With the child constraints, you will specify the resources that the unit requires.
    5. Select the child constraint and set its caption, the attribute that represents the hosting resources, and the minimum value that the unit requires. For example, if the unit requires at least 512 MB of memory on its host of the type server.Server, select the memorySize attribute and set the Restriction value to 512MB. The attributes that are available in this list depend on the type of capability that is selected in the parent constraint.
      Setting the attribute and value for the constraint
    6. If the unit requires exclusive access to the hosting resources (that is, it cannot share the resources with another unit), select the Exclusive access check box.
    7. Add other child constraints to the parent resource capacity planning constraint by selecting the parent constraint, clicking Add new constraint as child, and selecting the Attribute Capacity constraint. This is the type of the default child constraint that was created with the resource capacity planning constraint.
  3. Optional: Make the constraint visible by showing it as part of the unit's property notes:
    1. Double-click the unit to open its properties window.
    2. Go to the Appearance tab of the properties window.
    3. Select the Property notes check box.
    4. Next to the Property notes check box, click Edit.
    5. In the Property Notes window, select the check box next to the resource capacity planning constraint and click OK.
    Now the constraint is shown on the unit.
    Making the constraint values visible as part of the property notes of the unit
  4. Create or import units that represent the infrastructure that is available to your application. At least one of these units must have the capability, or a subtype of the capability, that you specified in the resource capacity planning constraint.
  5. In the attributes of the capabilities on the infrastructure units, specify the resources that the unit provides. For example, if you are working with the server.Server capability, you might specify the amount of memory on that server by setting the memorySize attribute.
    Setting the attribute values for the capability
  6. Optional: Expose the capacity of the infrastructure units in the property notes.
  7. Host the application components on the infrastructure components. The topology editor adds errors when you exceed the hosting capacity of a unit.
    An error caused by insufficient memory on the server
    If you specified that the constraints were exclusive, the topology editor ensures that the host has enough system resources for all of the hosted units.
    An error caused by insufficient exclusive memory on the server

Feedback