An Approach to Studying Probabilistic Characteristics, Using a Real Product as an Example

Ilya Usov1 Aug 2023

Problem

MTS runs SunkeyToolkit, a service for remote testing of mobile apps on a farm of more than 300 phones. Users book phones and stream them from a browser. The team wants to know how loaded the machines behind them are: how many requests wait on average, and how often the system is idle. Load varies by hour. Most of it falls in working hours, and at night there are noticeably fewer tests and streams.

Example from the article: a deliberately simple system of two nodes with no breakdowns or repairs, modeled over 8 working hours.

Solution in brief

Model the machines as a queueing system with time-dependent arrival rate λ(t) and service rate μ(t). For the M/M/2 model the state probabilities follow the forward Kolmogorov equations, a system of ordinary differential equations. Solve it numerically from an initial state and read off the probability of an empty queue and the mean number of requests over time.

Questions this case answers
  • How to forecast the expected queue length and the probability of an empty queue over a day for a small pool of servers when arrival and service rates change with time of day
  • How to forecast the average number of waiting requests on a shared pool of machines over a working day?
  • How to estimate the probability that a service has no queue at a given hour when load varies during the day?
  • How to model machine load with time-dependent arrival and service rates instead of a steady-state formula?

Tools and methods

  • M/M/2 queueing model — two servers with random arrivals and service, rates changing in time
  • Forward Kolmogorov system — ODEs for the probability of each queue length
  • SciPy solve_ivp (RK45) — numerical solution with tight tolerances
  • NumPy, Matplotlib — state vector handling and plots
Continue reading — it's free

Google or a one-time email code. No password.