# Re: Queueing Theory in Oracle

From: Николаев Андрей Серапионович <Andrey.Nikolaev_at_rdtex.ru>
Date: Sun, 16 Mar 2014 19:51:48 +0400 (MSK)
Message-ID: <4029.37.1.39.225.1394985108.squirrel_at_webmail.rdtex.ru>

Hello!
>I am asking if anyone has successfully used queuing theory in Oracle ...

This is very interesting and still developing research area. Typically, the Oracle database internal algorithms are much more complex then the standard QT models.

In my opinion, the QT provides us with phenomenological background about the observables (utilization, arrival rate, queue length, wait time, service demand ...) and their interdependences (Little's Law, (1-u)^-1 behavior, ...)

This result in the phenomenological rules such as: Amdahl's law, Universal Scaling law by Neil Gunther, "Magic of 2" by Cary Millsap, ... All the above allows the performance capacity planning and predicting.

In addition to previously discussed in this thread the classical books by Cary Millsap, Craig Shallahammer, and the Hotsos presentations by Henry Poras, I would like to recommend the inspiring books by Dr. Neil Gunther.

>I guess to use M/M/n we just have to assume certain database metrics are
>exponentially distributed such as ...
>If not we arent suppose to use queueing theory because it is based on
>exponentially distributed data.

Unless you encounter a heavy tailed distribution, the Law of large numbers is on your side.
Approximate G/G/n formulas show behaviors close to the corresponding M/M/n formulas and generally differ only by multipliers. Therefore, you can use M/M/n expressions for estimations.

However, Dr. Neil Gunther at Hotsos 2012 demonstrated that the heavy tailed distributions and the "fractal behavior" do exist in Oracle world. Such cases require more complicated treatment.

>Maybe some wait events about latches/mutex/... can be seen as pure
QueueTime...

Despite the classical QT works well for estimations, the detailed investigation of the queuing properties for even the simplest Oracle objects, such as mutexes is more complicated.

For example, the "wait" in Oracle has the different meaning then wait in Queuing Theory. Even the "average wait time" has another definition.

Some time ago, I presented about Oracle mutexes and the corresponding queuing models.
If you are interesting, you can find the article at http://arxiv.org/abs/1212.6640
```--