Overview

This page describes the integration between GigaSpaces XAP, the Citrix NetScaler load balancer and the Citrix XenServer Virtual Machine manager.
Watch a screencast of the Petclinic web application integration demo

Purpose of Integration

The integration effort focuses on the Load Balancer functionality of the NetScaler appliance. The end result is a system that monitors the performance metrics of a web application that is running a GigaSpaces cluster.

The web application's performance metrics are monitored and compared against predefined thresholds. When Performance metrics exceed the thresholds a new web server VM is started (or terminated) automatically. The web server VM is started, deployed and added to the load balancer pool automatically. This is achieved by integrating together the XenServer APIs, GigaSpaces XAP admin APIs and NetScaler load balancer APIs.

An unexpected failure of a web server VM is also detected, which triggers a new web server VM. Within two minutes the new VM starts processing web requests.

Citrix NetScaler

Citrix NetScaler is a Web application delivery appliance that makes applications run five times better. Available as a separate hardware network device or as a virtualized appliance, NetScaler optimizes application availability through advanced L4-7 load balancing and traffic management, accelerates performance, increases security with an integrated application firewall and substantially lowers costs by increasing Web server efficiency.  

Citrix XenServer

Citrix XenServer is a complete, managed server virtualization platform built on the powerful Xen hypervisor. Xen technology is widely acknowledged as the fastest and most secure virtualization software in the industry. XenServer is designed for efficient management of Windows® and Linux® virtual servers and delivers cost-effective server consolidation and business continuity.

Architecture


Web SLA Monitor

The web SLA Monitor is a GigaSpaces Processing Unit (PU) that periodically monitors the average web request rate per web server. This information is provided by the embedded Jetty web server and is aggregated and exposed via the GigaSpaces Admin API
The SLA Monitor compares the average request rate per server to configurable high and low thresholds. (Average web request latency can also be monitored).

  • When request rate is above the high threshold then a new Xen VM is created. The Gigaspaces agent running on the VM deploys the required web application stack.
  • The load balancer is configured to work in a 'Round-Robin' policy so adding a new web server immediately reduces the average request rate per server. GigaSpaces distributed session caching populates the new web server with the required state generated by other servers.
  • When request rate is below the low threshold and there are at least three running web servers, one of the web server VMs is terminated. The freed CPU/Memory resource can be reused by other GigaSpaces Processing Units.


Load Balancer Agent

The Load Balancer agent monitors the GigaSpaces cluster for changes in membership.

  • When a new web server becomes available, the agent updates NetScaler with the new IP address and port number so that web server is added to the round robin pool.
  • When a web server becomes unavailable, the agent removes the relevant entry from the NetScaler load balancer. This relieves Netscaler from monitoring terminated servers and allows IP/port reuse by another web application.


Load Generator

The load generator is a GigaSpaces PU that generates HTTP requests which are send to the NetScaler load balancer. The load changes when the user increases or decreases the number of active load generator instances. When the load crosses the threshold it triggers the web scaling agent scale-out/scale-in rule.


How to Use the GigaSpaces/Citrix integration package

This section describes how to build, configure and run the integration package.

Download

petclinic_xap_netscaler_xenserver.zip - includes binaries and source code.

Infrastructure

Infrastructure deployment instructions can be found at the GigaSpaces blog:
http://blog.gigaspaces.com/2010/09/29/building-your-own-iaas-in-the-cloud-part-1-iaas-flavors
http://blog.gigaspaces.com/2010/10/02/building-your-own-iaas-part-2-dhcp-server
http://blog.gigaspaces.com/2010/10/05/building-your-own-iaas-part-3-centos-machine-image
http://blog.gigaspaces.com/2010/10/13/building-your-own-iaas-part-4-netscaler-load-balancer

You can find out petclinic mysql configuration and permissions in src/petclinic/spring_petclinic_tweaks.txt

After extracting the zip file, edit tools/deploy.groovy and modify the ip addresses ports and passwords of the mysql server, xenserver, netscaler load balancer and the virtual petclinic loadbalancer.
Use the build script that is placed under the tools folder to initialize the mysql database:
tools/build.sh create_db

For a more complete understanding of the Citrix products used in this integration, please read the respective product documentation.

Run

Start the GigaSpaces agent and the GigaSpaces Management UI
tools/build.sh ui
tools/build.sh gsa

Deploy the application
tools/build.sh deploy

See it in action

Each of the web application instances is available so you can access each one directly to see the 'pet-clinic' application in action, or via the load balancer.
Direct your browser to the petclinic virtual load balancer ip:port, and to the petclinic load generator ip:port. Modify the load slider and notice in the UI how the application scales in and out by starting and terminating virtual machines.

GigaSpaces.com - Legal Notice - 3rd Party Licenses - Site Map - API Docs - Forum - Downloads - Blog - White Papers - Contact Tech Writing - Gen. by Atlassian Confluence