Web Server Software Architectures Author: Daniel A. Menascé Presenter: Noshaba Bakht.

32
Web Server Software Web Server Software Architectures Architectures Author: Author: Daniel A. Menascé Daniel A. Menascé Presenter: Noshaba Bakht Presenter: Noshaba Bakht
  • date post

    21-Dec-2015
  • Category

    Documents

  • view

    222
  • download

    1

Transcript of Web Server Software Architectures Author: Daniel A. Menascé Presenter: Noshaba Bakht.

Page 1: Web Server Software Architectures Author: Daniel A. Menascé Presenter: Noshaba Bakht.

Web Server SoftwareWeb Server SoftwareArchitecturesArchitectures

Author:Author: Daniel A. MenascéDaniel A. Menascé

Presenter: Noshaba BakhtPresenter: Noshaba Bakht

Page 2: Web Server Software Architectures Author: Daniel A. Menascé Presenter: Noshaba Bakht.

Web Site performance and Web Site performance and scalabilityscalability

• 1.workload characteristics.1.workload characteristics.

• 2.security mechanisms.2.security mechanisms.

• 3. Web cluster architectures. AND3. Web cluster architectures. AND

• 4. Web server software architecture.4. Web server software architecture.

Page 3: Web Server Software Architectures Author: Daniel A. Menascé Presenter: Noshaba Bakht.

Software Architecture Software Architecture SchemesSchemes

• Two dimensions generally characterize the Two dimensions generally characterize the architecture:architecture:

• ( 1 ). The processing model. ( 1 ). The processing model.

It describes the type of process or threadingIt describes the type of process or threading

model used to support a Web server operation;model used to support a Web server operation;

• ( 2 ). Pool-size behavior.( 2 ). Pool-size behavior.

• Pool-size behavior specifies how the size of thePool-size behavior specifies how the size of the

• pool of processes or threads varies over time pool of processes or threads varies over time with workload intensity.with workload intensity.

Page 4: Web Server Software Architectures Author: Daniel A. Menascé Presenter: Noshaba Bakht.

Processing ModelsProcessing Models

• The main options for a processing The main options for a processing model aremodel are

• 1.process-based,1.process-based,

• 2. thread-based,2. thread-based,

• 3. a hybrid of the two.3. a hybrid of the two.

Page 5: Web Server Software Architectures Author: Daniel A. Menascé Presenter: Noshaba Bakht.

process-based servers.process-based servers.

• Process-based servers consist of multiple Process-based servers consist of multiple single-threaded processes,each of which single-threaded processes,each of which handles one request at a time.handles one request at a time.

The implementation of this server model The implementation of this server model also called prefork in Apache Unix version also called prefork in Apache Unix version and in Apache version 2.0 MPM prefork and in Apache version 2.0 MPM prefork module.module.

http://portalux.com/networking/servers/http-http://portalux.com/networking/servers/http-servers/servers/

http://www.apache.org/dist/httpd/Announcehttp://www.apache.org/dist/httpd/Announcement.htmlment.html

Page 6: Web Server Software Architectures Author: Daniel A. Menascé Presenter: Noshaba Bakht.

Thread based architecture.Thread based architecture.

• The server consists of a single The server consists of a single multithreaded server, each thread multithreaded server, each thread handles one request at a time.handles one request at a time.

• Implementation of this model is seen Implementation of this model is seen in Windows NT’s version of Apache in Windows NT’s version of Apache 1.3.1.3.

• http://httpd.apache.org/docs/windows.http://httpd.apache.org/docs/windows.htmlhtml

• http://httpd.apache.org/docs2.0/platfohttp://httpd.apache.org/docs2.0/platform/windows.htmlrm/windows.html

Page 7: Web Server Software Architectures Author: Daniel A. Menascé Presenter: Noshaba Bakht.

Hybrid Model.Hybrid Model.

• The model consists of multiple multithreaded The model consists of multiple multithreaded processes, with each thread of any process processes, with each thread of any process handling one request at a time.handling one request at a time.

• This Multi-Processing Module (MPM) implements a This Multi-Processing Module (MPM) implements a hybrid multi-process multi-threaded server. By hybrid multi-process multi-threaded server. By using threads to serve requests, it is able to serve using threads to serve requests, it is able to serve a large number of requests with less system a large number of requests with less system resources than a process-based server. Yet it resources than a process-based server. Yet it retains much of the stability of a process-based retains much of the stability of a process-based server by keeping multiple processes available, server by keeping multiple processes available, each with many threads.each with many threads.

• http://httpd.apache.org/docs-2.0/mod/worker.htmlhttp://httpd.apache.org/docs-2.0/mod/worker.html

Page 8: Web Server Software Architectures Author: Daniel A. Menascé Presenter: Noshaba Bakht.

Advantage’s / DrawbacksAdvantage’s / Drawbacks• The process based architecture is stable, the crash The process based architecture is stable, the crash

of any process generally does not effect the others of any process generally does not effect the others so the system continues to operate.so the system continues to operate.

• Creating and killing of processes overloads the web Creating and killing of processes overloads the web server, due to the address –space management.server, due to the address –space management.

• In thread based architecture a single malfunctioning In thread based architecture a single malfunctioning thread can bring the entire web server down thread can bring the entire web server down resulting in great instability as all the threads share resulting in great instability as all the threads share the same address space.the same address space.

• The memory requirements are much smaller in this The memory requirements are much smaller in this model, it is more efficient to spawn threads of the model, it is more efficient to spawn threads of the same process due to sharing of the same address same process due to sharing of the same address space, than to fork a process, various threads easily space, than to fork a process, various threads easily share data structures as caches.share data structures as caches.

Page 9: Web Server Software Architectures Author: Daniel A. Menascé Presenter: Noshaba Bakht.

Hybrid architecture.Hybrid architecture.

• Combines the advantages of both models and Combines the advantages of both models and reduce their disadvantages.reduce their disadvantages.

• ExampleExample• # of processes = p.# of processes = p.• # of threads per process = n.# of threads per process = n.• Total # of requests handled by the server at a Total # of requests handled by the server at a

time = n * p.time = n * p.• If a thread/process crashes # of requests handled If a thread/process crashes # of requests handled

at a time = ( p -1) * nat a time = ( p -1) * n• Less memory required by the system to handle Less memory required by the system to handle

the requests and the system is more stable.the requests and the system is more stable.

Page 10: Web Server Software Architectures Author: Daniel A. Menascé Presenter: Noshaba Bakht.
Page 11: Web Server Software Architectures Author: Daniel A. Menascé Presenter: Noshaba Bakht.

POOL SIZE BEHAVIORPOOL SIZE BEHAVIOR

• Two approaches are possible.Two approaches are possible.• 1. Static Approach.1. Static Approach.• The Web server creates a fixed number of processes or The Web server creates a fixed number of processes or

threads at the startup time. Rush hours:::If the # of threads at the startup time. Rush hours:::If the # of requests exceed the number of the p/t the request waits requests exceed the number of the p/t the request waits in the queue. Server load is low::::idle p/t.in the queue. Server load is low::::idle p/t.

• The internet Information Server to view HTML pages by windowsThe internet Information Server to view HTML pages by windows• http://www.microsoft.com/windowsserver2003/iis/default.mspxhttp://www.microsoft.com/windowsserver2003/iis/default.mspx

• 2. Dynamic Approach.2. Dynamic Approach.• The Web server creates the number of processes and The Web server creates the number of processes and

threads depending on the load, as the load increases so threads depending on the load, as the load increases so does the pool, letting more requests process does the pool, letting more requests process concurrently and the queue size is reduced.concurrently and the queue size is reduced.

Page 12: Web Server Software Architectures Author: Daniel A. Menascé Presenter: Noshaba Bakht.

Dynamic Pool-size Dynamic Pool-size Implementation.Implementation.• Web server parent process establishes Web server parent process establishes • Configuration parameters.Configuration parameters.1.Initial configuration parameter is the number p of child processes 1.Initial configuration parameter is the number p of child processes

created to handle the requests correctly.created to handle the requests correctly.2.Minimum # m of idle processes in another configuration parameter.2.Minimum # m of idle processes in another configuration parameter. As the load of the request increases the processes are used up As the load of the request increases the processes are used up

and the m # decreases below its sets level, thus telling the parent and the m # decreases below its sets level, thus telling the parent process to fork and created more child processes to handle the process to fork and created more child processes to handle the requests efficiently. When the load requests is decreased the min requests efficiently. When the load requests is decreased the min # of the processes increase telling the parent process to kill the # of the processes increase telling the parent process to kill the extra processes.extra processes.

3. Another configuration parameter is based on the life of the process 3. Another configuration parameter is based on the life of the process or the number of requests it handles before it dies.or the number of requests it handles before it dies.

It can be set to zero and the process will have infinite life.It can be set to zero and the process will have infinite life.It can be set to a number value.It can be set to a number value.This life limit reduces the memory loads and leaks.This life limit reduces the memory loads and leaks.

Page 13: Web Server Software Architectures Author: Daniel A. Menascé Presenter: Noshaba Bakht.

Performance ConsiderationsPerformance Considerations

• The Web serve request’s total response time is The Web serve request’s total response time is divided into following components.divided into following components.

• 1.Service Time.1.Service Time. The total time a request spends on The total time a request spends on the physical resource level i.e disk and cpu.the physical resource level i.e disk and cpu.

• Physical contention.Physical contention. The time the process spends The time the process spends waiting for the physical resources of the web waiting for the physical resources of the web server.server.

• Software contention.Software contention. The total time a server The total time a server request spends waiting in the queue for a request spends waiting in the queue for a process/thread to be available to handle the process/thread to be available to handle the request.request.

Page 14: Web Server Software Architectures Author: Daniel A. Menascé Presenter: Noshaba Bakht.
Page 15: Web Server Software Architectures Author: Daniel A. Menascé Presenter: Noshaba Bakht.

Architecture PerformanceArchitecture Performance

• Queuing Network Model.Queuing Network Model.

It models the physical resources of the It models the physical resources of the Web server and calculate the Web server and calculate the throughput.throughput.

• Markov Chain Model.Markov Chain Model.

It represent the software architectureIt represent the software architecture

Page 16: Web Server Software Architectures Author: Daniel A. Menascé Presenter: Noshaba Bakht.

Analytic Performance Analytic Performance ModelsModels

• Queuing Network Model ( QN ).Queuing Network Model ( QN ).A queuing network model represents a system as a set A queuing network model represents a system as a set

of service centers that process customers (also known of service centers that process customers (also known as jobs, transactions, or arrivals). Service centers can as jobs, transactions, or arrivals). Service centers can be any active resource such as a CPU, disk ,printer, be any active resource such as a CPU, disk ,printer, network link. Queuing network models can predict the network link. Queuing network models can predict the latency, throughput and utilization of a system and its latency, throughput and utilization of a system and its components. It models the Web server’s physical components. It models the Web server’s physical resources and computes it throughput.resources and computes it throughput.

Distributions of the service and arrival time is the key.Distributions of the service and arrival time is the key.

Page 17: Web Server Software Architectures Author: Daniel A. Menascé Presenter: Noshaba Bakht.
Page 18: Web Server Software Architectures Author: Daniel A. Menascé Presenter: Noshaba Bakht.

Markov modelMarkov model

• A Markov model is a random process in which the A Markov model is a random process in which the transition transition probabilityprobability to the next state depends solely on the previous to the next state depends solely on the previous state state

• Transition probabilityTransition probability is a conditional probability for the is a conditional probability for the system to go to a particular new state, given the current system to go to a particular new state, given the current state of the system.state of the system.

• Memoryless model.Memoryless model.

Page 19: Web Server Software Architectures Author: Daniel A. Menascé Presenter: Noshaba Bakht.

Markov chainMarkov chain

• The characteristic property of this sort of process is The characteristic property of this sort of process is that it retains that it retains no memory no memory of where it has been in the of where it has been in the past. This means that only the current state of the past. This means that only the current state of the process can influence where it goes next....process can influence where it goes next....

• The process can assume only a finite or countable set The process can assume only a finite or countable set of states, when it is usual to refer to it as a of states, when it is usual to refer to it as a Markov Markov chainchain..

• "Markov chains are the "Markov chains are the simplest mathematical models simplest mathematical models for random phenomenafor random phenomena evolving in time. evolving in time.

• Indeed, the whole of the mathematical study of Indeed, the whole of the mathematical study of random processes can be regarded as a generalization random processes can be regarded as a generalization in one way or another of the theory of Markov chains." in one way or another of the theory of Markov chains."

• "Chains exist both in discrete time... and continuous "Chains exist both in discrete time... and continuous time..."time..."

Page 20: Web Server Software Architectures Author: Daniel A. Menascé Presenter: Noshaba Bakht.

Analytic Performance of the Analytic Performance of the ModelsModels• Arrival rate (Arrival rate (λλ))

(inverse of mean (inverse of mean interarrival time) interarrival time)

• Service rate (µ) Service rate (µ) (inverse of mean (inverse of mean service time)service time)

Page 21: Web Server Software Architectures Author: Daniel A. Menascé Presenter: Noshaba Bakht.
Page 22: Web Server Software Architectures Author: Daniel A. Menascé Presenter: Noshaba Bakht.
Page 23: Web Server Software Architectures Author: Daniel A. Menascé Presenter: Noshaba Bakht.
Page 24: Web Server Software Architectures Author: Daniel A. Menascé Presenter: Noshaba Bakht.

The state k represent # of the request in the The state k represent # of the request in the system ( waiting or being handled).system ( waiting or being handled).

Transition of k to k+1 occur at a rate at which Transition of k to k+1 occur at a rate at which new requests arrive at the server. The state new requests arrive at the server. The state k -1 indicates the completion of the request.k -1 indicates the completion of the request.

K - 1

k

K + 1

K + 1 +….

Page 25: Web Server Software Architectures Author: Daniel A. Menascé Presenter: Noshaba Bakht.
Page 26: Web Server Software Architectures Author: Daniel A. Menascé Presenter: Noshaba Bakht.

Idle Processes PoolIdle Processes Pool

• The average number of idle processes is a function of The average number of idle processes is a function of the average arrival rate of requests for three different the average arrival rate of requests for three different values of the active processes p.values of the active processes p.

• For very light loads.For very light loads.# idle processes ~ total # of processes.# idle processes ~ total # of processes.• When the load increases the # of idle processes When the load increases the # of idle processes

decrease slightly in the beginning and precipitously as decrease slightly in the beginning and precipitously as the arrival rate reaches to its maximum possible value.the arrival rate reaches to its maximum possible value.

• This maximum value which is 5 req/sec in this caseThis maximum value which is 5 req/sec in this case• Represent that the web server becomes unstable at Represent that the web server becomes unstable at

this point and the this point and the queue for the processesqueue for the processes grows grows without bound.without bound.

Page 27: Web Server Software Architectures Author: Daniel A. Menascé Presenter: Noshaba Bakht.
Page 28: Web Server Software Architectures Author: Daniel A. Menascé Presenter: Noshaba Bakht.
Page 29: Web Server Software Architectures Author: Daniel A. Menascé Presenter: Noshaba Bakht.

Web Server @ Dynamic Pool Web Server @ Dynamic Pool SizeSize

• Maintain an average of idle Maintain an average of idle processes to be 10 – 11.processes to be 10 – 11.

Page 30: Web Server Software Architectures Author: Daniel A. Menascé Presenter: Noshaba Bakht.

Final RemarksFinal Remarks

• Software connection and architecture Software connection and architecture effects the web server performance.effects the web server performance.

• Computer system web server can Computer system web server can adjust dynamically the pool of the adjust dynamically the pool of the processes with the help and efficient processes with the help and efficient use of the analytic performance use of the analytic performance models.models.

Page 31: Web Server Software Architectures Author: Daniel A. Menascé Presenter: Noshaba Bakht.

Reference Articles.Reference Articles.• Scaling The Web DanielA.MenasceScaling The Web DanielA.Menasce Response-Time Analysis of Composite Web Services.Response-Time Analysis of Composite Web Services. (Submit the query to various search engines in parallel)(Submit the query to various search engines in parallel) Fork and join model.Fork and join model.• http://cs.gmu.edu/~menasce/papers/IEEE-IC-RespTimeWS-January2004.pdfhttp://cs.gmu.edu/~menasce/papers/IEEE-IC-RespTimeWS-January2004.pdf Scaling Web Sites through CachingScaling Web Sites through Caching• http://cs.gmu.edu/~menasce/papers/IEEE-IC-ScalingCaching-July-2003.pdfhttp://cs.gmu.edu/~menasce/papers/IEEE-IC-ScalingCaching-July-2003.pdf• Scaling your E-business Scaling your E-business Traffic spikes and its control via the building of scalable infrastructure.Traffic spikes and its control via the building of scalable infrastructure.

• http://www.softwaremag.com/archive/2001feb/ScalingE-http://www.softwaremag.com/archive/2001feb/ScalingE-business.htmlbusiness.html

• Sun Secure Web Server Reference Architecture.Sun Secure Web Server Reference Architecture.• http://www.sun.com/smi/Press/sunflash/2004-04/sunflash.20040419.5.htmlhttp://www.sun.com/smi/Press/sunflash/2004-04/sunflash.20040419.5.html

• Dynamic Load balancing on Web-Server SystemsDynamic Load balancing on Web-Server SystemsDistributed web server systems, Client based , server architecture based approach.Distributed web server systems, Client based , server architecture based approach.The bandwidth of the network and its effect on the web traffic.The bandwidth of the network and its effect on the web traffic.• http://tele1.dee.fct.unl.pt/td_2002_2003/teo/web_replicated.pdfhttp://tele1.dee.fct.unl.pt/td_2002_2003/teo/web_replicated.pdf

• ANALYSIS OF COMPUTER PERFORMANE TEANALYSIS OF COMPUTER PERFORMANE TECHNIQUESCHNIQUES

• http://www.frontrunnercpc.com/info/infomain-fs.htmhttp://www.frontrunnercpc.com/info/infomain-fs.htm

Performance Analysis Techniques for the models.Performance Analysis Techniques for the models.http://www.frontrunnercpc.com/info/techniques.htmhttp://www.frontrunnercpc.com/info/techniques.htm

Page 32: Web Server Software Architectures Author: Daniel A. Menascé Presenter: Noshaba Bakht.

Three Critical Questions.Three Critical Questions.• For the author the average arrival time of the requests is important as it For the author the average arrival time of the requests is important as it

determines the number of the idle processes and which is the control determines the number of the idle processes and which is the control switch for the configuration parameter in the dynamic size pool behavior of switch for the configuration parameter in the dynamic size pool behavior of the web server architecture, what is the impact of complexity of the the web server architecture, what is the impact of complexity of the software architecture and the arrival time of the requests? software architecture and the arrival time of the requests?

• Web based services are offered to potentially tens of millions of users by Web based services are offered to potentially tens of millions of users by hundreds of thousands of servers. The web servers using the analytic hundreds of thousands of servers. The web servers using the analytic performance models as a guide to dynamically adjust configuration performance models as a guide to dynamically adjust configuration parameters to handle the maximum request with minimum time delay will parameters to handle the maximum request with minimum time delay will definitely improve the availability and scalability of the e-business but what definitely improve the availability and scalability of the e-business but what is its impact on the cost-effectiveness of the web services? is its impact on the cost-effectiveness of the web services?

• Some e-business sites may become popular very quickly. How fast can the Some e-business sites may become popular very quickly. How fast can the site architecture be scaled up? What components of the site should be site architecture be scaled up? What components of the site should be upgraded? Database server? Web servers? Application servers? Or the upgraded? Database server? Web servers? Application servers? Or the network link bandwidth? network link bandwidth?

• Capacity planning is the process of predicting when future loads levels will Capacity planning is the process of predicting when future loads levels will saturate the system, and of determining the most cost-effective way of saturate the system, and of determining the most cost-effective way of delaying the system saturation as much as possible. Prediction is key to delaying the system saturation as much as possible. Prediction is key to capacity planning because an organization needs to be able to determine capacity planning because an organization needs to be able to determine how an e-business site will react when changes in load levels and customer how an e-business site will react when changes in load levels and customer behavior occur, or when new business models are developed. This behavior occur, or when new business models are developed. This determination requires predictive models and not the experimentation. Is determination requires predictive models and not the experimentation. Is the analytic performance models are a better fit than the simulation the analytic performance models are a better fit than the simulation models in  capacity planning ? models in  capacity planning ?

•