**Abstract**

Load-Balancing is an important problem in distributed heterogeneous systems. In this paper, an Agent-based load-balancing model is developed for implementation in a grid environment. Load balancing is realized via migration of worker agents from overloaded resources to underloaded ones. The proposed model purposes to take benefit of the multi-agent system characteristics to create an autonomous system. The Agent-based load balancing model is implemented using JADE (Java Agent Development Framework) and Alea 2 as a grid simulator. The use of MAS is discussed, concerning the solutions adopted for gathering information policy, location policy, selection policy, worker agents migration, and load balancing.

**Keywords:** load balancing, grid computing, agent migration, resource utilization, mobile agents

#### **1. Introduction**

Grid computing has appeared as an encouraging smart computing paradigm. Grid computing purposes to collect the power of geographically distributed heterogeneous, multiple-domain computational resources to offer high performance. To realize the encouraging potentials of grid computing, effective job scheduling, and load balancing algorithms are important. Such algorithms should be very scalable since these systems typically have thousands to millions of resources. They should also be flexible and be adaptive to task requirements.

The load balancing prevents the state in which some resources become overloaded while the others are underloaded or idle. Therefore, the use of a load balancing mechanism is expected to enhance reliability. The problem that can increase in this mechanism is related to the characteristics of the grid, which are resource variations, resource heterogeneity, application variety, and the dynamicity of grid environments. Multi-agent systems give encouraging features for resource managers. The scalability, reactivity, cooperation, proactivity, flexibility, autonomy, and robustness that characterize multi-agents system can help in the complex task of resource management in dynamic and changing environments.

Multi-agent distributed systems give an exciting solution to grid load balancing. An agent-based structure is developed to offer services for high performanceprogramming environments and applications that can be used on the grid computing environment. Software agents improve expandability, permitting the number of resources involved to rise easily, by providing services that include job scheduling, monitoring, and supervisory for the system.

**54**

85-111.

*Artificial Intelligence - Latest Advances, New Paradigms and Novel Applications*

Intelligence. In People Matters.

https://www.britannica.com/

November, 2018.

Retrieved from on 21st November, 2018.

technology/artificial-intelligence on 21st

[1] S. J. Russell and P. Norvig, Artificial Intelligence: A Modern Approach, 3rd ed., Upper Saddle River, NJ: Prentice

[2] WirePiazza, L.N. (2018). How Can

[3] Nicastro, D. (2018). 7 Ways Artificial Intelligence is Reinventing Human

[4] Joshbersin. (2018). AI in HR: A Real

[6] Hagginbottom, K. (June, 2018). The Impact of AI on the HR Profession. In Forbes online magazine. Retrieved from https://www.forbes.com/sites/ karenhigginbottom/2018/06/14/ the-impact-of-ai-on-the-hrprofession/#7364c0e391ca on 21st

[7] Biswas, S. (March, 2018). Employee Experience, Jobs and Skills: How AI will

[8] John J. Lawler & Elliot, R. (1996). Artificial intelligence in HRM: An experimental study of an expert system,

Journal of Management, 22(1),

and Technology, 2(6), 34-36.

will be affected by Artificial

[9] Jain, S. (2016). Big data analysis: Changing the way. International Journal of Research in Advanced Engineering

[10] Hooda, S. (April, 2018). 5 ways HR

impact HR. In HR Technologist. Retrieved from https://www. hrtechnologist.com/articles/digitaltransformation/employee-experiencejobs-and-skills-how-ai-will-impact-hr/

on 20th November, 2018.

Killer App. HR TECHNOLOGY

Resources. Entrepreneur

November, 2018.

[5] Pay, V. B. (2018). How Artificial Intelligence Is Reinventing Human

Artificial Intelligence Work

Hall (2010).

for HR?SHRM

Resources. CMS

Asynchronous communication, parallel actions, and autonomous operations of agents allow MAS to adjust to dynamic modifications of the grid environment, thereby enhancing the stability, fault tolerance, responsiveness, and reliability of the grid. Identifying key reasons to prove the convergence of MAS and grid is not an easy task. In this chapter, a new Agent-Based load balancing Model is presented. A hierarchical architecture with coordination is designed to ensure scalability and efficiency. Also, a multi-agent approach is applied to improve adaptability. Multi-agent system is implemented with the JADE (Java Agent Development) framework for grid load balancing. The chapter also discusses the difficulties and advantages surrounding the task of integrating multi-agent systems into grid computing.

The structure of the chapter is organized as follows: Section 2 describes Agent based load balancing architecture and implementation, Section 3 shows implemented algorithms. Finally, Sections 4 concludes the chapter with comments and discussion about current and future works.

#### **2. Proposed agent based load balancing model**

The proposed model is an extension of our previous works related to load balancing system [1, 2], which is integrated into our agent-based load balancing in a grid computing project.

In this section, we will introduce an Agent-based load balancing Model (ABLBM). We will mention the components of the system and the interaction between agents briefly. We will describe the new features we added to Agent- based load balancing Model in grid, UML Classes Diagram, UML Sequence Diagram, algorithms, and load balancing mechanism in detail.

#### **2.1 The ABLBM framework**

The UML Classes Diagram of the proposed model comprises fourteen connected classes as follows (**Figures 1** and **2**):

1.The Model class is linked by an aggregation relationship to the Level 2, Level 1, and Level 0 classes

> The proposed framework is intended to take advantage of the agent's characteristics to create a self-adaptive and self-sustaining load balancing system. The proposed system consists of six types of agents, in unbalanced situations, and if the Cluster Agent finds that there is a load imbalance between the resources under its control, it uses the Knowledge Algorithm to receive the load information from each Resource Agent. Based on this information and the estimated equilibrium threshold, it analyses the current load of the cluster. Depending on the outcome of this analysis, it decides whether to start a local balancing in case of an unbalanced state, or simply inform other Cluster Agent of its current load. Resource Agent sends the updated local load value to Cluster Agent, which updates its load information. Migration Agent is responsible for migrating Worker Agents to the selected underloaded resource. There is a Migration Agent in each Cluster, who expects acknowledgement of receipt from the receiving resource once it receives the migrated Worker Agent. The last agent is Grid Agent, it is the role of the distribution of jobs between clusters, and all Cluster

Agents are started by this type of agents.

*UML classes diagram of ABLBM framework.*

*Agent Based Load Balancing in Grid Computing DOI: http://dx.doi.org/10.5772/intechopen.94219*

**Figure 1.**

**57**


*Agent Based Load Balancing in Grid Computing DOI: http://dx.doi.org/10.5772/intechopen.94219*

Asynchronous communication, parallel actions, and autonomous operations of agents allow MAS to adjust to dynamic modifications of the grid environment, thereby enhancing the stability, fault tolerance, responsiveness, and reliability of the grid. Identifying key reasons to prove the convergence of MAS and grid is not an easy task. In this chapter, a new Agent-Based load balancing Model is presented. A hierarchical architecture with coordination is designed to ensure scalability and efficiency. Also, a multi-agent approach is applied to improve adaptability. Multi-agent system is implemented with the JADE (Java Agent Development) framework for grid load balancing. The chapter also discusses the difficulties and advantages surrounding the task of integrating multi-agent systems

The structure of the chapter is organized as follows: Section 2 describes Agent

implemented algorithms. Finally, Sections 4 concludes the chapter with comments

The proposed model is an extension of our previous works related to load balancing system [1, 2], which is integrated into our agent-based load balancing in a

In this section, we will introduce an Agent-based load balancing Model (ABLBM). We will mention the components of the system and the interaction between agents briefly. We will describe the new features we added to Agent- based load balancing Model in grid, UML Classes Diagram, UML Sequence Diagram,

The UML Classes Diagram of the proposed model comprises fourteen connected

1.The Model class is linked by an aggregation relationship to the Level 2, Level 1,

4.The Level 2 class contains one or more clusters and the cluster class contains

5.A Resource can be associated with one or more users, and each user can submit

6.The Resource class is linked by an aggregation relation to the cluster class

8.Cluster Agent can create one Migration Agent, one or more Resource Agents,

based load balancing architecture and implementation, Section 3 shows

*Artificial Intelligence - Latest Advances, New Paradigms and Novel Applications*

and discussion about current and future works.

**2. Proposed agent based load balancing model**

algorithms, and load balancing mechanism in detail.

2.The Level 0 class contains one and only one Grid Agent

3.The Level 1 class contains one or more cluster Agents

7.Grid Agent class can create one or more Cluster Agents

into grid computing.

grid computing project.

**2.1 The ABLBM framework**

and Level 0 classes

one or more resources

LBC Agents, and Worker Agents.

one or more tasks.

**56**

classes as follows (**Figures 1** and **2**):

**Figure 1.** *UML classes diagram of ABLBM framework.*

The proposed framework is intended to take advantage of the agent's characteristics to create a self-adaptive and self-sustaining load balancing system. The proposed system consists of six types of agents, in unbalanced situations, and if the Cluster Agent finds that there is a load imbalance between the resources under its control, it uses the Knowledge Algorithm to receive the load information from each Resource Agent. Based on this information and the estimated equilibrium threshold, it analyses the current load of the cluster. Depending on the outcome of this analysis, it decides whether to start a local balancing in case of an unbalanced state, or simply inform other Cluster Agent of its current load. Resource Agent sends the updated local load value to Cluster Agent, which updates its load information. Migration Agent is responsible for migrating Worker Agents to the selected underloaded resource. There is a Migration Agent in each Cluster, who expects acknowledgement of receipt from the receiving resource once it receives the migrated Worker Agent. The last agent is Grid Agent, it is the role of the distribution of jobs between clusters, and all Cluster Agents are started by this type of agents.

### *Artificial Intelligence - Latest Advances, New Paradigms and Novel Applications*

Cluster receives load information from each Resource Agent. Based on this information and the estimated balance threshold, it analyzes the current load of the cluster. According to the consequence of this analysis, it chooses whether to start a local balancing in the situation of imbalance state, or eventually just to notify other Agent Clusters about its current load. To implement this local load balancing, we propose the following three policies: load information gathering, agent selection

In the proposed algorithm, Agent Cluster decides to start a local balancing in the case of imbalance. There are some particular events that change the load configura-

3.Local Agent Worker Termination: a local Agent Worker's life cycle is ended

5. Incoming Migrating Agent: the local resource has been selected as a receiver

6.A Mobile Agent Departure: the local resource has been selected as a sender for

1.it estimates the current load of the cluster based on load information received

The local host load is dependent on the Agent workers running on that host. A load of an agent executing on a machine is defined as the sum of its computational

A load of an agent executing on a machine is defined as the sum of its computational load and communication load Loadij = Wij + Uij Where: Wij is Computational

ð Þ Wk þ Uk (1)

A local host load can be defined as follows: The load Lk of a machine Mk is

defined as the sum of its entire agents load on the host. More specifically

Lk <sup>¼</sup> <sup>X</sup> M ai ð Þ¼k

4.Local Agent Worker Start: a new local Agent Worker will be started

7.Agent Worker ends the computation assigned to it, and becomes idle;

Whenever any of these activities happen the local load value is changed, Resource Agent sends the updated local load value to Agent Cluster who updates its Table of resources. Each Cluster Agent estimates its associated cluster capability by

tion in a grid environment. The events can be categorized as follows:

policy, location policy, and Worker Agent migration.

*2.2.1.1 Load information gathering*

*Agent Based Load Balancing in Grid Computing DOI: http://dx.doi.org/10.5772/intechopen.94219*

1.Arrival of any new resource

for the migrating agent.

the migrating agent.

performing the following actions:

from its Resource Agents;

Load and Uij is communication load.

**59**

load and communication load in time unit [3].

2.it sends its load information to other Cluster Agents

2.Withdrawal of any existing resource.

**Figure 2.** *UML sequence diagram describes agent interactions in intra cluster load balancing process framework.*

### **2.2 Algorithms**

We define two levels of load balancing algorithms: Intra-cluster load balancing and intra-Grid load balancing algorithm.

#### *2.2.1 Intra cluster load balancing algorithm*

This load balancing algorithm makes the imbalance situations can be resolved within a cluster. It is triggered when any Agent Cluster finds that there is a load imbalance between the resources which are under its control. To do this, the Agent *Agent Based Load Balancing in Grid Computing DOI: http://dx.doi.org/10.5772/intechopen.94219*

Cluster receives load information from each Resource Agent. Based on this information and the estimated balance threshold, it analyzes the current load of the cluster. According to the consequence of this analysis, it chooses whether to start a local balancing in the situation of imbalance state, or eventually just to notify other Agent Clusters about its current load. To implement this local load balancing, we propose the following three policies: load information gathering, agent selection policy, location policy, and Worker Agent migration.

## *2.2.1.1 Load information gathering*

In the proposed algorithm, Agent Cluster decides to start a local balancing in the case of imbalance. There are some particular events that change the load configuration in a grid environment. The events can be categorized as follows:


Whenever any of these activities happen the local load value is changed, Resource Agent sends the updated local load value to Agent Cluster who updates its Table of resources. Each Cluster Agent estimates its associated cluster capability by performing the following actions:


The local host load is dependent on the Agent workers running on that host. A load of an agent executing on a machine is defined as the sum of its computational load and communication load in time unit [3].

A local host load can be defined as follows: The load Lk of a machine Mk is defined as the sum of its entire agents load on the host. More specifically

$$\mathbf{L}\_{\mathbf{k}} = \sum\_{\mathbf{M}(\text{ai}) = \mathbf{k}} (\mathbf{W}\_{\mathbf{k}} + \mathbf{U}\_{\mathbf{k}}) \tag{1}$$

A load of an agent executing on a machine is defined as the sum of its computational load and communication load Loadij = Wij + Uij Where: Wij is Computational Load and Uij is communication load.

**2.2 Algorithms**

**Figure 2.**

**58**

and intra-Grid load balancing algorithm.

*2.2.1 Intra cluster load balancing algorithm*

We define two levels of load balancing algorithms: Intra-cluster load balancing

*UML sequence diagram describes agent interactions in intra cluster load balancing process framework.*

*Artificial Intelligence - Latest Advances, New Paradigms and Novel Applications*

This load balancing algorithm makes the imbalance situations can be resolved within a cluster. It is triggered when any Agent Cluster finds that there is a load imbalance between the resources which are under its control. To do this, the Agent
