Now to generalize my mathematical model and make it more clear,
if we are running n threads in parallel in a time interval and entering
n critical sections in the same time interval, my mathematical model
will be equal to:
Speed(t,N,,Sic,Soc) = 1 / (A + (P / N))
A = ((Sic_1 * ((_1-1) * (_1)) / (2 * _1)) + (Sic_2 * ((_2-1)
* (_2)) / (2 * _2)) + .... (Sic_n * ((_n-1) * (_n)) / (2 * _n)))/N
A = (Sum (i: 1 ->n ) (Sic_n * ((_n-1) * (_n)) / (2 * _n)))) / N
Sic_1...Sic_n: serial parts inside the critical regions(locked regions)
P: parallel part
n: number of threads (or processes)
N: number of cores
C_1...C_n: contention factors in percentage for each crtitical region
C = Number of contended threads (in the critical region) / n
and = C * n
I wrote in my other article:
"So, as you have noticed you can simulate our enterprise
webserver with this mathematical analytical equation and
validate the data collected by fwptt stress webserrer tool
and try to keep T( the average response time of your HTTP requests)
bellow or equal to 5 seconds, and see also if your webserver
is scaling, and we call this also Quality control using OR
(operational research). "
So, if you want to keep the response time T 'low' in enterprise
websites, you have to reduce the logical and physical contention
can occur by reducing the Sic_1...Sic_n (i already explained how to do it)
and you must also control the by limiting for example the 'number'
of requests that can run at the same time and also scale out your
My general scalability mathematical model is also applicable to physical
contention and logical contention.
Amine Moulay Ramdane.