You are on page 1of 6

SETIT 2009

th
5 International Conference: Sciences of Electronic,
Technologies of Information and Telecommunications
March 22-26, 2009 – TUNISIA

Mixed Neural and Feedback Controller for Apache Web


Server
R. FONTAINE*, P. LAURENCOT* and A. AUSSEM**
*LIMOS, Blaise Pascal University, Clermont Ferrand II, 63173 Aubière Cedex, France
fontaine@isima.fr
patrice.laurencot@isima.fr

**PRISMa, Claude Bernard University, Lyon I France


alexandre.aussem@univ-lyon1.fr

Abstract: Overload control mechanism is used to protect a web server from excessive load during traffic peaks and
involves techniques of predictive control with limited local information. Four main types of overload control can be
identified: Load balancing, content adaptation, Scheduling and Admission control. This paper presents a Neural Model
based Feedback control approach to keep the mean response time of a web server close to the service level
specification. Implementing in a real server, we show that both neural network and feedback control leads better
tracking of QoS specification than with feedback control only or neural model based feed forward control only.
Key words: Feedback control, feed forward control, neural network controller, web server

one that is the most widely used like controller for the
Admission Control Mechanism.
INTRODUCTION
Since recent years, the Internet end users have In previous related works, different methods were
experienced phenomenal growth. According to proposed to improve the quality of service in the web
Webstat1, the Internet end users were more than one server. In [CTJ 01], a scheduling algorithm for an
billion in March 2007. Some users complain about a Apache web server was introduced using system
long response time observed during peak times. This identification methods and linear control theory.
long response time does not necessarily depend on too Queue length control with priorities was developed in
little bandwidth or too slow clients. Instead, the [NbR 99]. On-off load control mechanism regulating
bottleneck is often the web server system itself. As a the admission of client sessions was developed in [LcP
lot of requests are submitted, the web server has to 00]. In [TvP 02], a control mechanism that combines a
deal with more requests than it is designed to, and so it load control for the CPU with a queue length control
may become overloaded. Overload control mechanism for the network interface was proposed. In [PbS 85], a
can be used to resolve this problem. There are four PID-controller was used in an admission control
main types of overload control: admission control, mechanism for a web server using linear control
content adaptation, load balancing and scheduling. In theory. An Admission Control mechanism for server
this work, we are interested in Admission Control systems using non-linear control theory was designed
mechanism. The Admission Control Mechanism in [MaM 03]. To find optimal controller parameters for
rejects some requests whenever the incoming traffic is a PID-controller, [TfC 00] and [TfK 02] have modeled
too high and in this way, it maintains an acceptable the web server to deal mostly with static files (i.e., if
response time. The structure of a Admission Control dynamic content is statistically insignificant or served
mechanism contains in general three modules: the from a separate server). In [YNJ 02], the parameters
Gate, the Controller and the Monitor. The Controller (i.e. KeepAlive time and MaxClients) of an Apache
can be designed in a variety of ways as described in web sever are dynamically allocated using feedback
[KjB 97]: static controller, step controller, on-off controller. The goal is to keep the system’s CPU and
controller or PID-controller. Generally, it is the last memory utilization stabilized at the desired reference
value. In recent paper [RPA 07], we developed a neural
based admission control of Apache. A static controller
is used for fixing acceptance arrival rate to guarantee a
1
http://www.webstat.net server mean response time using neural network.

-1-
SETIT2009

While neural network model and feedback control worker pool, thereby imposing a limitation on the
have been used in isolation in many contexts to processing capacity of the server. A higher MaxClients
provide performance guarantees, in this paper we value allows Apache to process more client requests
propose a new approach which combines both neural but if it is too large, there is excessive resource
model and feedback control to achieve a service level utilization that increases considerably the server mean
based response time specification for a web server. We response time.
will show by experimentations that the combined
Periodically, the neural model estimates the arrival
framework, neural and feedback model leads to better
rate λ online and computes MaxClients so that the
tracking of QoS specification than with feedback
mean response time is maintained near the desired
control only or neural model based feed forward
value. The feedback controller compares then the
control only.
measured mean response time obtained previously
This paper is structured as follows: section 1
with the reference mean response time (shown as Ref
describes the architecture of the neural based feedback
Response time in Figure 1.). The difference, (shown as
control; section 2 covers a neural network controller
∆ Response time in the Figure 1.), is the error to be
for Apache web server. In section 3, we present the
corrected by the controller via MaxClients adjustment
feedback controller. Section 4 shows how to
∆ DeltaMaxClients as shown in Figure 1.
implement and validate our approach. The conclusion
is given in section 5.
2. The Neural module
1. Neural based feedback control This section describes how we have proceeded to
Architecture obtain the neural model controller and how it works.
Admission control mechanisms have been for a 2.1. The data sets
long time already studied for telecommunication
systems. This mechanism is intended to prevent the The data sets used for training and validation
system from becoming overloaded by rejecting some purposes were obtained by experimentation using
visitors. This permits to avoid the overload of the HTTPERF web benchmark tool.
system which can lead to its failure. The fact is that it We used a group of 4 NIC (and so 4 trunk Ethernet
is better to have a deteriorated service than no service channels) to avoid the network being bottlenecked.
at all. The document request from the client is sent to the
Apache server. We used one server computer which
Apache
has the following characteristics: Pentium III 800
Request MHz processor, 512 Mbytes of main memory,
Server
FreeBSD2 5.1 with TCP/IP and Ethernet network
λ connection. The server software is the Apache 1.3
from Apache Software Foundation. According to
MaxClients Netcraft3 survey, Apache is the most widely used web
Neural N
+ MaxClients
server and gives more stability and performance when
coupled with FreeBSD operating system. The four
MaxClients computers representing the clients have the same
Response time characteristics: Pentium IV 2.4 GHz processor, 128
Feedback
Mbytes of main memory, Linux4 Mandrake 9.2 with
Ref Response time control
TCP/IP and Ethernet network connection. The client
software is a HTTP load generator, the HTTPERF.
Measured Mean response time
The influence of the variation of the arrival traffic
Figure 1. Neural Based feedback control architecture λ, the two optimization parameters of FreeBSD
Figure 1 shows the Neural based feedback control Operating System (kern.maxusers and
architecture. The neural model is used for computing kern.ipc.somaxconn) and the parameter of Apache
the value of the apache parameter MaxClients to (MaxClients) on the server mean response time was
achieve a specified mean response time given the investigated. Their modification has an impact on the
currently observed average request arrival rate. The server mean response time. We varied then
feedback controller loop module compares the actual successively kern.maxusers, kern.ipc.somaxconn and
server mean response time achieved to the desired MaxClients. For each combination of these
average and adjusts MaxClients to ensure that the parameters, the benchmark tool was launched during
desired mean response time is maintained. The Neural five minutes by varying the arrival traffic λ and it
model and feedback components operate concurrently helped us observe the server mean response time.
in a complementary manner as shown in Figure 1. Thanks to this experimentation, we have collected
Apache is structured as a pool of worker processes
monitored by a master. Each worker process is
responsible for handling communication with the web 2
http://www.freebsd.org
clients and can handle at most one connection at a 3
http://www.netcraft.com
time. The MaxClients parameter limits the size of the 4
http://www.linux.org

-2-
SETIT2009

5616 examples which were used as data sets during used.


the training process.
Noise
Input
2.2. Training set-up Disturbance
To speed up the training process, the data sets must Input
be normalized in the (0,1) interval.
An MLP feed-forward neural network with a
single hidden layer was trained with resilient back- Reference Control
Propagation algorithm, proposed in [RiH 92] and [RiH Input Feedforward Input Target
93], using the Stuttgart Neural Network Simulator Controller System
(SNNS5). The neural network has 4 input neurons, a
single hidden layer and a single output neuron. The
number of neurons in the hidden layer was Figure 2. Feedforward controller architecture
investigated by testing from 2 to 32 neurons. The In this work, we used the neural network obtained
performances of the neural network were measured from section 2.1.3 as a feedforward controller. As the
using the cross validation method and the Normalized workloads are time varying, MaxClients may need to
Mean Squared Error (NMSE). We used 80% of the be adjusted to maintain the desired server mean
data sets for the training sets and 20% for the response time. For each control interval, the neural
validation sets. The optimal learning parameters of based controller estimates the arrival rate λ online.
RPROP algorithm were obtained using “batchman” Next, the neural module finds out the value of
script integrated in SNNS package. Table 1 MaxClients which correspond to the desired mean
summarizes the performances of the different response time. MaxClients must then be adjusted to its
architectures. new value for the next interval.
Architecture NMSE
4/2/1 4,4374.10-2 3. The feedback controller module
4/4/1 8,7165.10-3 This section describes the methodology used for
4/8/1 8,1414.10-4 designing feedback controller and applies it to the web
4/16/1 6,8486.10-4 server.
4/32/1 7,313.10-4
Table 1. The performances of the different 3.1. Design Methodology
architectures
The controller uses a proportional integral (PI)
To avoid learning by heart, we chose the simple controller. Because of its robustness, PI control is
architecture possible for the neural network. widely used in mechanical engineering and process
control. PI control process operates according to the
The final architecture is then composed of 4 input
following control law:
neurons, 16 hidden neurons and 1 output neuron. k −1
u ( k ) = K p e( k ) + K I ∑ e ( j ) (1)
2.3. Neural Network Recuperating. j =1
In order to implement the neural model in the real
system, the Neural Network obtained from the training Where u(k) is a tuning parameter and e(k)=r(k)-
process must be converted to a C function. We used y(k) is the control error. For Apache system, r(k) is the
the snns2c tool from SNNS package to convert Neural desired mean response time (REP*), and y(k) is the
Network to C. measured metric (REP).
PI control has two parameters: Kp, the proportional
2.4. The Neural Based feedforward controller gain , and KI, the integral gain. The proportional term
is used to increase the speed of response and the
Although closed-loop control has considerable integral term is used to eliminate any steady-state
appeal, its use requires, among other things, online error.
measurement and careful design to ensure desirable To design a PI controller, Kp and KI must be set to
system properties, especially stability, accuracy, short achieve the desired control specification. In order to
settling times, and small overshoot. An alternative is calculate these two parameters, Apache server must be
open-loop control, a technique that avoids using the first modeled.
measured output to adjust the control input. Open-loop
control is sometimes referred to as feedforward 3.2. Modelling apache
control. Figure 2 depicts such a system. The
feedforward controller uses the reference input (and This section describes the approach to modelling
sometimes the disturbance input) to determine the Apache, which is based on statistical (black box)
setting of the control input needed to achieve the models to quantify the relationship between the tuning
desired measured output; the measured output is not parameter MaxClients and the metric mean response
time (REP).
An empirical approach is used to quantify the
5
http://www-ra.informatik.uni-tuebingen.de/SNNS/ relationship between the control input, MaxClients

-3-
SETIT2009

and the system outputs, the mean response time. The the settling time) of the closed loop system.
control input was varied in a manner so that two
2. Determine the required closed loop pole
properties are satisfied. First, the input signal should
locations from the performance specifications. For
be persistently exciting; it should contain enough
a desired settling time of ts with a sampling time
frequency content to excite all of the dynamics of the
of T, the closed-loop poles must all have a
system. Discrete sine wave is used for the input
magnitude less than e-4/ts [JDY 04]. For zero
control, MaxClients. This is done so that there are
steady-state error, KI must be nonzero.
both high frequency components and low frequency
components. Figure 3. plots the data, the response 3. Derive the closed loop system model from the
time from the server run using the discrete sine wave open loop system model and the control law.
as the control inputs.
4. Calculate the control gains by matching the
closed loop system model with the desired closed
loop poles. Since the desired closed loop are
available from Step 2 and the poles of the closed
loop system model can be found as functions of
KP and KI in Step 3, the control gains can be
found by equating these and solving for KP and
KI.
From experimentations, the settling time of REP is
set to 60 seconds. Following the previous four steps,
we can find reference values of KP and KI. Next we
used MATLAB to optimize these values using the step
response. We found KP =800 and KI=250. Figure 4
plots the step response of the model. It corresponds
Figure 3. Experimental data with discrete sine wave well to the desired settling time specification. Below is
The next step is now to find the relationship the MATLAB code used to obtain the step response.
between MaxClients and REP from the data collected kp=800;
previously. ki=250;
There are a number of methods available in the Gc=tf([ki 0],[1 -1],-1)+kp;
construction of a model that captures the relationship Gp=tf(0.0002,[1 -0.5992],-1);
between MaxClients and REP. We chose to fit a linear Gcl=feedback(Gc*Gp,1)
time invariant (ARX) model to the data. The form of t=0:1:150;
the linear model found is shown in equation (2) : step(Gcl,t);
In the code, Ge, Gp, and Gcl are respectively the
REP(k+1)=0.532REP(k)+0.0002MaxClients(k) (2) transfer function of the PI controller, the process and
the feedback closed loop function.

REP(k) denotes the average value of the mean


response time over the time interval k.
The linear model was validated using R² which is
the indicator of variability explained by the model.

var( y − ɵy )
R2 = 1 − (3)
var( y )
Where var(y) is the variance of the REP(k). R²
ranges from 0 to 1. A value of 0 means that the model
does no better than using the mean value of REP to
estimate REP(k). A value of 1 suggests a perfect fit. In
this work we found R²=0.96 for REP. Figure 4. Step response of PI controller
3.3. Parameters estimation using Pole Placement
4. Implementation and validation
To design a PI controller, KP and KI must be set to
achieve the desired control specification, such as zero In this section we report the experiments we
steady-state error and small settling times. A carried out to implement and validate the Neural based
commonly used approach to controller design is pole feedback controller
placement, in which the closed-loop system poles are
chosen to meet some desired criteria. The steps in pole 4.1. Experimental setup
placement control design are outlined below. We implemented the neural model and integrated it
1. Specify the desired transient performance (e.g., with our controller instrumented Apache web server.

-4-
SETIT2009

The C function codes of Neural Network Controller not only determines the length of time between
are implemented and compiled on the server machine successive updates of the MaxClients parameter, but
also the lengths of time system outputs REP are
The server has the following characteristics:
averaged over.
Pentium III 800 MHz processor, 512 Mbytes of main
memory, FreeBSD 5.1 with TCP/IP and Ethernet
network connection. The server software is the
Apache 1.3 from Apache Software Foundation. It is
the most widely used web server and gives more
stability and performance system, see Netcraft survey.
The computers representing the clients have the
same characteristics, in particular: Pentium IV 2.4GHz
processor, 256 Mbytes of main memory, Linux
Mandrake 9.2 with TCP/IP and Ethernet network
connection. The client computers were installed with a
HTTP load generator, the HTTPERF. During
experimentations, we modified the HTTPERF source
code so that the traffic load changes dramatically as Figure 6. Server mean response time with and without
shown in Figure 5. feedforwad neural control

Figure 5. Traffic load generated by HTTPERF Figure 7. Server mean response time with PI control
Two modules were added to Apache. The first
module is in charge of estimates online the average
arrival request rate. The second runs a high-priority
loop that listens to the web server’s TCP socket and
accepts incoming connection request. It also time-
stamps and records the server mean response time.
The response time is the difference between accepting
connection and its reply.
In the default version of Apache, MaxClients
parameter cannot be changed dynamically. As a result,
we modified its source to enable real-time control.

4.2. Experimental Results Figure 8. Server mean response time with both neural
In order to evaluate the performance of the neural and PI control
based feedback control approach, we compared its In Figure 6, we show the server mean response
performance with that of feedback controller only and time with and without neural control. Without control
neural network only respectively. The goal of the mechanism, we observe as expected that the response
system is to provide the mean response time time follows the rhythm of the input load. The mean
guarantee. We carried out three experiments. The first response time increases with the traffic load. With
experiment shows the effect of implementing the neural control, the response time is relatively stable
neural controller only into Apache. The second due to the action of the control mechanism.
presents the effect of integrating feedback controller.
In Figures 7 and 8, we explore respectively the
The last experiment combines both neural and
effect of adding feedback control and both neural and
feedback controller and shows the effect of the mixed
feedback controls to the server mean response time.
controller. In all experiments, the desired mean
response time is set to 400ms and the input load In order to compare the performance of the three
pattern is shown in Figure 5. By experimentation, the controllers, neural control only, feedback control only
sample time was fixed to 5 seconds. The sample time and both neural and feedback control, we used the

-5-
SETIT2009

aggregate of the squared errors between the desired [CTJ 01] C. Lu, T.F. Abdelzaher, J.A. Stankovic and
and the actual mean response time over the duration of S.H. So, “A feedback control approach for guaranteeing
the experiment. The smaller is the aggregate error, the relative delays in web servers”, Proc. of the 7th IEEE Real-
better is the convergence. Time Technology and Applications Symposium, 2001, pp
51-62.
Table 2 summarizes the results. [NbR 99] N. Bhatti, R. Friedrich, “Web server support
Controller Neural PI PI and Neural for tiered services”, in; IEEE Network, Sept/Oct 1999, pp.
64-71.
Aggregate square error 23 6,45 3,17
Table 2. Aggregate square error [LcP 00] L. Cherkasova, P. Phaal, “Predictive admission
control strategy for overloaded commercial web servers”,
Using neural model feed forward control alone, a in; Proc. 8th International IEEE Symposium on modelling,
large steady state error develops and fluctuation is also analysis and simulation of computer and telecommunication
quite large (Figure 6.). PI controller decreases both systems, 2000, pp. 500-507.
steady state and fluctuation (Figure 7.) but it is much
[RPA 07] R. Fontaine, P. Laurencot and A. Aussem
better in presence of neural control (Figure 8.). This is “Performance learning, real time monitoring and admission
because the neural controller is able to supply an control of a web server using neural technique”, Proc. 4th
approximate output that achieves a mean response International IEEE of Science of Electronics, Technologies
time value close to the set point. The PI controller of Information and Telecommunication, 2007, act on CD-
therefore has to handle the residual error only. ROM ISBN 978-9973-61-475-9. (In French)
Our experimental evaluation presents the [PbS 85] P. Bhoj, S. Ramanathan and S. Singhal,
advantages of integrating a neural model with “Web2K: Bringing QoS to web servers”, IEEE Transactions
feedback controller to achieve Quality of Service on Automatic Control, Vol. 30, No. 8, Aug 1985, pp 705-
713.
guarantees in a web server, in particular with Apache.
[MaM 03] M. Andersson, M. Kihl and A. Robertsson,
“Modelling and Design of Admission Control Mechanisms
5. Conclusion for Web Servers using Non-linear Control Theory”, Proc of
We proposed an Apache overload control based on Information Technologies and Communications (ITCom
both neural and feedback control mechanism. The 2003), Orlando, Florida, USA, September 2003
neural model was an MLP feed-forward neural [TfC 00] T.F. Abdelzaher and C. Lu, “Modelling and
network trained using Resilient back propagation performance control of Internet servers”, Proc. of the 39th
algorithm. The performance of the neural network was IEEE Conference on Decision and Control, 2000, pp 2234-
tested using cross validation method and NMSE. 2239.

For each control interval time, neural controller [TfK 02] T.F. Abdelzaher, K.G. Shin and N. Bhatti,
predicts the server mean response time as a function of “Performance guarantees for web server end-systems: a
control theoretic approach”, IEEE Transactions on Parallel
arrival traffic, some FreeBSD operating system and
and Distributed Systems, Vol. 13, No. 1, Jan 2002, pp 80-96.
the actual MaxClients value. For the next interval
MaxClients was adjusted to keep the server mean [RiH 92] M. Riedmiller and H. Braum, “RPROP A fast
response time close to the desired mean response time. Adaptive Learning Algorithm”, in; Proc. of the 1992
International Symposium on Computer and Information
The feedback controller was a PI controller. It was Sciences, Antalya, Turquie, 1992, pp. 279-285.
a SISO (Single In Single Out) model. The input
[RiH 93] M. Riedmiller and H. Braum, “A Direct
control was MaxClients and the output control was the Adaptive Method for Faster Backpropagation Learning: The
Apache mean response time. For each interval control, RPROP Algorithm”, in; Proc. of the IEEE International
MaxClients was adjusted as function of the measured Conference on Neural Networks, 1993, pp. 586-591.
server mean response time, parameters gain KI and KP
using the PI controller law. The new value of [JDY 04] J. L. Hellerstein, D. M. Tilbury and Yixin
Diao,Sujay Parekh,” Feedback Control of Computing
MaxClients was applied to the next interval. Systems”, IEEE Computer Society Press, 2004
The neural based feedback controller was [YNJ 02] Y. Diao, N. Gandhi, J. L. Hellerstein, S.
validated and implemented on a machine with Apache. Parekh, and D. Tilbury. “Using MIMO feedback control to
Measurements were made to examine the server mean enforce policies for interrelated metrics with applications
response time. The experiments illustrate that neural and Management”, April 2002.
control only and feedback control only mechanism
work as expected but the two components have
complementary strengths, jointly offering more robust
tracking of performance set points in the presence of
widely unpredictable load.

REFERENCES
[KjB 97 ] K.J. Åström and B. Wittenmark, Computer-
controlled systems, theory and design, Prentice Hall
International Editions, 3rd Edition, 1997.

-6-

You might also like