This article only covers Acquia’s Kubernetes version of Cloud Platform.
The Queue Time metric indicates the duration for which incoming requests to PHP/Drupal had to wait when all PHP workers in a webserver were busy. Queue Times larger than zero are a side effect of incoming requests to the application coming in at a higher rate than what the application’s available resources can handle without a wait.
Queue Time exists in Cloud Platform and Cloud Classic. However, the following explanation focuses on the Cloud Platform.
Cloud Platform provides a base number of PHP workers that are always available, usually 2 sets of 10 for production environments, and 1 set of 10 for non-production. If incoming web requests consistently use 40% or more of all the available workers, then we add another 10 workers (this is Auto-scaling, or scale up) until there are enough free workers.
Each set of these 10 PHP workers is known as a Drupal Pod. You can think of a pod as a virtual machine that runs services like Apache, PHP FPM, and mcrouter. The Drupal code of an application executes in this environment to serve web requests. Each incoming web request is assigned a random destination pod so it can be served.
Sometimes, the combination of incoming web requests, multiplied by the time the Drupal/PHP application can respond to them, causes pods to become completely busy as all PHP workers in the pod are processing previous requests. When this happens, a new incoming request is put into the Queue on that pod. The first request that is still in that Queue will then be served when the next PHP process becomes free.
For clarity, we can imagine a real-world scenario. Picture a bank with 10 tellers who are sitting idle, waiting for customers. If 10 customers come into the bank at the same time, they may need to wait in a queue (a line) for a small amount of time while they are assigned to their teller, and the queue becomes empty immediately. But if 50 customers come into the bank, this queue will grow, and they will need to wait. The time each customer had to wait in line before getting to a teller is known as their Queue Time.
Similarly, if a request is assigned to that pod’s PHP queue, under optimal conditions, it would wait around for very little time (a fraction of a second or even milliseconds). You can visualize the average queue time through the New Relic Application monitoring add-on included with your subscription.
However, sometimes certain extraordinary conditions or events could cause you to see queue times grow, sometimes uncontrollably: