Você está na página 1de 6

SETIT 2009

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

Mixed Neural and Feedback Controller for Apache Web Server


R. FONTAINE*, P. LAURENCOT* and A. AUSSEM**
*LIMOS, Blaise Pascal University, Clermont Ferrand II, 63173 Aubire 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

INTRODUCTION
Since recent years, the Internet end users have experienced phenomenal growth. According to Webstat1, the Internet end users were more than one billion in March 2007. Some users complain about a long response time observed during peak times. This long response time does not necessarily depend on too little bandwidth or too slow clients. Instead, the bottleneck is often the web server system itself. As a lot of requests are submitted, the web server has to deal with more requests than it is designed to, and so it may become overloaded. Overload control mechanism can be used to resolve this problem. There are four main types of overload control: admission control, content adaptation, load balancing and scheduling. In this work, we are interested in Admission Control mechanism. The Admission Control Mechanism rejects some requests whenever the incoming traffic is too high and in this way, it maintains an acceptable response time. The structure of a Admission Control mechanism contains in general three modules: the Gate, the Controller and the Monitor. The Controller can be designed in a variety of ways as described in [KjB 97]: static controller, step controller, on-off controller or PID-controller. Generally, it is the last

one that is the most widely used like controller for the Admission Control Mechanism. In previous related works, different methods were proposed to improve the quality of service in the web server. In [CTJ 01], a scheduling algorithm for an Apache web server was introduced using system identification methods and linear control theory. Queue length control with priorities was developed in [NbR 99]. On-off load control mechanism regulating the admission of client sessions was developed in [LcP 00]. In [TvP 02], a control mechanism that combines a load control for the CPU with a queue length control for the network interface was proposed. In [PbS 85], a PID-controller was used in an admission control mechanism for a web server using linear control theory. An Admission Control mechanism for server systems using non-linear control theory was designed in [MaM 03]. To find optimal controller parameters for a PID-controller, [TfC 00] and [TfK 02] have modeled the web server to deal mostly with static files (i.e., if dynamic content is statistically insignificant or served from a separate server). In [YNJ 02], the parameters (i.e. KeepAlive time and MaxClients) of an Apache web sever are dynamically allocated using feedback controller. The goal is to keep the systems CPU and 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 server mean response time using neural network.

http://www.webstat.net

-1-

SETIT2009 While neural network model and feedback control have been used in isolation in many contexts to provide performance guarantees, in this paper we propose a new approach which combines both neural model and feedback control to achieve a service level based response time specification for a web server. We will show by experimentations that the combined framework, neural and feedback model leads to better tracking of QoS specification than with feedback control only or neural model based feed forward control only. This paper is structured as follows: section 1 describes the architecture of the neural based feedback control; section 2 covers a neural network controller for Apache web server. In section 3, we present the feedback controller. Section 4 shows how to implement and validate our approach. The conclusion is given in section 5. worker pool, thereby imposing a limitation on the processing capacity of the server. A higher MaxClients value allows Apache to process more client requests but if it is too large, there is excessive resource utilization that increases considerably the server mean response time. Periodically, the neural model estimates the arrival rate online and computes MaxClients so that the mean response time is maintained near the desired value. The feedback controller compares then the measured mean response time obtained previously with the reference mean response time (shown as Ref Response time in Figure 1.). The difference, (shown as Response time in the Figure 1.), is the error to be corrected by the controller via MaxClients adjustment DeltaMaxClients as shown in Figure 1.

2. The Neural module 1. Neural based feedback control Architecture


Admission control mechanisms have been for a long time already studied for telecommunication systems. This mechanism is intended to prevent the system from becoming overloaded by rejecting some visitors. This permits to avoid the overload of the system which can lead to its failure. The fact is that it is better to have a deteriorated service than no service at all.
Apache Server Neural
MaxClients
N

This section describes how we have proceeded to obtain the neural model controller and how it works. 2.1. The data sets The data sets used for training and validation purposes were obtained by experimentation using HTTPERF web benchmark tool. We used a group of 4 NIC (and so 4 trunk Ethernet channels) to avoid the network being bottlenecked. The document request from the client is sent to the Apache server. We used one server computer which has the following characteristics: Pentium III 800 MHz processor, 512 Mbytes of main memory, FreeBSD2 5.1 with TCP/IP and Ethernet network connection. The server software is the Apache 1.3 from Apache Software Foundation. According to Netcraft3 survey, Apache is the most widely used web server and gives more stability and performance when coupled with FreeBSD operating system. The four computers representing the clients have the same characteristics: Pentium IV 2.4 GHz processor, 128 Mbytes of main memory, Linux4 Mandrake 9.2 with TCP/IP and Ethernet network connection. The client software is a HTTP load generator, the HTTPERF. The influence of the variation of the arrival traffic , the two optimization parameters of FreeBSD Operating System (kern.maxusers and kern.ipc.somaxconn) and the parameter of Apache (MaxClients) on the server mean response time was investigated. Their modification has an impact on the server mean response time. We varied then successively kern.maxusers, kern.ipc.somaxconn and MaxClients. For each combination of these parameters, the benchmark tool was launched during five minutes by varying the arrival traffic and it helped us observe the server mean response time. Thanks to this experimentation, we have collected
2 3

Request

MaxClients MaxClients

Response time Ref Response time

Feedback control

Measured Mean response time

Figure 1. Neural Based feedback control architecture Figure 1 shows the Neural based feedback control architecture. The neural model is used for computing the value of the apache parameter MaxClients to achieve a specified mean response time given the currently observed average request arrival rate. The feedback controller loop module compares the actual server mean response time achieved to the desired average and adjusts MaxClients to ensure that the desired mean response time is maintained. The Neural model and feedback components operate concurrently in a complementary manner as shown in Figure 1. Apache is structured as a pool of worker processes monitored by a master. Each worker process is responsible for handling communication with the web clients and can handle at most one connection at a time. The MaxClients parameter limits the size of the
-2-

http://www.freebsd.org http://www.netcraft.com 4 http://www.linux.org

SETIT2009 5616 examples which were used as data sets during the training process. 2.2. Training set-up To speed up the training process, the data sets must be normalized in the (0,1) interval. An MLP feed-forward neural network with a single hidden layer was trained with resilient backPropagation algorithm, proposed in [RiH 92] and [RiH 93], using the Stuttgart Neural Network Simulator (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 investigated by testing from 2 to 32 neurons. The performances of the neural network were measured using the cross validation method and the Normalized Mean Squared Error (NMSE). We used 80% of the data sets for the training sets and 20% for the validation sets. The optimal learning parameters of RPROP algorithm were obtained using batchman script integrated in SNNS package. Table 1 summarizes the performances of the different architectures. Architecture NMSE 4/2/1 4,4374.10-2 4/4/1 8,7165.10-3 4/8/1 8,1414.10-4 4/16/1 6,8486.10-4 4/32/1 7,313.10-4 Table 1. The performances of the architectures used.
Noise Input Disturbance Input

Reference Input

Feedforward Controller

Control Input

Target System

Figure 2. Feedforward controller architecture In this work, we used the neural network obtained from section 2.1.3 as a feedforward controller. As the workloads are time varying, MaxClients may need to be adjusted to maintain the desired server mean response time. For each control interval, the neural based controller estimates the arrival rate online. Next, the neural module finds out the value of MaxClients which correspond to the desired mean response time. MaxClients must then be adjusted to its new value for the next interval.

3. The feedback controller module


This section describes the methodology used for designing feedback controller and applies it to the web server. different 3.1. Design Methodology The controller uses a proportional integral (PI) controller. Because of its robustness, PI control is widely used in mechanical engineering and process control. PI control process operates according to the following control law:

To avoid learning by heart, we chose the simple architecture possible for the neural network. The final architecture is then composed of 4 input neurons, 16 hidden neurons and 1 output neuron. 2.3. Neural Network Recuperating. In order to implement the neural model in the real system, the Neural Network obtained from the training process must be converted to a C function. We used the snns2c tool from SNNS package to convert Neural Network to C. 2.4. The Neural Based feedforward controller Although closed-loop control has considerable appeal, its use requires, among other things, online measurement and careful design to ensure desirable system properties, especially stability, accuracy, short settling times, and small overshoot. An alternative is open-loop control, a technique that avoids using the measured output to adjust the control input. Open-loop control is sometimes referred to as feedforward control. Figure 2 depicts such a system. The feedforward controller uses the reference input (and sometimes the disturbance input) to determine the setting of the control input needed to achieve the desired measured output; the measured output is not

u ( k ) = K p e( k ) + K I e ( j )
j =1

k 1

(1)

Where u(k) is a tuning parameter and e(k)=r(k)y(k) is the control error. For Apache system, r(k) is the desired mean response time (REP*), and y(k) is the measured metric (REP). PI control has two parameters: Kp, the proportional gain , and KI, the integral gain. The proportional term is used to increase the speed of response and the integral term is used to eliminate any steady-state error. To design a PI controller, Kp and KI must be set to achieve the desired control specification. In order to calculate these two parameters, Apache server must be first modeled. 3.2. Modelling apache This section describes the approach to modelling Apache, which is based on statistical (black box) models to quantify the relationship between the tuning parameter MaxClients and the metric mean response time (REP). An empirical approach is used to quantify the relationship between the control input, MaxClients
-3-

http://www-ra.informatik.uni-tuebingen.de/SNNS/

SETIT2009 and the system outputs, the mean response time. The control input was varied in a manner so that two properties are satisfied. First, the input signal should be persistently exciting; it should contain enough frequency content to excite all of the dynamics of the system. Discrete sine wave is used for the input control, MaxClients. This is done so that there are both high frequency components and low frequency components. Figure 3. plots the data, the response time from the server run using the discrete sine wave as the control inputs. the settling time) of the closed loop system. 2. Determine the required closed loop pole locations from the performance specifications. For a desired settling time of ts with a sampling time of T, the closed-loop poles must all have a magnitude less than e-4/ts [JDY 04]. For zero steady-state error, KI must be nonzero. 3. Derive the closed loop system model from the open loop system model and the control law. 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 well to the desired settling time specification. Below is the MATLAB code used to obtain the step response. kp=800; ki=250; Gc=tf([ki 0],[1 -1],-1)+kp; Gp=tf(0.0002,[1 -0.5992],-1); Gcl=feedback(Gc*Gp,1) t=0:1:150; step(Gcl,t); In the code, Ge, Gp, and Gcl are respectively the transfer function of the PI controller, the process and the feedback closed loop function.

Figure 3. Experimental data with discrete sine wave The next step is now to find the relationship between MaxClients and REP from the data collected previously. There are a number of methods available in the construction of a model that captures the relationship between MaxClients and REP. We chose to fit a linear time invariant (ARX) model to the data. The form of the linear model found is shown in equation (2) : REP(k+1)=0.532REP(k)+0.0002MaxClients(k) (2)

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.

R2 = 1

var( y ) y var( y )

(3)

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. 3.3. Parameters estimation using Pole Placement To design a PI controller, KP and KI must be set to achieve the desired control specification, such as zero steady-state error and small settling times. A commonly used approach to controller design is pole placement, in which the closed-loop system poles are chosen to meet some desired criteria. The steps in pole placement control design are outlined below. 1. Specify the desired transient performance (e.g.,
-4-

Figure 4. Step response of PI controller

4. Implementation and validation


In this section we report the experiments we carried out to implement and validate the Neural based feedback controller 4.1. Experimental setup We implemented the neural model and integrated it with our controller instrumented Apache web server.

SETIT2009 The C function codes of Neural Network Controller are implemented and compiled on the server machine The server has the following characteristics: 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 shown in Figure 5. not only determines the length of time between successive updates of the MaxClients parameter, but also the lengths of time system outputs REP are averaged over.

Figure 6. Server mean response time with and without feedforwad neural control

Figure 5. Traffic load generated by HTTPERF 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 servers TCP socket and accepts incoming connection request. It also timestamps 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 In order to evaluate the performance of the neural based feedback control approach, we compared its performance with that of feedback controller only and neural network only respectively. The goal of the system is to provide the mean response time guarantee. We carried out three experiments. The first experiment shows the effect of implementing the neural controller only into Apache. The second presents the effect of integrating feedback controller. The last experiment combines both neural and feedback controller and shows the effect of the mixed controller. In all experiments, the desired mean response time is set to 400ms and the input load pattern is shown in Figure 5. By experimentation, the sample time was fixed to 5 seconds. The sample time
-5-

Figure 7. Server mean response time with PI control

Figure 8. Server mean response time with both neural and PI control In Figure 6, we show the server mean response time with and without neural control. Without control mechanism, we observe as expected that the response time follows the rhythm of the input load. The mean response time increases with the traffic load. With neural control, the response time is relatively stable due to the action of the control mechanism. In Figures 7 and 8, we explore respectively the effect of adding feedback control and both neural and feedback controls to the server mean response time. In order to compare the performance of the three controllers, neural control only, feedback control only and both neural and feedback control, we used the

SETIT2009 aggregate of the squared errors between the desired and the actual mean response time over the duration of the experiment. The smaller is the aggregate error, the better is the convergence. Table 2 summarizes the results.
Controller Aggregate square error
[CTJ 01] C. Lu, T.F. Abdelzaher, J.A. Stankovic and S.H. So, A feedback control approach for guaranteeing relative delays in web servers, Proc. of the 7th IEEE RealTime Technology and Applications Symposium, 2001, pp 51-62. [NbR 99] N. Bhatti, R. Friedrich, Web server support for tiered services, in; IEEE Network, Sept/Oct 1999, pp. 64-71. [LcP 00] L. Cherkasova, P. Phaal, Predictive admission control strategy for overloaded commercial web servers, in; Proc. 8th International IEEE Symposium on modelling, analysis and simulation of computer and telecommunication systems, 2000, pp. 500-507. [RPA 07] R. Fontaine, P. Laurencot and A. Aussem Performance learning, real time monitoring and admission control of a web server using neural technique, Proc. 4th International IEEE of Science of Electronics, Technologies of Information and Telecommunication, 2007, act on CDROM ISBN 978-9973-61-475-9. (In French) [PbS 85] P. Bhoj, S. Ramanathan and S. Singhal, Web2K: Bringing QoS to web servers, IEEE Transactions on Automatic Control, Vol. 30, No. 8, Aug 1985, pp 705713. [MaM 03] M. Andersson, M. Kihl and A. Robertsson, Modelling and Design of Admission Control Mechanisms for Web Servers using Non-linear Control Theory, Proc of Information Technologies and Communications (ITCom 2003), Orlando, Florida, USA, September 2003 [TfC 00] T.F. Abdelzaher and C. Lu, Modelling and performance control of Internet servers, Proc. of the 39th IEEE Conference on Decision and Control, 2000, pp 22342239. [TfK 02] T.F. Abdelzaher, K.G. Shin and N. Bhatti, Performance guarantees for web server end-systems: a control theoretic approach, IEEE Transactions on Parallel and Distributed Systems, Vol. 13, No. 1, Jan 2002, pp 80-96. [RiH 92] M. Riedmiller and H. Braum, RPROP A fast Adaptive Learning Algorithm, in; Proc. of the 1992 International Symposium on Computer and Information Sciences, Antalya, Turquie, 1992, pp. 279-285. [RiH 93] M. Riedmiller and H. Braum, A Direct Adaptive Method for Faster Backpropagation Learning: The RPROP Algorithm, in; Proc. of the IEEE International Conference on Neural Networks, 1993, pp. 586-591. [JDY 04] J. L. Hellerstein, D. M. Tilbury and Yixin Diao,Sujay Parekh, Feedback Control of Computing Systems, IEEE Computer Society Press, 2004 [YNJ 02] Y. Diao, N. Gandhi, J. L. Hellerstein, S. Parekh, and D. Tilbury. Using MIMO feedback control to enforce policies for interrelated metrics with applications and Management, April 2002.

PI and Neural 3,17 Table 2. Aggregate square error


Neural 23 PI 6,45

Using neural model feed forward control alone, a large steady state error develops and fluctuation is also quite large (Figure 6.). PI controller decreases both steady state and fluctuation (Figure 7.) but it is much better in presence of neural control (Figure 8.). This is because the neural controller is able to supply an approximate output that achieves a mean response time value close to the set point. The PI controller therefore has to handle the residual error only. Our experimental evaluation presents the advantages of integrating a neural model with feedback controller to achieve Quality of Service guarantees in a web server, in particular with Apache.

5. Conclusion
We proposed an Apache overload control based on both neural and feedback control mechanism. The neural model was an MLP feed-forward neural network trained using Resilient back propagation algorithm. The performance of the neural network was tested using cross validation method and NMSE. For each control interval time, neural controller predicts the server mean response time as a function of arrival traffic, some FreeBSD operating system and the actual MaxClients value. For the next interval MaxClients was adjusted to keep the server mean response time close to the desired mean response time. The feedback controller was a PI controller. It was a SISO (Single In Single Out) model. The input control was MaxClients and the output control was the Apache mean response time. For each interval control, MaxClients was adjusted as function of the measured server mean response time, parameters gain KI and KP using the PI controller law. The new value of MaxClients was applied to the next interval. The neural based feedback controller was validated and implemented on a machine with Apache. Measurements were made to examine the server mean response time. The experiments illustrate that neural 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. strm and B. Wittenmark, Computercontrolled systems, theory and design, Prentice Hall International Editions, 3rd Edition, 1997.

-6-

Você também pode gostar