Problem with Little's law

605 Views Asked by At

I am estimating number of threads required by my server to execute clients requests efficiently and initially I starts 4 threads on the server.Request arrival rate on my server is 4 request/sec and each request takes fixed amount of time to complete with following time descriptions. The arrival rate is fixed and all new request arrivals have fixed service time.

$$ \text{Request}_1 = 0.2 \text{ sec}\quad \text{Request}_2 = 0.9 \text{ sec}\quad \text{Request}_3 = 0.6 \text{ sec}\quad \text{Request}_4 = 0.5 \text{ sec} $$

Request arrival rate is 4. Since each request would be assigned to each thread so no waits are there so Average Response time is $(0.2+0.9+0.6+0.5)/4= 0.55$

Applying Little's law to estimate required threads on server to serve requests is now as follows

$$ \begin{align} \text{Required threads on server } &= \text{Request arrival rate } * \text{ average response time} \\ &= 4*(0.55) \\ &= 2.2 \end{align} $$

That is there should be 2 threads only for request arrivals of 4 req/sec with given service times, and in this case any 2 requests must wait on each cycle of arrivals because we have only 2 resources (threads) and arrival rate is 4 requests/sec. So any 2 requests must wait and this results in increased response time. kindly help me in this regard. Am I doing calculations right? Why is Little's law is not suited for scenarios having service times less than 1 seconds?