serial to parallel circuit input

22 views
Skip to first unread message

Radu Brumariu

unread,
Nov 22, 2017, 11:18:56 AM11/22/17
to guerrilla-cap...@googlegroups.com
Hi,
I have a L7 http proxy that forwards certain requests to a specific set of nodes only.
Can I model this in PDQ using open models ? And more precisely, how :) ( I am using PDQ-R )

Thanks,
Radu

DrQ

unread,
Nov 22, 2017, 11:30:45 AM11/22/17
to Guerrilla Capacity Planning
??? How long is a piece of string?

How about a block diagram with performance numbers to provide some context?

Radu Brumariu

unread,
Nov 23, 2017, 11:26:33 AM11/23/17
to guerrilla-cap...@googlegroups.com
Here is the code that I came up with so far.


                                       | ------> Par1
                                       |            ...
--- Requests ----> LB ----|-------> ParN

Each of the ParN represents a group of application servers and service a portion of the total requests. Requests of certain type are always forwarded to the same group of servers.
The ServicesDemand array represents the avg response latency of the given service.
I am calculating p for the proportion of the traffic that lands on each of the services.

I am not sure if I am connecting the dots correctly here.
In the report all the services seem to have the same throughput which is the throughput of the LB

----------------------------------------
library(pdq)

ServiceNames <- lapply(1:6, function(x) sprintf("par%d", x))

ServicesArrivalRate<-c(1.04, 105.83, 2.79, 7.08, 97.14, 92.62) # per second

# Service times in ms

ServicesDemand <- c(467.30, 77.80, 20.31, 353.58, 296.58, 69.20) # milliseconds
ServiceWorkers <- c(8, 120, 21, 160, 120, 64)

lbWorkers <- 6000 * 5
totalArrivalRate <- sum(ServicesArrivalRate)
avgServiceTime <- sum(ServicesServiceTime) / length(ServicesDemand)

getP <- function(x) (x / totalArrivalRate)
p <- lapply(ServicesArrivalRate, getP)

work <- "Requests"

Init("serial/par")

CreateOpen(work, totalArrivalRate)
CreateMultiNode(lbWorkers, "LB", CEN, MSQ)
SetDemand("LB", work, avgServiceTime / 1000) # normalize to seconds

for(i in 1:6) {
  nodeCount <- ServiceWorkers[[i]]
  serviceName <- ServiceNames[[i]]
  serviceDemand <- p[[i]] * ServicesDemand[[i]] / 1000 # normalized to seconds
 
  CreateMultiNode(nodeCount, serviceName, CEN, MSQ)
  SetDemand(serviceName, work, serviceDemand)
}

Solve(CANON)

Report()
------------------------------------------

Thanks,
Radu

--
You received this message because you are subscribed to the Google Groups "Guerrilla Capacity Planning" group.
To unsubscribe from this group and stop receiving emails from it, send an email to guerrilla-capacity-planning+unsub...@googlegroups.com.
To post to this group, send email to guerrilla-capacity-planning@googlegroups.com.
Visit this group at https://groups.google.com/group/guerrilla-capacity-planning.
For more options, visit https://groups.google.com/d/optout.

DrQ

unread,
Nov 23, 2017, 11:32:37 AM11/23/17
to Guerrilla Capacity Planning
Error in eval(ei, envir) : object 'ServicesServiceTime' not found

DrQ

unread,
Nov 23, 2017, 1:16:29 PM11/23/17
to Guerrilla Capacity Planning
You've only defined one workload: the aggregate.
Since λ = X in steady state, all 6 parallel PDQ nodes ("services") see the same X.

If you want to analyze the component performance, you need to define 6 PDQ streams.

Radu Brumariu

unread,
Nov 27, 2017, 11:01:42 PM11/27/17
to guerrilla-cap...@googlegroups.com
Sorry, I've probably pasted the wrong script. Thanks for the suggestion.
I have defined several work streams with different service demand at each point. But I am getting this error :

ERROR in procedure 'canonical()': Only single PDQ stream allowed with MSQ nodes.

I am not sure what's the proper way to model this. Any hint is really appreciated.

Thanks,
Radu

--------------
library(pdq)

ServiceNames <- lapply(1:6, function(x) sprintf("par%d", x))

ServicesArrivalRate<-c(0.341, 122.622, 0.823, 32.110, 109.616, 99.31) # per second


# Service times in ms

LBServicesDemand <- c(299.79, 89.09, 31.26, 422.16, 320.13, 72.47) # milliseconds
ServicesDemand <- c(300.76, 85.55, 30.89, 412.17, 31.45, 68.88) # milliseconds

ServiceWorkers <- c(8, 120, 21, 160, 120, 64)

lbWorkers <- 6000 * 5
Init("serial/par")


CreateMultiNode(lbWorkers, "LB", CEN, MSQ)
for(i in 1:6) {
  workName <- sprintf("work-%s", ServiceNames[[i]])
  CreateOpen(workName, ServicesArrivalRate[[i]])
  SetDemand("LB", workName, LBServicesDemand[[i]]) # normalize to seconds

}

for(i in 1:6) {
  nodeCount <- ServiceWorkers[[i]]
  serviceName <- ServiceNames[[i]]
  serviceDemand <- ServicesDemand[[i]] / 1000 # normalized to seconds
  workName <- sprintf("work-%s", serviceName)
 
  CreateMultiNode(nodeCount, serviceName, CEN, MSQ)
  SetDemand(serviceName, workName, serviceDemand)
}

Solve(CANON)

Report()

To unsubscribe from this group and stop receiving emails from it, send an email to guerrilla-capacity-planning+unsubs...@googlegroups.com.

DrQ

unread,
Nov 28, 2017, 11:04:19 AM11/28/17
to Guerrilla Capacity Planning
> Sorry, I've probably pasted the wrong script. Thanks for the suggestion.

I got it working. You had one undefined variable (sitting in your namespace but not mine). Before transmitting R scripts it's a good idea to shut down R-Studio (or whatever R env), relaunch and see if the script still works as expected. Interpreted environments are very convenient but the namespace can quickly get cluttered.

 
> I have defined several work streams with different service demand at each point. 
> But I am getting this error :
> ERROR in procedure 'canonical()': Only single PDQ stream allowed with MSQ nodes.

Yup. There's no implementation for mutticlass MSQ, but that's not necessarily a bad thing. 
You already showed that LB has infinite bandwidth. A heterogeneous version is unlikely to change that.
Potentially a lot of coding for nothing.

> I am not sure what's the proper way to model this. Any hint is really appreciated.

You could implement the LB as parallel nodes, one workload per node. Under light traffic (short service times, such as you have) they're the same.
Then, you'd have 6 or so workload streams with each going through its own LB queue followed by going through its own Service node.

Another idea. Instead of trying to render reality in your PDQ model with 6 or work streams, try my rule of 3. 
Choose the 2 workloads whose queueing interaction you're really interested in and put everything else aggregated into the 3rd stream.
That tends to force you into thinking about what you are really trying to model.

To unsubscribe from this group and stop receiving emails from it, send an email to guerrilla-capacity-planning+unsub...@googlegroups.com.
To post to this group, send email to guerrilla-capacity-planning@googlegroups.com.
Visit this group at https://groups.google.com/group/guerrilla-capacity-planning.
For more options, visit https://groups.google.com/d/optout.

Radu Brumariu

unread,
Nov 28, 2017, 11:18:21 AM11/28/17
to guerrilla-cap...@googlegroups.com
Thanks, that clears a few things up. I was trying to model things too close to reality. I think I understand what I need to do going forward.
Thanks very much for the guidance.

To unsubscribe from this group and stop receiving emails from it, send an email to guerrilla-capacity-planning+unsubs...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Guerrilla Capacity Planning" group.
To unsubscribe from this group and stop receiving emails from it, send an email to guerrilla-capacity-planning+unsubs...@googlegroups.com.

DrQ

unread,
Nov 28, 2017, 11:36:14 AM11/28/17
to Guerrilla Capacity Planning
No worries. Realty (so called)  is a common trap that's easy to fall into. 

Remember, you're trying to model performance, not functionality. Although, they will bear some resemblance to one another. 
In general, the PDQ model will be vastly simpler (when done right) b/c all the unimportant functional details will have been 
pushed into the background---where they belong!

Never let reality get in the way of a good model. :-)

Correct me if I'm wrong but here's what I've got out of your efforts, so far.

The LB has infinite bandwidth. If it doesn't, you shoot the network guy (unless that's you) until it does. 
In that case, it's not going to have any significant impact on system performance so, ignore it.

What you're left with then is, the 6 or so "Services" that you're interested in. That's most likely where bottlenecks are going to form and degrade performance. 
You have 6 Services (PDQ nodes) and they each service their own type of workload (PDQ steam). They're independent of each other. You don't seem to have one PDQ node servicing more than one type of work steam (which BTW would be more interesting from a q-ing standpoint). 
Therefore, each PDQ node can be examined separately. That's more or less what you have now, I think.




On Tuesday, November 28, 2017 at 8:18:21 AM UTC-8, Radu Brumariu wrote:
Thanks, that clears a few things up. I was trying to model things too close to reality. I think I understand what I need to do going forward.
Thanks very much for the guidance.
To unsubscribe from this group and stop receiving emails from it, send an email to guerrilla-capacity-planning+unsub...@googlegroups.com.
To post to this group, send email to guerrilla-capacity-planning@googlegroups.com.
Visit this group at https://groups.google.com/group/guerrilla-capacity-planning.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Guerrilla Capacity Planning" group.
To unsubscribe from this group and stop receiving emails from it, send an email to guerrilla-capacity-planning+unsub...@googlegroups.com.
To post to this group, send email to guerrilla-capacity-planning@googlegroups.com.
Visit this group at https://groups.google.com/group/guerrilla-capacity-planning.
For more options, visit https://groups.google.com/d/optout.

DrQ

unread,
Dec 4, 2017, 12:23:46 AM12/4/17
to Guerrilla Capacity Planning
Something like this capability in PDQ wouldn't exactly go astray. :)


Reply all
Reply to author
Forward
0 new messages