[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.programming

Here is the mathematical calculations of a queuing network

Ramine

3/15/2016 12:44:00 AM


Hello,


Here is the mathematical modeling of a queuing network that is
an ecommerce website and its calculations:

So, since the network of the those ecommerce websites
consist of queues interconnected in Tandem like this:

A -> M/G/c database servers queue -> M/M/1 Network queue -> M/M/1 Client
-> A

The characteristic of the M/M/1 Network queue is:

Download speed of 60 Mbps
Upload speed up to 30 Mbps; or 12 Mbps in certain areas

I have choosen this, look here:

http://affaires.videotron.com/web/small-medium-companies/internet-services/internet-access/fibre...

Upload speed of 30 Mbps is equal to 3.75 Mbytes per second.

The characteristic of the Client queue is:

Download speed of 10 Mbps
Upload speed up to 1.6 Mbps

Upload speed of 1.6 Mbps is equal to 200 Kbytes per second.

The mean size of the the files transfered is: 100 Kbytes

Adding the protocol overhead of 20% to the mean size of the files
gives 100 Kbytes * 120% = 120 Kbytes

And from the empirical tests on my harddisk , the service rates on each
server of
the M/M/c queue (c: is the number of servers) of the different database
transactions
of the ecommerce website such us read,write, delete is:

10266 read transactions per second

2053200 write transactions per second

3422 delete transactions per second.

and the percentage of the different transactions of the read,write and
delete,
is:

The read transactions are 70%

and the write transactions are 20%

and the delete transations are 10%

So the first moment that is the mean delay of the service of the M/G/c
queue of the database servers is:

M1 = 0.70 * (1/10266) + 0.20 * (1/2053200) + 0.10 * (1/3422)

so, M1 = 0. 0001

So the service rate of the each server in the M/G/c queue of the
database servers
queue is 10000 transactions per second.

And the service rate in the M/M/1 Network queue is: 32 transactions per
second

And the service rate in the M/M/1 Client queue is: 1.7 transactions per
second.

So now we have all the necessary numbers to do our calculation,
so since the Knee of the M/M/1 Client queue is at 50% so this
will give 1.7 transactions per second * 50% = 0.85 transactions
per second.

So here is all the network:

A -> M/G/c database servers queue -> M/M/1 Network queue -> M/M/1 Client
-> A


So the arrival rate A must not go beyond the Knee of the Client queue
that is 0.85 transactions per second , this is equal to 73440
transactions per day,
, and the mean waiting time of the overall Network of queues that is in
tandem
is equal to:

The mean waiting time of the M/M/c database servers queue is:

D = Phi^c / Mu*(1 - Phi^c) [2]

Phi: is the utilization
and Mu: is the the service rate in server queue.

Phi = U(Density of circulation) / c (number of servers in the M/M/c queue)

This is equal then to:

Phi = (0.85 / 10000) / c = 0.000085 /c , so let's take that c, the number
of database servers is 2, so, this is equal to 0.000085 /2 = 0.0000425

So, D = 0.0000425^2 / (10000*(1- 0.0000425^2)) = 0.0001 seconds

and the mean waiting time of the M/M/1 Network queue is:

D = (Phi/Mu) / (1- Phi)

and Phi = Lambda / Mu

Lambda is the arrival rate A

and Mu is the service rate of the M/M/1 queue.

this is equal to:

Phi = 0.85 / 32 = 0.0265625

D = (0.0265625/32) / (1-0.0265625) = 0.01 seconds.

and the mean waiting time of the M/M/1 Client queue is:

D = (Phi/Mu) / (1- Phi)

and Phi = Lambda / Mu

Lambda is the arrival rate A

and Mu is the service rate of the M/M/1 queue.

Phi = 0.85 / 1.7 = 0.5

D = (0.5/1.7) / (1-0.5) = 0.6 seconds.

So the overall waiting time in the Network is:

0.0001 seconds of the database servers queue + 0.01 seconds
of the Network queue + 0.6 seconds of the Client queue , so
the total waiting time of the queues in Tandem is equal to: 0.6 seconds.

So the calculations are good.


And here is my explanation of my previous post that
i have corrected more:

And here is how to do a simulation of the ecommerce websites:

You have to read and understand my previous post and
after that use my following simulation program of
an M/M/n queue:

https://sites.google.com/site/aminer68/m-m-n-queuing-model-simulation-with-obj...

use it to do your overall simulation of the ecommerce websites that
have read-mostly workloads, since many ecommerce websites have
read-mostly workloads, so the hyper-exponential service of the
M/G/c queue of the database servers queue above can be approximated with
an M/M/n queue when the writer and the delete transactions are
less or equal to 30% of the total transactions and the ecommerce website
has read-mostly workloads.

So, since the network of the those ecommerce websites are
interconnected in a serial manner like this:

A -> M/G/c database servers queue -> M/M/1 Network queue -> M/M/1 Client
-> A

The M in M/G/c means markovian distribution of the arrivals to the
M/G/c queue and the G in M/G/c is a general distribution of the service.

A is the arrival rate to the network of queues.

So you have to do your simulation using my above program
for each queue in the network and after than the calculation
for the waiting time and response time of the overall network of
queues are easy , because your have to add them in a serial
manner, since the network of queues are interconnected in
a serial manner.

And here is again my corrected mathematical modeling of
the above case of the ecommerce websites:

Here is my ecommerce websites mathematical queuing theory
modeling that is good approximation..

Here is the ecommerce website network organized as inter-connected
queues in serial manner:

A -> M/G/c database servers queue -> M/M/1 Network queue -> M/M/1 Client
-> A

The M in M/G/c means markovian distribution of the arrivals to the
M/G/c queue and the G in M/G/c is a general distribution of the service.

A is the arrival rate to the network of queues.

M/G/c database server has an hyper-exponential service, i think
that to not get into simulation, since many ecommerce websites
have read-mostly workloads, the hyper-exponential service of the
M/G/c queue of the database servers can be approximated with an
M/M/n queue when the writer and the delete transactions are less or
equal to 30% of the total transactions and the ecommerce website has
read-mostly workloads.

And now i will give you the mathematical equations of the M/G/c
queue that has an hyper-exponential service that permit us to
model a database server, here they are:

The mean that is the the mean time of the service of each server
of the M/G/c queue is:

M1 = p1/a + p2/b + p3/c [1]

and the second moment of each server is:

M2 = 2*p1/a^2 + 2*p2/b^2 + 2*p3/c^2

and the variance of each queue is:

variance = M2 - M1^2

a , b and c are the service rates of the different transactions
such us read,write, delete.

and p1 , p2 and p3 are the percentage of the transactions.

And when you calculate and get M1 you will then calculate the
mean service time that is 1/M1 and you will plug it on your M/M/c
queue that is an approximation of the M/G/n queue of the database
server that has an hyper-exponential service on read-mostly workloads,
using the arrival rate.

So for the M/M/c queue we have that:

A good approximation of waiting time of the M/M/c queue is:

D = Phi^c / Mu*(1 - Phi^c) [2]

Phi: is the utilization
and Mu: is the the service rate in server queue.

Phi = U(Density of circulation) / c (number of servers in the M/M/c queue)

U = Lambda / Mu

Lambda is the arrival rate A to the M/M/c queue

and Mu is the service rate of each server of the M/M/C queue.

And the response time of the M/M/c queue is:

R = D + 1/Mu

and the perceived throughput of the M/M/c queue that is Pt = 1/R

And the mean number of transactions on the system is:

Ns = Lamda*R

Lambda is the arrival rate to the M/M/c queue.

And the mean number of transactions on the M/M/c waiting queue is:

Nq = Lambda*D

So from the above equation [1] we get the service rate of each
server of the M/M/c queue of the database server that is: 1/M1

so we plug that in equation [2] of the M/M/c queue, so we get:

D = Phi^c / ((1/M1)*(1 - Phi^c))

So we get the response time of the M/M/c that is:

R = D + 1/(1/M1) => R = D + M1.

For the other M/M/1 queues of the Network queue and the client queue
we have the following equation:

The waiting time of M/M/1 queue is:

D = (Phi/Mu) / (1- Phi)

and Phi = Lambda / Mu

Lambda is the arrival rate A

and Mu is the service rate of the M/M/1 queue.

And you have to not forget that in the M/M/1 Network queue
you have a protocol overhead that is approximatly equal to 20%
so you have to multiply the mean size of the files to be transferred on
the M/M/1 Network queue by 120% and calculate after that the service
rate of the M/M/1 Network queue. And you have to not forget about the
Knee of the M/M/c queue of the database server that is equal to 74% and
the Knees of the other M/M/1 queues that is equal to 50%.

So since the queues of the ecommerce website to be modeled are organized
in a serial manner, so the calculations are easy now, so i will let you
do the calculations easily now.



Thank you,
Amine Moulay Ramdane.



1 Answer

Ramine

3/15/2016 9:07:00 PM

0


Hello,


The mean response time of the M/M/c database servers queue is:

R = D + 1/Mu = 0.0001 + 1/10000 = 0.0002 second

And the mean reponse time of the M/M/1 Network queue is:

R = D + 1/Mu = 0.01 + 1/32 = 0.04125 second

And the mean reponse time of the M/M/1 Client queue is:

R = D + 1/1.7 = 0.6 + 1/1.7 = 1.2 seconds

So the totall mean response time of the Network is:

0.0002 second of the database servers queue + 0.041 second
of the Network queue + 1.2 second of the Client queue , so
the total mean response time of the network of queues in Tandem
is equal to: 1.241 seconds.


Thank you,
Amine Moulay Ramdane.