Transcript Powerpoint

E-Commerce
Architectures
and Technologies
Rob Oshana
Southern Methodist
University
Capacity Planning
• Process of predicting when future
load levels will saturate the system
and of determining the most cost
effective way of delaying the system
saturation as much as possible
Capacity Planning
• Determining future load levels
– Natural evolution of existing workloads
– Deployment of new applications and services
– Changes in customer behavior
• Traffic surges due to new situations
• Changes in customer navigational patterns due to
availability of new business functions
• Predictive patterns and not
experimentation
Capacity Planning
• Service level agreements
– Upper or lower bounds of performance
and availability metrics
– Examples
• “server-side response time <= 2 sec”
• “site availability > 99.5%”
– Determined by management
– Indirect input from customers
Definition of Adequate
Capacity
Customers
Service
Level
Agreements
Specified
Technologies
And standards
Management
Cost
constraints
e.g. response time < 2 sec
Availability > 99.5%
Adequate
Adequate
capacity
capacity
e.g. NT servers,
Oracle DBMS,
SSL, SET
e.g. startup cost < $5.5 million
Maintenance cost < $1.6 million/yr
Capacity Planning
• Specified technologies and
standards
– Servers
– Software
• Cost constraints
– Organizational budgets and constraints
The Methodology
• Three main planning processes
– Business and functional planning
– Customer behavior planning
– IT resource planning
• Outcome is a set of plans for
modification and evolution of the site
High-Level View
Business and
Business
Functional
Evolution
Planning
Plans
Business and
Functional
Functional
Evolution
Planning
Plans
Customer Behavior
Evolution Plans
IT Infrastructure
Evolution
Plans
Business and
Functional
Planning
Customer
Behavior
Planning
IT Resources
Planning
Business characterization Type of Business
• B2C e-tailer (books, toys, CDs)
• B2C service (brokerage, financing)
• C2C auction (allow customer to buy
and sell)
• B2C auction (allow customer to
advertise)
• B2B purchasing (companies buying
parts from other companies)
Business Level Aspect of a
Capacity Planning
Methodology for E-Business
Business Characterization
Business
Evolution
Plan
Function
Evolution
Plan
Business
Model
Function Analysis
Functional
Model
Business characterization –
Third party services
• Payment gateways and
advertisement to support the Ebusiness
Business characterization –
Business descriptors
• Online bookstore example
– Total number of books stored in the
catalog
– Number of users registered in the site
– Buying pattern
– Book price range
– Catalog quantitative descriptors
• Number of copies sold per month
Business characterization –
Market composition
• Market for an online bookstore could
be global but higher concentration in
US
• French book store will get more hits
from France
Business characterization –
hours of operation
• Most e-businesses have 24/7/365
• Some businesses have specific
hours of operation
– Online trading sites get majority of hits
during the market hours
Functional Analysis
• Purpose is to produce a functional model
– Functions provided by the e-business site
• Need quantitative data to support each
function
– Interaction model (how does a user interact)
– Web technology used (applets, CGI, etc)
– Use of authentication (SSL or TLS)
Business Evolution
Analysis
• Plans for evolving the business can have
a big impact on the required capacity to
run the business
• Examples
–
–
–
–
–
Marketing campaign
Signing up more dealers
Adopting a bidding scheme’
Creating portal
Adding more multimedia capability
Function Evolution Analysis
• This is where the functions of the ebusiness site are analyzed over time
• Examples
– Marketing campaign; no changes to the
functional model
– Signing up more dealers; no changes to the
functional model
– Adopting a bidding scheme; functional model
changes
• View bids, cancel request, etc are added, some
deleted as well (car selection)
Function Evolution Analysis
– Creating a portal; functions added
(browse, apply for insurance, search)
– Adding more multimedia capability; add
a virtual test drive function
Customer Behavior Model
Aspect
Customer Behavior Characterization
Customer
Behavior
Evolution
Plan
Customer
Behavior
Model
Customer Behavior
Characterization
• Transition probabilities and think
times not shown in the CBMG
– (we’ll cover this later)
• Customer behavior evolution
analysis
– Changes in business models or new
services added to the e-business site
may cause changes in the CBMG
CBMG for Online AutoBuying Service
Select
options
Select
car
entry
home
View
order
Cancel
order
Select
order
Select
Svc contr
Enter
data
Apply for
financing
Enter deliv
data
Hold
car
CBMG for Online Auto-Buying
Service with Virtual Buying feature
Select
options
Select
options
Select
car
entry
home
View
order
Cancel
order
Select
order
Select
Svc contr
Enter
data
Apply for
financing
Enter deliv
data
Hold
car
Resource Level
• Next level in the capacity planning
methodology
• Based on three models
– Workload model
– Performance model
– Cost model
Resource Layer Aspect of a
Capacity Planning Method
IT Environment Characterization
IT Infrastructure
Evolution
Plan
Cost modeling
Cost
model
IT
infrastructure
Workload
description
Workload
characterization
Calibration and
validation
What-if
analysis
Workload
forecasting
Workload
Model
Performance
modeling
Performance
Model
Characterizing the IT
Environment
• Type of hardware (server machines, disk
farms, routers, load balancers, firewall)
• Servers (web server, application server,
database server, domain name server)
• Software (operating systems, middleware,
DBM)
• Network connectivity
• Network protocols
• Payment services
Typical Multi-Tier E-Business
Site Architecture
LAN 1
T3 link
LAN 2
App
Servers
Intranet/Internet
MS windows NT server
Site Server Commerce
Edition
Router
Firewall
DB
Servers
MS windows NT server
MS IIS HTTP server
Web
Server
MS windows NT server
MS SQL server
Example of Part of the
Workload Description
E-business
function
Car selection
Option selection
Transaction
LaunchShowCarModels
DisplayCarModels
SearchCarModels
LaunchShowCars
DisplayCarsByMake
SearchCarsByMake
SendReply
LaunchShowOptions
DisplayCarOptions
SearchCarOptions
SendReply
Server
WS
AS
DB
WS
AS
DB
WS
WS
AS
DB
WS
Workload Characterization
• Process of precisely describing, in a
qualitative and quantitative manner, the
global workload of an e-business site
• Transactions associated with each ebusiness function is called a basic
component
• Then build CSID for each e-business
function (represented by a state of the
CBMG)
CSID for the Option Select
E-Business Functions
1
2
3
[1,200]
C
[1,320]
WS
(Int,LAN1)
4
[1,400]
AS
(LAN1,LAN2)
LaunchShowOptions
5
[1,1050]
DB
(LAN2)
[1,2400]
AS
(LAN2)
SearchCarOptions
DisplayCarOptions
6
7
[1,2600]
WS
(LAN1,LAN2)
C
(LAN1,Int)
SendReply
DisplayCarOptions
Workload Characterization
• Basic components are then characterized
by workload intensity (e.g. transaction
arrival rates)
• Obtaining service demands
–
–
–
–
Measurements
Using performance monitors
Accounting systems
Derived from other parameters measured
directly
– Made during peak workload periods
Breaking down the global
workload
• When workload intensity is high, a
lot of data is available
• Substitute the collection of measured
values of all basic components by a
more compact representation called
a workload model
Workload Characterization
Data Collection Issues
• Performance monitoring and accounting
tools
• Example measurements
– Operating system
– Application server
– Database server
• Hard to calibrate all these measurements
into a single function that uses several
systems
Service Demands
EBusiness
Function
Car
selection
(20,000
requests)
Option
selection
(18,900
requests)
Color
selection
(14,120
requests)
Extended
services
(8020
requests)
Server
WS
AS
LAN1
LAN2
Link
DB
P: 5.2
I: 9.5
P: 25.0
I: 15.0
P: 20.0
I: 40.0
0.492
0.532
16.4
P: 4.8
I: 8.5
P: 18.0
I: 14.0
P: 13.0
I: 20.0
0.328
0.352
12.0
P: 4.9
I: 8.2
P: 13.0
I: 12.0
P: 13.0
I: 20.0
0.287
0.328
12.0
P: 5.1
I: 8.4
P: 12.0
I: 10.0
P: 13.0
I: 20.0
0.295
0.492
11.5
Workload Forecasting
• Process of predicting how system
workloads will vary in the future
• Must evaluate workload trends if
historical data are available
• Can also analyze business or
strategic plans
– Components are assigned to business
processes
Performance Modeling
• This is the process of estimating
performance measures of a computer
system for a given set of parameters
–
–
–
–
–
Response time
Throughput
Resource utilization
Resource queue length
Example; server side response time for
executing a Hold Car function
Categories of Performance
Parameters
• System parameters
– Load balancing disciplines at the load balancer
– Maximum number of TCP connections in
progress
– Maximum number of threads supported
– Network protocols used
• Resource parameters
– Disk seek times
– Latency and transfer rates
– CPU speed ratings
Categories of Performance
Parameters
• Workload parameters
– Workload intensity parameters
• Measure of the total load placed on a system
• Number of sessions started per day
• Number of hits/day at the Web server
– Workload service demands
• Total amount of service time required by each basic
component
• Transmission times of replies
• CPU time of transactions at the application server
Calibration and Validation
• Performance model is accurate if the
performance metrics calculated by the
model match the measurements of the
actual system within some margin of error
• Measurements taken during workload
characterization
• Same measures computed in a
performance model
• May result in recalibration of the model
Cost Modeling
• Cost models used to forecast the
cost changes in the infrastructure
• Additional disk storage, processing
capacity, main memory, network
bandwidth
• Rules of thumb (ROT) to obtain first
cut approximations
Cost Modeling
• Some ROT
– Memories get 4 times larger every three
years (Moores law)
– Processors get 4 times larger every
three years (Moores law)
– Secondary storage capacities are
increasing 100 times per decade
– Link B/W increases by a factor of four
every three years (Gilders law)
What-if Analysis
• Cost-performance tradeoffs should
be done
• Should the site be mirrored?
• Should the WS be replaced?
• Should the DB be replicated?
• This process yields inputs to the
plan to evolve the IT infrastructure
Chapter 8 – Performance
Modeling Concepts
Performance of a simple Ebusiness Server
• Performance models can be
developed at different levels of detail
• Server-level approach considers the
server modeled as a black box
• What is site performance at peak
period?
• What is LAN utilization if catalog
pages increase by 200% ?
Small Online Toy Store Site
Architecture
Web Server
Database Server
Internet
LAN
Requests
And
replies
Home page
functions
SQL Server
Database
Input Data for the Simple
Problem
Type of data
Number of completed customer sessions
Web server total busy period
DB server total busy period
Measurement interval
Value
35,000
1,200 sec
2,100 sec
3,600 sec
Performance of a simple Ebusiness Server
• Posing questions is an important step
toward performance modeling
• A model is a representation of a system
– Physical
– Logical
– Functional
• Should be as simple as possible
• Capable of capturing relevant
characteristics of the system
What is a performance
model?
• A model of a system helps one
understand some fundamental
characteristics of the system
• “All models are wrong, but some are
useful!”
Zipfs Law
• If one ranks the popularity of words
in a given text (p) by their frequency
(f) then f ~ 1/p
• A few elements score very high and a
very large number of elements score
very low
• Many phenomena on the web can be
modeled by Zipfs law
Zipfs Law
• P = k/r where P is the number of
references to a document, r is the rank, k
is a positive constant
• Some documents are very popular while
most documents receive just a few
references
• Can use Zipfs law to understand some
asymptotic properties of web caching
performance
Zipfs Law
• Results obtained from Zipfs model
are useful
– to characterize WWW workloads
– analyze document dissemination and
replication strategies
– model the behavior of caching and
mirroring systems
Other Types of Models
• CBMG
• CSID
• Resource model; represents the structure
and the various components of an ebusiness site
• Performance model; represents the way
system’s resources are used by the
workload and capture the main factors
determining system performance
Other Types of Models
• Analytic models; specify the interaction
between the various components of a
system via formulas
• Example; minimum possible HTTP
transaction time
Rtmin = RTT + requestmin +
SiteProcessingTime + replymin
RTT=round trip delay in network comm,
requestmin = RequestSize/Bandwidth = min
time needed to send the request to the site
Other Types of Models
• Simulation models; mimic the behavior of
the actual system by running a simulation
program
– Mimics the transitions among the system
states according to the occurrence of events in
the simulated system
– Measure performance by counting events
– Expensive to develop and run
– How long to you run it ?
Why do we need models?
• Help us understand the quantitative
behavior of complex systems
• Commerce is a transaction based system
• Useful for analyzing document
replacement policies in caching proxies
• Useful for analyzing bandwidth capacity of
certain network links
• Good essential tool for studying resource
allocation problems in the context of ecommerce
A Modeling Paradigm
• View from different perspectives;
– Modeling/prediction paradigm
• Modeling the system
– Analytic models
• Validating the model
– Obtain necessary input parameters
– Make proper assumptions
• Using the model to predict future system
performance
– Analytic or simulation techniques
Modeling/Prediction
Paradigm
Analyzing
Actual
system
Collect
data
Performance
measurement
Modeling
Predicting
Build a
model
Performance
Of projected
system
Obtain
Parameters
Solve the
model
Solve the
model
Validate
The model
Change
Validated
model
A Modeling Paradigm
• Accuracy of results
• Response time of e-commerce transaction
computed by model should be compared
against actual data
• Rules of thumb
– Resource utilization – 10%
– System throughput – 10%
– Response time – 20%
• Errors may exist in modeling phase or in
the measurement phase
CBMG for the Customer of
the Online Toy Store
0.6
entry
home
1.0
search
1.0
0.4
CSID for Search Function of
the Online Toy Store
3
C
[0.05,m2]
1
2
WS
C
[1,m1]
[0.95,m3]
4
5
DB
WS
[1,m4]
6
C
[1,m5]
1 -> 2 -> 4 -> 5 -> 6 search function
1 -> 2 -> 3 server overloaded, refused
Results from these models
• Average # times WS activated = 2 X 0.95 +
1 X 0.05 = 1.95
• Average # times DS activated = 1 X 0.95 =
0.95
• Average # of catalog searches = 2.5
• Summary; know the # times the business
functions are invoked during a customer
session and how the site resources are
stressed
Input data for the simple
problem
Type of data
Number of completed customer
sessions
Web server busy period (sec)
DB server busy period (sec)
Measurement interval (sec)
Number of searches per
customer session
Number of visits to the web
server per search
Number of visits to the DB
server per search
Value
35,000
1,200
2,100
3,600
2.5
1.95
0.95
Service Time and Service
Demand
• Different levels of resources in ecommerce sites
– Payment and authentication servers
– Processor and disks of a server
– LAN segment or router
• Consider a browser transaction
– Several I/O operations at different disks
– Use CPU at DB server several times
– Various networks to carry requests and replies
Service Time and Service
Demand
• Server-level performance models looks at
the server as a black box
• Average Service Demand:
Di = Vi X Si
Vi = average # of visits made by a
transaction to resource I
Si = average service time per visit at the
resource
Service Time and Service
Demand
• Example: B2B service site, WS has
interfaces to legacy mainframe, 20K
orders/day, 90% or orders have 6 line
items, 10% have 28 line items, each
line item takes 0.5 sec to process
Dmainframe = Vmainframe = Smainframe,
Where Vmainframe = 1
Service Time and Service
Demand
• Smainframe = 0.10 X (28 X 0.5) + 0.90 X (6
X 0.5) = 4.1 sec
• Dmainframe = Vmainframe = Smainframe =1 X 4.1
sec
Service Times at a Server
• Server is a combination of;
– Hardware platform (processors,
memory, I/O subsystems (disks),
network interface controllers, audio and
video units)
– Operating system
– Server software
– content
Service Times at a Server
• Service demand refers only to the
time a request spends actually
receiving service
– Waiting times not included
Si = Di / Vi
Service Times in
Communication Networks
• Messages from client to server or from a
server to another server go through
several protocol layers and one or more
networks
• Protocol stack would include
–
–
–
–
Transport layer protocol (TCP, UDP)
Internet protocol (IP, IPX)
Network protocol (Ethernet, Token Ring)
Exchange of protocol data units (PDUs)
Service Times in
Communication Networks
• Routers must be able to fragment
datagrams as they go through
networks of decreasing MTUs
• Fragments reassembled at the IP
level at the destination
• Each protocol layer adds its own
header and sometimes trailer
Connectivity between a
Client and a Server
LAN 2:
Token Ring
16 Mbps
MTU: 4,444 bytes
client
Router 1
LAN 1:
Ethernet
10 Mbps
MTU: 1,500 bytes
LAN 2:
FDDI ring
100 Mbps
MTU: 4,472 bytes
Router 2
DB server
Characteristics of Various
Network Protocols
Protocol
PDU Name
Max PDU
Size (bytes)
Overhead
(Bytes)
TCP
UDP
IP
Version 4
IP
Version 6
ATM
Ethernet
IEEE
802.3
IEEE
802.5
Token
Ring
FDDI
(RFC
1390)
Segment
datagram
datagram
65,515
65,515
65,535
20
8
20
Max Data
Area
(bytes)
65,495
65,507
65,515
Datagram
65,535
40
65,495
Cell
frame
frame
53
1,518
1,518
5
18
21
48
1,500
1,497
frame
4,472
28
4,444
frame
4,500
28
4,472
Interaction Between Client
and Server over a TCP
Connection
DB
Server
process
request
Client
process
reply
TCP
TCP
IP
IP
Network Layer
Network Layer
FDDI
Ring
ethernet
Router 1
Token ring
Router 2
TCP Connection
Frame
IP
TCP
header Header Header
Client request
Frame
trailer
Example
• Client sends 300 byte long request to DB
server
• Receives 10K byte long reply
• Interaction is over TCP connection
– Request from client to server placed into data
area of TCP segment
– This travels in the data area of IP datagram
– IP datagram encapsulated by Ethernet frame, a
FDDI frame, and a Token ring frame (LAN1,
LAN2, LAN3)
Example
• 300 byte request + 20 bytes of TCP
header + 20 bytes of IP header + 18
bytes of frame overhead (LAN1) + 28
bytes of frame overhead (LAN2) + 28
bytes of frame overhead (LAN3)
– 358 (300+20+20+18) (LAN1)
– 368 (300+20+20+28) (LAN2)
– 368 (300+20+20+28) (LAN3)
Example
• Transmission time
358 X 8 / 10,000,000 = 0.000286 sec (L1)
368 X 8 / 100,000,000 = 0.00002944 sec
(L2)
368 X 8 / 16,000,000 = 0.000184 sec (L3)
Example
• Reply from server to client
• MSS is 1460 bytes (assumed)
• 7 TCP segments required to send
10K byte reply
– 1st 6 segments 1460 + 20 header
– Last has 1240 (10K – 6 X 1460) bytes
• Each segment receives IP header
and frame header in the netowork
Example 2
• Client submits transactions to server at
the rate of 3 per minute (0.05/sec)
• Average size of request is 400 bytes
– 80% are 8092 bytes long
– 20% are 100,000 bytes long
• Assume no fragmentation
• MSS is 1460 bytes
• Compute average service time of requests
and replies
Example 2
• 400 / 1460 = 1 for requests
• 8092 / 1460 = 6 for short replies
• 100,000 / 1460 = 69 for long replies
Network Computations for
Example 2
Request
LAN1
LAN2
LAN3
Ndatagrams
Overhead
(bytes)
Service time
(msec)
Ndatagrams
Overhead
(bytes)
Service time
(msec)
Ndatagrams
Overhead
(bytes)
Service time
(msec)
Short Reply
1
58
6
348
Long
Reply
69
4002
0.366
6.75
83.2
1
68
6
408
69
4692
0.0374
0.680
8.38
1
68
6
408
69
4692
0.234
4.25
52.3
Network Utilizations for
Example 2
LAN 1
0.0224
No. Clients
40
80
120
160
200
240
280
LAN 1
4.5
9.0
13.4
17.9
22.4
26.9
31.4
Service Times (sec)
LAN 2
0.00223
Percent Utilization
LAN 2
0.4
0.9
1.4
1.8
2.3
2.7
3.2
LAN 3
0.0141
LAN 3
2.8
5.6
8.5
11.3
14.1
16.9
19.7
Router Latency
• Communication processor used to
determine the route that a datagram will
follow from the source host to the
destination host
• Datagrams are queued up til the router
can process them
• Processed datagrams placed in outgoing
queues
• Router latency is the time taken by a
router to process a datagram
Network Equations
Number of datagrams generated by a message
(no fragmentation)
Ndatagrams = MessageSize/MSS
Total protocol overhead of a message over network n:
Overheadn = Ndatagrams X (TCPOvhd + IPOvhd + FrameOvhdn)
Network Equations
Message service time at network n:
ServiceTimen = (MessageSize + Overheadn) X 8
/ 10**6 X bandwidthn
Utilization of network n:
Un = SUM ( ArrivalRateofMessages X ServiceTime)
Example 3 - CSID for Online
Toy Store
3
C
[0.05,m2]
1
C
[1,m1]
2
WS
[0.95,m3]
4
5
DB
WS
[1,m4]
6
C
[1,m5]
1 -> 2 -> 4 -> 5 -> 6 search function
1 -> 2 -> 3 server overloaded, refused
Example 3
• Size of request message m3 = 400
bytes
• Size of reply m4 = 9150 bytes
• WS uses CGI stubs to send
transaction requests over TCP
• MSS = 1460 bytes
• Network is 100BASE T Ethernet
• What is the network utilization?
Example 3
• Searches/sec = 35,000 X 2.5 / 3600 =
24.3 tps
• Number of datagrams for requests
and replies
• 400 / 1460 = 1 for requests
• 9150 / 1460 = 7 for replies
Example 3
• Overheadn = Ndatagrams X
(TCPOvhd + IPOvhd + FrameOvhdn)
• ServiceTime = (MessageSize +
Overheadn) X 8 / 10**6 X Bandwidthn
Example 3
• Service time for request = 0.366
msec
• Service time for reply = 7.64 msec
• Utilization Unetwork = 24.3 X (0.366 +
7.64 ) X 10**-3 = 19.5%
Performance Laws
•
•
•
•
T = observation period
Bo = system busy period
Ao = number of arrivals of requests
Co = number of completed requests
• Can then derive operational
quantities
Utilization Law
• Fraction of time the resource is busy
• Utilization, U = Bi / T
• Average throughput from queue = Xi
= Co / T
• Ui = Bi / T = Bi / (Co/Xi) = (Bi/Co) X Xi
= Si X Xi
Example
• DS execute 45 search
transactions/sec during a period
• Transaction takes 19.0 msec
• Utilization = 45 X 0.019 = 0.855 =
85.5%
Forced Flow Law
• Average number of visits, Vi; each
completing transaction has to pass
Vi times on average by queue i
• Xo transaction complete per unit
time
• Vi X Xo transactions visit queue I per
unit time
• Xi = Vi X Xo is the Forced Flow Law
Example
• Measurement interval = 1200 sec
• 4800 transactions executed
• Transactions visit the WS on average 5.2
times
• Transactions visit the DS on average 3.8
times
• DB service is 59 msec
• Web service is 35 msec
• Compute average throughput of DS and
WS
Example
•
•
•
•
•
Xo = 4800 / 1200 = 4 tps
Vdb = 3.8
Vws = 5.2
Xdb = Vdb X Xo = 3.8 X 4 = 15.2 tps
Xws = Vws X Xo = 5.2 X 4 = 20.8 tps
Service Demand Law
• Combine the Utilization and Forced
Flow Laws
• Di = Vi X Si = (Xi / Xo) X (Ui / Xi) = Ui /
Xo
Little’s Law
• Simple and widely applicable to
performance analysis of computing
resources
N
R
X
Customers arrive
at the black box,
spend R seconds
in the black box
and leave
Little’s Law
n(t)
Number of customers in
the black box at time t
k
N
t
0
rk
t
Little’s Law
• Departure rate through black box is X
customers/sec
• N = average number of customers in
the black box (at the web site)
• Show that N = X X R
• Observation time is t
• Average number of customers in the
interval can be calculated
Little’s Law
• Sum of all products of the form k X fk
– K = number of customers in the black
box
– fk is the fraction of time k customers are
in the black box
– fk = rk / t
– rk is the total time that k customers were
in the black box
Little’s Law
• N = S k X fk = S k X rk / t
• This simplifies to
• N=XXR