Deployment Descriptor SLA Element

  GigaSpaces 5.X

Documentation Home
Quick Start Guide
Release Notes

Previous release

  Search Here
Searching GigaSpaces Platform 5.X Documentation

                                               

Summary: In context of the Deployment Descriptor, an SLA is a contractural service commitment describing the minimum performance criteria to meet while delivering a service.

Overview

The definition of a SLA typically represents a contractual service commitment, describing the minimum performance criteria to meet while delivering a service. In this context the SLA element provides the means to specify low and high limits (defining an acceptable range) for a SLA with a given identifier. Additionally the SLA provides a mechanism to associate a SLA policy handler, which can be used to process policies specific to SLAs as they occur, taking specific actions appropriate for the ServiceBean.

SLA Policy Handlers

The Service Grid provides 3 SLA policy handlers. Additional policy handlers can be created by extending the policy handler class.

Configuration Key Behavior
notify If a threshold is crossed (breached or cleared), fire a SLAThresholdEvent to all registered event consumers.
relocation If thresholds are crossed, relocate the service to a compute resource which meets the operational requirements declared by the service.
scaling Increment and decrement instances of the ServiceBean it is associated to based on limits set for the SLA

When a SeviceBean is instantiated by a GSC, the SLA element's ID is used to match a Watch that has been created by the ServiceBean, or declaratively created. If the SLA ID cannot be matched to a watch, the SLA will not be associated.

Once associated the SLAPolicyHandler will be notified based on the thresholds that have been set.

Sample SLA Declaration

An example SLA declaration follows:

<SLA ID="backlog" Low="100" High="500">
    <PolicyHandler type="scaling" max="10"
                   lowerDampener="3000" upperDampener="3000"/>
</SLA>

This SLA declares that a scaling policy handler be attached to a watch with the name of "backlog", that the number of services scale up to 10. This declaration also inlcudes lowerDampener and upperDampener configuration. The lowerDampener and upperDampener attributes have to do with the avoidance of oscillating around a threshold which is breached. These values behave as a smoothing filter, taking into account the reality that action on a threshold breach may need to be delayed.

Behavior if Type is Relocation or Notify

  • If the "type' is either relocation or notify, the max attribute is ignored.
  • If the type is notify, the lowerDampener and upperDampener attributes are ignored.

Matching SLA to Watch

The SLA is not always tied to the SLA ID attribute for matching up to a Watch. By declaring the <Monitor> element within the scope of the <SLA> element, a Watch will be dynamically added, using the declared attributes to obtain the information needed to observe the declared SLA thresholds. The SLA will be associated to the name of the <Monitor> (which is a Watch). This is illustrated here:

<SLA ID="backlog" Low="100" High="500">
    <PolicyHandler type="scaling" max="10"
                   lowerDampener="3000" upperDampener="3000"/>
    <Monitor name="collector" property="count" period="5000/
</SLA>

The Monitor declaration tells the Service Grid runtime to create and register a watch with the name of "collector", reading the getCount method every 5 seconds.

If the Watch already exists in the bean's WatchRegistry, the watch will not be added.

Java Bean Getter Method

The bean must declare a Java bean getter method that has as it's return type one of the following:

  • Supported primitive types: int.class, long.class, float.class, double.class
  • Supported types: Integer.class, Long.class, Lloat.class, Double.class

The read property return type is verified prior to watch creation. For example, given a bean called Foo, which declares a method called getCollector :

public class Foo {
    ...
    public long getCollector() {
        return(value);
    }
    ...
}

Defining Custom SLA Watcher

If you need to create a custom SLA watcher, use the Watch capability from the Rio project. The best way to do this with the M2 release is to use the Rio ServiceBean model.

The next release will allow injection of the ServiceBeanContext to a POJO if desired.

To define a custom SLA Watcher:

  1. Based on the type of item you are watching, create one of the following:
    • A CounterWatch – counts a monotonically-increasing non-negative value of an arbitrary occurance of something over time.
    • A GaugeWatch – records values that can go up and down, and can be positive or negative.
    • A StopWatch – used for capturing elapsed time.
      The following code snippet illustrates this:
      GaugeWatch sampleWatcher = new GaugeWatch("metric");
      watchRegistry.register(sampleWatcher);
  2. In the Deployment Descriptor, declare an SLA as follows:
    <ServiceLevelAgreements>
    	<SLA ID="metric" Low="100" High="500" >
    		<Configuration>
    		...
    		</Configuration>
    	</SLA>
    </ServiceLevelAgreements>

RELATED TOPICS

Declaring Elements Globally in Deployment Descriptor
Declaring Service UI in Deployment Descriptor
Deployment Descriptor Codebase Element
Deployment Descriptor DeploymentSchedule Element
Deployment Descriptor Parameters and Configuration Elements
Deployment Descriptor SharedComponent Element
Deployment Descriptor SLA Element
deploy - Service Grid CLI
Fixed and Dynamic ServiceBean ProvisionType
Injecting Deployment Descriptor Properties into POJOs
POJO Lifecycle in Service Grid
Proactive Cache
redeploy - Service Grid CLI
Rio OperationalString
Service Associations
Service Deployment Descriptor
Service Grid ClassLoader Hierarchy
undeploy - Service Grid CLI
Using Service Grid to Deploy Partitioned Space
Using Service Grid to Deploy Partitioned Space with Backup
Using Service Grid to Deploy Replicated Space
Using Service Grid to Deploy Space
Using Service Grid to Deploy Spring Applications
Using System Properties for Deployment Descriptor Element Values

Wiki Content Tree


Your Feedback Needed!

We need your help to improve this wiki site. If you have any suggestions or corrections, write to us at techw@gigaspaces.com. Please provide a link to the wiki page you are referring to.

Labels