Facebook Twitter Gplus LinkedIn YouTube E-mail RSS
Home Application Architecture Realistic Elastic

Realistic Elastic

When running system in production, the last thing you want to do is to shutdown the system. This could happen when:
– You need to replace one of the machines running the system.
– You need to upgrade one of the machines running the system.
– You need to increase the memory capacity of the system to support more data to be stored in memory.
– You need to increase the CPU power the system needs to consume to process data fast enough.

The Elastic Processing Unit (EPU) is the latest addition to the XAP platform. It has been designed to answer all the above scenarios. It basically makes your entire application; web , data, business layers elastic.

Each of these application layers can stretch or shrink themselves while the system is running without any downtime. This makes the system life cycle management simpler, avoiding many of the manual labor IT teams used to perform. There is no need to start JVMs manually, no need to find a spare machine on the network you can use and there is no need to terminate running processes once you want to free resources. GigaSpaces runtime environment will be performing all these automatically based on pre-defined SLA.

Main Highlights

Here are the main highlights the EPU brings:
1. SLA based deployed (memory/cores).
2. Support Data-Grid and Custom PU.
3. Automatic container lifecycle management.
4. Automatic rebalancing (repartitioning).
5. Automatic partition count calculation.
6. Scale up/down or in/out without system downtime.
7. Eager and manual scale strategies.
8. Automatic machine provisioning plug-in.

You may find here a quick EPU tutorial.


Total application and resource life cycle management

When using the EPU, GigaSpaces manage the entire life cycle of the applications and resources.
• Once the EPU is deployed containers are started and the EPU instances are provisioned into these containers.
• When the EPU scales up, additional containers are started and instances are relocated into these containers.
• When the EPU is un-deployed, all the containers associated with the EPU are automatically terminated.

How to use the EPU?

The deploy EPU you should execute the following simple steps:
1. Start agents
2. Deploy
3. Scale up/down or in/out
4. Undeploy

Step 1 – Start a GigaSpaces agent on each machine

gs-agent.bat gsa.global.esm 1 gsa.gsc 0 gsa.global.gsm 2 gsa.global.lus 2

No containers (GSC) should be started manually!

Step 2 – Deploy

When deploying you should specify the following basic settings:
– Specify maximum PU capacity
– Specify container memory capacity
– Specify initial PU capacity

Here is how you will be doing that:

Admin admin = new AdminFactory().addGroup("myGroup").create();

GridServiceManager gsm = admin.getGridServiceManagers().waitForAtLeastOne();
// Deploy the Elastic Processing Unit. Set the maximum memory and CPU capacity and initial capacity
File puArchive = new File("/opt/gigaspaces/myPU.jar");
ProcessingUnit pu = gsm.deploy(
new ElasticStatefulProcessingUnitDeployment(puArchive)
//.singleMachineDeployment() // uncomment when working with a single machine agent
// set the initial memory and CPU capacity
.scale(new ManualCapacityScaleConfigurer()


Step 3 – Scale the PU

Once you would like to scale the running EPU, you may increase its memory capacity using the following simple call:


    new ManualCapacityScaleConfigurer()


Step 4 – undeploy

Once you would like to terminate the application and undeploy the EPU you should use the following. This will free all the allocated resources used to run this EPU.

ProcessingUnit pu = admin.getProcessingUnits().waitFor("myPU",10,TimeUnit.SECONDS);

if (pu != null) {


Running Example

You may found a fully running example you may run on your development machine or production machine.

Shay Hassidim

 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
1 Comment  comments 
  • http://www.global-mt.com Gary Lustberg

    Thank you for this valuable article/guide about the Elastic Processing Unit. I truly appreciate the step by step on how to use and deploy the EPU.

© GigaSpaces XAP Blog - The In-Memory Computing Platform