Transcript ppt

CIS 4100 Systems Performance and Evaluation
Lecture 4
by
Zornitza Genova Prodanoff
Lect3..ppt - 09/13/04
Lecture Outline
Chapter 2:
• Types of networks
• Network protocols
• Client/Server Model
• Peer-to-Peer Model
• Web services protocols
ZGP002
Client/Server Communication
The client (process)
• Runs on a desktop
• Makes requests for services
• Executes a portion of the application code
The server (process)
• Executes a set of functionally related services
• Never initiates a message exchange with a client
• Implements a queue to hold client requests as they arrive
Request-reply protocol: client sends requests and server replies
Queue of client requests at the server
Server throughput is the number of requests served per unit time
ZGP003
Client/Server Communication
ZGP004
(continued)
Client/Server Communication
(continued)
• Fig. 2.14a shows that if only one request is served at a time, the
resources at the server machine may be underutilized, the
server throughput (number of requests served per time unit)
may be low, and response time to clients will increase as the load
on the server increases
• Fig. 2.14b shows that most servers create multiple processes or
multiple threads of execution in a single process to handle the
queue of incoming requests
ZGP005
Client/Server Communication
ZGP006
(continued)
Client/Server Communication
(continued)
• Using multiple threads or processes has an interesting effect on
response time as shown in Fig. 2.15.
• The figure shows two response time curves: one for an arrival
rate of 2.5 requests/sec and the other for 3.6 requests/sec. It
is assumed that each request uses 0.07 sec of CPU time and 0.2
sec of disk time.
ZGP007
Client/Server Communication
ZGP008
(continued)
Client/Server Communication
(continued)
• As the curves illustrate, when the number of threads increases
from one to two, the response time decreases because of the
decrease in the time spent by a request waiting for an available
thread.
• However, as the number of threads increases beyond this point,
the additional time spent by a request contending for the same
hardware resource dominates the decrease in thread waiting
time, leading to a net increase in response time.
• The average number of active threads will not increase. When
the number of threads becomes large enough, the thread waiting
time becomes negligible (given a constant arrival rate)
• Response time does no longer vary with the number of threads
ZGP009
Client/Server Communication
(continued)
• Two-tier vs. three-tier model
• “Fat” vs. “thin” clients
• Use caches to relieve the server from some of the load.
− If 30% of 900 requests are serviced by the cache, then only
(1-.30) x 900 = 630 requests are serviced by the server.
− Trade-offs are:
− Updates of cache content are needed to maintain
consistency (a fresh copy of the files)
− Overhead processing for misses: first check the cache
then request from server vs. request from server directly
ZGP0010
Client/Server Communication
ZGP0011
(continued)
Client/Server Communication
Server Types:
• File servers
• Database servers
• Application servers
• Groupware servers
• Object servers
• Web servers
• Software servers
ZGP0012
(continued)
Hyper Text Transfer Protocol (HTTP)
• Hypertext Markup Language (HTML)
− Integrate images and other multimedia objects, as well as
software applications
• Application layer protocol
• Runs on top of TCP/IP
ZGP0013
Hyper Text Transfer Protocol (HTTP) (continued)
• HTTP 1.0 vs. HTTP 1.1
• HTTP 1.0
− Allows for embedded documents in the HTML file
− The client browser opens a separate connection with the
server for each requested file: html, image, etc.
− Client does not need to wait for connection termination
before another connection request is sent
− Images are downloaded transparent to user: HTTP response,
containing the URL for the image is parsed before a new
connection request is made
ZGP0014
Hyper Text Transfer Protocol (HTTP) (continued)
• HTTP 1.1
− Allows for embedded documents in the HTML file
− “Persistent connections”: The client browser opens a (single)
connection with the server for the html file. Then,
embedded documents are requested within this same TCP
connection
− Pipelined requests: multiple requests are sent without
waiting for response (ACK)
− Pipelined HTTP 1.1 outperforms parallel connection based
HTTP 1.0
ZGP0015
ZGP0016
Hyper Text Transfer Protocol (HTTP) (continued)
• Figure 2.17: HTTP 1.1 vs. HTTP 1.0
− HTTP 1.1. results in 3 RTTs (vs. 4 RTTs with HTTP 1.0)
− Improving performance with HTTP 1.1
− Reducing the number of packets sent
− Better affect on network performance (less congestion)
• It has been shown that pipelined request based HTTP 1.1
outperforms HTTP 1.0 even if parallel TCP connections are
initiated with HTTP 1.0
ZGP0017
Peer-to-Peer Model
• Problems with C/S model
− Server seen as a central node:
− Scalability
− Reliability
• Peer-to-Peer model: a collaborative and distributed approach to
computing
• A study conducted at a major company with 10,000 workstations
− 75% of CPU cycles in the workstations or network nodes such
as routers are idle
− 50% of disk space is free
ZGP0018
Peer-to-Peer Model (continued)
• 10 billion MHz & 10,000 TB not utilized at the edges of the
Internet (see openP2P.com)
• The size of the networks and the complexity/requirements from
the protocols steadily increase
• Bandwidth consumption attributed to popular file sharing
applications reaches 60% of the total Internet traffic
• Must be able to locate the resources efficiently
ZGP0019
Peer-to-Peer Model (continued)
• Peer-to-Peer model: sharing of resources available at the edges of
the Internet
• In a P2P system, distributed computing nodes of equal roles or
capabilities exchange information directly with each other
• Resources could be content, storage, CPU-cycles, bandwidth
• P2P paradigm has many plausible characteristics:
− Scalability
− No centralized authority,
− Robustness
− Cooperation, sharing
− Anonymity
ZGP0020
Peer-to-Peer Model (continued)
Routing Indexes
• No-indexing (Gnutella)
• Centralized index (Napster)
• Distributed index (FreeNet)
ZGP0022
Peer-to-Peer Model (continued)
Advantages of Peer-to-Peer model:
• Performance gain with much less cost
• Self-organization
• Load balancing
• Adaptation
• Fault-tolerance
• Mobile devices
ZGP0023
Peer-to-Peer Model (continued)
Open problems:
• Locating and addressing
• Caching of passing through objects
• How to identify an Object
• Network usage and participation
ZGP0024
Peer-to-Peer Model (continued)
• Queries propagate across nodes, each node does some processing
and uses resources
• Bandwidth: The average over a set of representative queries of
the aggregate BW consumed (in bytes) over each edge on behalf
of the query
• Processing: The average over a set of representative queries of
the aggregate processing power consumed at each node on behalf
of the query
ZGP0025
Peer-to-Peer Model (continued)
• Gnutella: BFS technique is used with depth limit of D, where D=
TTL of the message. At all levels < D query is processed by each
node and results are sent to source and at level D query is
dropped.
• Freenet: uses DFS with depth limit D. Each node forwards the
query to a single neighbor and waits for a definite response from
the neighbor before forwarding the query to another neighbor (if
the query was not satisfied), or forwarding the results back to
the query source (if query was satisfied).
ZGP0026
Web Service Protocols
Services provided to users via the Web
Web service architecture:
• Provider
• Registry
• Requester
• A service is an application available for use by requesters that fit
the prerequisites specified by the service provider
• Web services can be composed with other services
• Services are deployed on the Web by service providers
ZGP0027
Web Service Protocols (continued)
Examples:
• Stock Quotes
• User Authentication
• Payment Authorization
• Airplane Ticket Purchase
• Hotel Reservations
ZGP0028
Web Service Protocols (continued)
Automating:
• Service Discovery
• Service Execution
• Service Composition
• Service Interoperation
ZGP0029
Web Service Protocols (continued)
What is Web Service Discovery?
• Automatically locating services that perform given task and
exhibit the requested properties
What is Web Service Composition and Interoperation?
• Includes selection of adequate Web services to perform a given
task
ZGP0030
Web Service Protocols (continued)
• Uniform service description format
• Uniform service discovery protocols
• Upper layers represent service interoperability protocols
ZGP0031
Web Service Protocols (continued)
Simple Object Access Protocol (SOAP)
• A World Wide Web Consortium (W3C) draft
• Specifies how to use Extended Markup Language (XML) and HTTP
together
• A uniform way of disseminating XML-encoded structured data
ZGP0032
Web Service Protocols (continued)
SOAP consists of three parts:
• An envelop that defines a framework – specifies message fields
• A set of encoding rules – how to represent instances of application
defined data types
• Syntax for remote procedure calls and responses SOAP results in no need to share a common programming language or
distributed object infrastructure
ZGP0033