PDQ-R: {\em Pretty Damn Quick} for R Statistical Computing

PDQ-R: Pretty Damn Quick for R Statistical Computing

This page was last updated on Mar 19, 2011

Contents

1  What Is It?
2  Where Is It?
3  PDQ-R Training
4  PDQ-R Example
5  Feedback

1  What Is It?

PDQ (Pretty Damn Quick) is an open source software package that supports the constuction of queueing models for calculating performance metrics associated with computer systems, data networks, manufacturing systems, fab lines, supply-chain management, etc. It is not a simulator and therefore is guaranteed to calculate the correct steady-state statistical means. It can, of course, be used in combination with a simulator. The example below shows how PDQ was used to find errors in a communications-network simulation.




R is an open-source system for statistical computation and graphical display of data. It consists of a language called R (based on the original language called S) together with a run-time environment that supports graphics, a debugger, access to certain system functions, and the ability to run programs stored in script files. For more information about R, read this FAQ.
The integration of PDQ with R is very significant because R does not have a qeueing network solver, but now with PDQ-R you can:
This combination R and PDQ is particularly powerful for doing computer performance analysis and capacity planning.

2  Where Is It?

PDQ-R is not yet available from the CRAN repository, so you will need to:
  1. Download it separately from the Performance Dynamics web page.

  2. Install it using the sudo make command for the top-level make file in the PDQ download.

This means you will need to have root privileges.

3  PDQ-R Training

A training class, which includes instructions on how to apply R computer performance analysis and capacity planning, is held every August in California.
Examples of how to apply PDQ to performance analysis and capacity planning are provied in the books:

4  PDQ-R Example

The following PDQ-R example is the same as the communications network example shown in PyDQ (Python PDQ) and is based on the following queueieng network diagram.
This is good example because it demonstrates the intrinsic ability of R to solve a set of simultaneous linear traffic equations within the same script that contains the PDQ model. The queueing nodes Comp1, Comp2, Comp3 have been relabeled Router1, Router2, Router3 in the PDQ-R code and the Greek λ symbol for network traffic is denoted simply by L.
# Jackson network example
# Created by NJG on Saturday, March 7, 2009
#
# Solve the Jackson network traffic eqns
#---------------------------------------
# Arrival rate into the network:
arate<-0.50
# Node service times:
stime<-c(1.0,2.0,1.0)
# Set up traffic eqns from network diagram:
# L1 = 0.5 + 0.2 L3
# L2 = 0.5 L1
# L3 = 0.5 L1 + 0.8 L2
# Rearrange the terms into matrix form:
#  1.0 L1 + 0.0 L2 - 0.2 L3 = 0.5
# -0.5 L1 + 1.0 L2 + 0.0 L3 = 0.0
# -0.5 L1 - 0.8 L2 + 1.0 L3 = 0.0
# All diagonal coeffs should be 1.0
# Map the coeffs into R matrices:
A<-matrix(c(1.0,0.0,-0.2, -0.5,1.0,0.0, -0.5,-0.8,1.0), 3, 3, byrow=TRUE)
B<-c(0.5,0.0,0.0)
# Solve for the local throughputs (L):
L<-solve(A,B)
# Use L matrix to calculate visit ratios at each router
v<-c(L[1]/arate, L[2]/arate, L[3]/arate)
# Service demands at each node:
sd<-c(v[1]*stime[1], v[2]*stime[2], v[3]*stime[3])
#
# Set up PDQ-R model of Jackson network
#--------------------------------------
library(pdq)
Init("Jackson Network in PDQ-R")
wname<-c("Traffic")
rname<-c("Router1", "Router2", "Router3")
# Create the traffic arriving into the network
CreateOpen(wname, arate)
SetWUnit("Msg")
SetTUnit("Sec")
# Create network routers
for(i in 1:length(rname)) {
	CreateNode(rname[i], CEN, FCFS)
	SetDemand(rname[i], wname, sd[i])
}
Solve(CANON)
Report()
print("Check traffic eqns:")
sprintf("L1: %f == %f: 0.5 + 0.2 L3\n", L[1], (0.5 + 0.2*L[3]), L[3])
sprintf("L2: %f == %f: 0.5 L1\n", L[2], (0.5*L[1]))
sprintf("L3: %f == %f: 0.5 L1 + 0.8 L2\n", L[3], (0.5*L[1] + 0.8*L[2]))

Running this R script, produces the following PDQ report.
                ***************************************
                ****** Pretty Damn Quick REPORT *******
                ***************************************
                ***  of : Wed Jun 10 13:26:55 2009  ***
                ***  for: Jackson Network in PDQ-R  ***
                ***  Ver: PDQ Analyzer v5.0 022509  ***
                ***************************************
                ***************************************

                =======================================
                ******    PDQ Model INPUTS      *******
                =======================================

Node Sched Resource   Workload   Class     Demand
---- ----- --------   --------   -----     ------
CEN  FCFS  Router1    Traffic    TRANS     1.2195
CEN  FCFS  Router2    Traffic    TRANS     1.2195
CEN  FCFS  Router3    Traffic    TRANS     1.0976

Queueing Circuit Totals:
        Streams:      1
        Nodes:        3

WORKLOAD Parameters:
Source        per Msg        Demand
------        -------        ------
Traffic        0.5000        3.5366


                =======================================
                ******   PDQ Model OUTPUTS      *******
                =======================================

Solution Method: CANON

                ******   SYSTEM Performance     *******

Metric                     Value    Unit
------                     -----    ----
Workload: "Traffic"
Number in system          4.3412    Msg
Mean throughput           0.5000    Msg/Sec
Response time             8.6824    Sec
Stretch factor            2.4550

Bounds Analysis:
Max throughput            0.8200    Msg/Sec
Min response              3.5366    Sec


                ******   RESOURCE Performance   *******

Metric          Resource     Work              Value   Unit
------          --------     ----              -----   ----
Throughput      Router1      Traffic          0.5000   Msg/Sec
Utilization     Router1      Traffic         60.9756   Percent
Queue length    Router1      Traffic          1.5625   Msg
Waiting line    Router1      Traffic          0.9527   Msg
Waiting time    Router1      Traffic          1.9055   Sec
Residence time  Router1      Traffic          3.1250   Sec

Throughput      Router2      Traffic          0.5000   Msg/Sec
Utilization     Router2      Traffic         60.9756   Percent
Queue length    Router2      Traffic          1.5625   Msg
Waiting line    Router2      Traffic          0.9527   Msg
Waiting time    Router2      Traffic          1.9055   Sec
Residence time  Router2      Traffic          3.1250   Sec

Throughput      Router3      Traffic          0.5000   Msg/Sec
Utilization     Router3      Traffic         54.8780   Percent
Queue length    Router3      Traffic          1.2162   Msg
Waiting line    Router3      Traffic          0.6674   Msg
Waiting time    Router3      Traffic          1.3349   Sec
Residence time  Router3      Traffic          2.4324   Sec

5  Feedback

New versions of PDQ are released periodically. Please fill out this form if you would like to notified by email.



File translated from TEX by TTH, version 3.38.
On 19 Mar 2011, 15:07.