Download presentation
Presentation is loading. Please wait.
1
Dynamic Process Allocation in Apache Server Yu Cai
2
Introduction Degrading DDoS attacks. We want a web server system which can provide clients with differentiated services of proportional response time Two ways: –A) admission control and traffic classification: classify the incoming traffic into different queues with different QoS requirement. –B) dynamic resource management (our focus): dynamically control the number of processes assigned to each class.
3
Problem Formulation We use M /M /1 queue to model the web server traffic. Proportional-delay of response time for two classes 1 and 2. Assumption of processing rate:
4
Problem Formulation We want to achieve the resource allocation by process allocation in Apache. The ratio of process allocation can be calculated by:
5
Implementation in Apache We modify Apache to make it listen to two ports (80, 8000). The traffic of class 1 will be routed to port 80, and class 2 to port 8000 by admission control. We dynamically control the number of processes allocated for each port, while maintaining a process ratio specified in a ratio file. It is achieved by modifying the child_main() function in http_main.c file of apache. The Process forking and killing is still handled by Apache itself.
6
Implementation in Apache The process allocation ratio is put in a local text file( ratio file). Sample ratio file: ratio multiplier port1: ratio1 port2: ratio2 total processes 180:3 8000:13+1=4 280:3 8000:16+2=8 A resource management program will dynamically calculate the process ratio and update the ratio file by assigning ratio multiplier( usually is 1), ratio1 and ratio2. The ratio file will be read/write by the apache process. –If all processes are busy, we will increase the ratio multiplier by 1, and apache will be allow to fork more processes, therefore the total processes increases accordingly. –If any process is not busy, we will decrease the multiplier by 1, and let the server not to listen to the requests. Therefore apache will kill some processes, the total processes decrease accordingly.
7
Dynamic Process Allocation Algorithm 1. Read apache scoreboard to get number of active processes currently allocated for each port 2. Access the process ratio file to get ratio multiplier, ratio1 and ratio2. Number of processes for a port = multiplier * ratio, Total number of processes = multiplier * ( ratio1 + ratio2 ) 3. If number of active process for all ports >= total number of processes given in the ratio file, // update ratio file increase the multiplier by 1 and update the ratio file else decrease the multiplier by 1 and update the ratio file end if 4. If number of active processes for a port >= number of processes given in the ratio file for that port //too many active processes for a port Do not listen for requests on the server socket. //allow apache to kill idle processes end if 5. Exclusively wait for requests on all available server socket. 6. Handle request 7. Update scoreboard
8
System Architect
9
Performance Evaluation Use two HP PC(PIII 1GHz, 516M RAM, Redhat 9, 100M Ethernet connection) as router and task web server. Use four HP PC(PIII 233MHz, 96M RAM, Redhat 9, 100M Ethernet connection) to generate http request. Use Httperf and Webbench as the request generator. They can generate http requests with Poisson distribution. The apache we used is version 1.3.29. In the experiments, the system first warmed up for 100 time units. We collect the response time during the next 1000 time units. We average the result after 50 runs. Then we change the system load and repeat the above process.
10
Without Dynamic Process Adaptation
11
We set the process ratio to 3:1, and want to achieve response time ratio 3:1. The result show it is not possible to achieve proportional response time by set a fixed process ratio.
12
With Dynamic Process Adaptation
13
With dynamic process adaptation, we can achieve proportional response time at range 40% – 80 % system load. It the load is too light or too heavy, it is hard to control.
14
With Dynamic Process Adaptation
16
Class 1 Fix and Class 2 Change
18
Class 1 change and Class 2 fix
20
System Capacity vs. Total Num of Processes
21
Future Work Find better dynamic process allocation algorithm. Combine admission control and traffic classification together Add feedback and notification mechanism in the system.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.