Automatic Adaptation of SOA Systems Supported by Machine Learning
Automatic Adaptation of SOA Systems Supported by Machine Learning
Automatic Adaptation of SOA Systems Supported by Machine Learning
Machine Learning
Kornel Skalkowski, Krzysztof Zieliński
1 Introduction
Adaptation issues are widely present in various aspects of IoT systems. The vast
quantities of objects involved in such systems, huge amounts of information
produced, chaotic working environments and the need for autonomous control make
efficient and flexible adaptation a crucial part of many IoT solutions. Implementation
of the MAPE pattern in IoT architectures requires dedicated monitoring and execution
layers which can cope with such issues. Since the approach presented in this paper
does not impose any specific monitoring and management framework, it can be
applied to IoT infrastructures as well as to other manageable systems.
3 Related Work
framework usually satisfies them all. In order to make actions comparable to “correct
answer” values returned by learning algorithms, the actions should be bijectively
mapped to numbers, e.g. simply enumerated. In order to facilitate implementation,
both sets (X and A) are assumed to be fixed for each given adaptable system.
Given the system state and management interface we can precisely define the
overall framework goal. Roughly speaking, the framework should perform actions
from the space A (e.g. service launch or migration) so that the adaptable system
provides the best possible QoS level for end users. From a mathematical view point,
this problem can be divided into two subproblems. The first subproblem is clustering
the system state space X into a set of non-empty sets {C1, ..., Cl} which should be
characterized by the maximum possible homogeneity of elements within each set (e.g.
lowest sum of distances between the elements of Ci) and the maximum possible
diversity between sets (e.g. greatest sum of distances between the {Ci} sets’
centroids). The Ci sets can evolve during system runtime, reflecting changes in the
system and its working environment. The second subproblem is mapping the
clustered system state space {Ci} onto actions: the framework has to find a mapping
∀i=1, ..., l F: Ci→(aj: j=0, ..., k(Ci)) such that the execution of actions returned by the
mapping F when the system state belongs to the cluster Ci causes ∑i e(x(ti)) to assume
its lowest possible value. The function e(x(t)) is the overall system QoS evaluation
metric calculated using state vectors x(t) whose values are inversely proportional to the
condition of the system. Applying F yields a sequence of actions with length k(Ci),
sorted from the most appropriate to the least appropriate one (for a given system state)
– thus we can say that mapping F reflects the adaptable system model. The first
subproblem may seem unnecessary as one might claim that actions could be assigned
directly to system states x(t). In reality, however, this assumption is only satisfied by
very small systems, where X can be modeled e.g. as a small finite state machine. In
most real systems – especially complex enterprise SOA solutions – this assumption is
no longer valid. In such cases the space X is usually infinite and multidimensional, so
that both elements are essential in order to accomplish the framework objectives.
The first task is a well-known clustering problem, the only major issue being that
the clustered space X is not known a priori, but is instead constructed during runtime
by aggregating x(t) vectors. This issue can be solved using online clustering methods
which are designed to cluster data streams. In turn, the second task leads us to the area
of reinforcement learning algorithms which are used to teach computer systems how
to act in different situations in order to achieve a given goal. The learning mechanism
in such algorithms is based on rewards, usually represented as a single real number. In
our case the situations are represented as state vectors x(ti) at different points in time ti,
whereas the reward constitutes the system evaluation metric e(x). The reinforcement
learning algorithm returns a function, hθ(x), called the hypothesis, which provides
“correct answer” values for different vectors x. In our approach this function is
equivalent to mapping F – the returned sequence of actions comprises set A, which is
calculated on the basis of differences between actions from A and the hθ(x) function
results. The final necessary element is normalization of state vectors x(t). Since most
machine learning algorithms require input vectors to have all elements normalized to
a common range of values, a normalization function has to be applied to all state
vectors prior to clustering. The approach is depicted in Fig. 1.
Automatic Adaptation of SOA Systems Supported by Machine Learning 65
The bottom part of Fig. 1 presents an SOA system subjected to adaptation. Above,
four elements of the MAPE pattern are shown. The monitoring and management
interfaces are assumed to be provided by external frameworks which can be tuned to a
specific adaptable system (provided that they meet the assumptions previously stated).
The monitoring interface returns vectors x(t) composed of real values representing
system states. The management interface exposes A – the set of management actions
available in the system. The analysis layer consists of two services: the normalizer
service, responsible for mapping state vectors to an n-dimensional [0,1] hypercube,
and the clustering service which, based on normalized |x|(t) vectors, extracts clusters
{Ci} representing groups of similar system states. Each cluster represents a pool of
system states which significantly diverge from all other states. By assigning vector
|x|(t) to an appropriate cluster, the framework can check whether the adaptable system
currently belongs to the best possible cluster. This information, along with the current
QoS evaluation metric derivative ∂e(x)/∂t calculated as a differential approximation
from several successive observations of e(x), is used by the processing layer to select
actions. When sgn(∂e(x)/∂t) < 0 no management action is performed because even if
the system state is not in the best possible cluster, it is improving and this trend should
be maintained. If, however, sgn(∂e(x)/∂t) ≥ 0 and the system state does not belong to
the best cluster, execution of a management action is necessary. In order to do so, a
sequence should be returned by the reinforcement learning algorithm. A third case
should be distinguished, with sgn(∂e(x)/∂t) ≥ 0 and the system already assigned to the
best cluster. In this case we may not know why the system condition is deteriorating –
whether due to brief fluctuations (e.g. caused by a slightly higher load) or more
permanent reasons. Thus, a prediction algorithm could be applied to estimate the
likely evolution of the system state. Every executed action is evaluated, and, based on
the evaluation result, the reinforcement learning algorithm’s hypothesis function hθ(x)
is up- or downregulated in order to improve future decisions. Evaluation bases on
observation of system state changes reflected in the QoS evaluation metric derivative
∂e(x)/∂t over a period of time. If the system state remains poor and shows no signs of
improvement (sgn(∂e(x)/∂t) < 0), another action from the list returned by the
66 K. Skałkowski and K. Zieliński
algorithm is executed and evaluated. This process repeats until the system state begins
to improve.
The key advantage of the proposed approach is its independence of any specific
system model. In contrast to other approaches, e.g. based on policy or rule engines, it
does not require any initial configuration or specifications of the adaptable system’s
model. Moreover, online clustering and reinforcement learning algorithms can
dynamically adapt to changes in the model without reconfigurations or restarts. On
the other hand, lack of initial knowledge about the managed system means that many
incorrect actions can be taken during the startup phase, before the framework learns
how to appropriately manage a given system.
balance load and avoid a decrease in the overall QoS. The simulated services have
been implemented using the OSGi technology and deployed in an OSGi monitoring
and management framework provided by the AS3 Studio [12] toolkit. The monitoring
interface was configured to monitor two parameters of the system: average processing
time (APT) and invocation rate (IR). These two parameters were passed to the
framework prototype as a single vector x(t) = [APT, IR]. The evaluation function was
calculated as e(x) = APT + IR/2. The management interface exposed two actions:
“do-nothing”, whose invocation did not affect the simulated system in any way, and
“balance-load”, which activated load balancing in the first service for a period of
time. As a result of the second action, the first service would begin dispatching its
requests to both the second and the third service. The evaluation was performed on a
computer with an Intel Core 2 Duo 2.80 Ghz CPU and 4 gigabytes of RAM. The
hypothesis function was a simple linear polynomial of two variables hθ(x(t)) = θ0+
θ1x1+ θ2x2, where x1 = APT and x2 = IR. Tab. 1 presents evaluation results from three
test runs.
Table 1. Evaluation results of the prototype framework.
Processing Initial hθ(x) Final hθ(x) Convergence Invalid
time speedup time actions
24% 0.64+0.69x1+0.57x2 0.68+0.71x1+0.59x2 0:20 [h] 2
21% 0.23-0.44x1+0.01x2 1.06+0.07x1-0.21x2 2:00 [h] 7
19% -0.55-0.23x1-0.03x2 1.12+0.13x1-0.53x2 2:30 [h] 21
Evaluation results confirm that the proposed approach to the MAPE pattern
implementation is viable and properly accomplishes the stated goals. Processing time
speedup was in the 19% - 25% range, depending on initial coefficients of the
hypothesis function. The greatest speedup was observed for near-optimal initial
hypothesis coefficients, because in this case the framework almost always executed
the “balance-load” action when necessary. In other cases the framework executed a
greater number of “do-nothing” actions, before it learned that this action was
inappropriate for a high system load state. Convergence time was directly dependent
on initial hypothesis coefficients. Better coefficients improved the algorithm’s
convergence; however in all cases convergence was eventually attained (although
with differing final hypothesis coefficients).
The proof-of-concept evaluation of the approach proposed in the paper shows that
machine learning methods can be applied to implementation of the MAPE pattern.
Our combination of clustering and reinforcement learning algorithms properly
identifies disruptions in system QoS and invokes appropriate management actions.
The main advantage of the proposed approach is its independence of any specific
system – the framework does not require any a priori knowledge about the adaptable
system. Flexibility offered by online clustering and reinforcement learning methods
means that the approach can be applied to SOA system adaptation as well as to IoT
68 K. Skałkowski and K. Zieliński
References
1. Arsanjani, A., Liang-Jie Zhang, Ellis, M., Allam, A., Channabasavaiah, K.: S3: A
Service-Oriented Reference Architecture, IT Professional, vol.9, no.3, pp.10-17, May-
June 2007
2. Atzori, L., Iera, A., Morabito, G.: The Internet of Things: A survey, The International
Journal of Computer and Telecommunications Networking, vol.54, no.15, pp.2787-2805,
October 2010
3. Zieliński, K., Szydło, T., Szymacha, R., Kosiński, J., Kosińska, J., Jarząb, M.: Adaptive
SOA Solution Stack, IEEE Transactions on Services Computing, vol.5, no.2, pp.149-163,
April-June 2012
4. André, F., Daubert, E., Gauvrit, G.: Towards a Generic Context-Aware Framework for
Self-Adaptation of Service-Oriented Architectures, iciw, pp.309-314, 2010 Fifth
International Conference on Internet and Web Applications and Services, 2010
5. Kephart, J. O. and Chess, D. M.: The vision of autonomic computing, Computer, vol.36,
no.1, pp.41-50, 2003
6. Stokic, D., Scholze, S., Barata, J.: Self-learning embedded services for integration of
complex, flexible production systems, IECON 2011 - 37th Annual Conference on IEEE
Industrial Electronics Society , ISSN: 1553-572X, pp.415-420, 7-10 Nov. 2011
7. Al-Masri, E., Mahmoud, Q.H.: Discovering the best web service: A neural network-based
solution, SMC 2009. IEEE International Conference on Systems, Man and Cybernetics,
pp.4250-4255, 11-14 Oct. 2009
8. Ramakanta Mohanty, V. Ravi, M.R. Patra: Web-services classification using intelligent
techniques, Expert Sys-tems with Applications, vol. 37, no. 7, July 2010, pp.5484-5490,
ISSN 0957-4174
9. Challagulla, V.U.B.: A Machine Learning-Based Reliability Assessment Model for
Critical Software Systems, Computer Software and Applications Conference, 2007.
COMPSAC 2007. 31st Annual International, vol.1, pp.79-86, 24-27 July 2007
10. The OSGi Alliance: OSGi Service Platform Core Specification, Release 4.1,
http://www.osgi.org/Specifications, 2007
11. McWilliams, B., Montana, G.: Predictive Subspace Clustering, Machine Learning and
Applications, Fourth In-ternational Conference on Machine Learning and Applications,
pp.247-252, 2011 10th International Conference on Machine Learning and Applications
and Workshops, 2011
12. Żmuda, D., Psiuk, M., Zieliński, K.: Dynamic monitoring framework for the SOA
execution environment, Procedia CS, vol.1, no.1, pp.125-133, 2010.