Layers
Tideways categorizes the time spent processing a request into separate layers, also called downstream layers. These layers broadly refer to various types of external services the application relies on and to other environment-specific constraints that are outside of the application’s control. These layers allow to quickly narrow down performance issues to a specific part of the logic, particularly when the time spent on a given layer suddenly increases.
Each point in time during execution is uniquely assigned to the outermost layer, representing the operation on a high level. As an example, the time spent sending an email using a HTTP API will be assigned to the “email” layer rather than the “HTTP” layer and session operations will be assigned to the “session” layer rather than any driver-specific layer (such as Redis, SQL, or File I/O).
Many layers have corresponding spans in the Timeline.
Available Layers
Layer |
Description |
SQL |
Time spent executing SQL queries against an RDBMS such as MySQL, PostgreSQL, SQLite, or Microsoft SQL Server. |
HTTP |
Time spent performing HTTP calls. This includes protocols that use HTTP as a transport, such as XMLRPC or SOAP. |
Elasticsearch |
Time spent performing Elasticsearch or OpenSearch operations. Only detected when using the official SDKs. Will be accounted as HTTP otherwise. |
APCu |
Time spent interacting with APCu. |
Cache |
Time spent communicating with Memcached. |
Redis |
Time spent communicating with Redis. |
MongoDB |
Time spent communicating with MongoDB. |
Queue |
Time spent queuing messages, for example using Kafka, AMQP, or Beanstalkd. |
Shell |
Time spent executing child processes. |
Time spent sending emails. |
|
DNS |
Time spent performing DNS lookups. |
Sleep |
Time explicitly spent sleeping. Time spent waiting for a blocking (network) operation to finish is not included. |
Session |
Time spent interacting with a session store, such as loading or saving a session. |
File I/O |
Time spent reading or writing files on a local disk. |
Autoloading |
Time spent in PHP’s class autoloader. |
Compiling |
Time spent parsing and compiling PHP files. For modern applications this layer is likely to only appear when using PHP files as a cache, since the application code itself is loaded via the class autoloader and accounted to the Autoloading layer. |
Garbage Collection |
Time spent running the Garbage Collector. |
Related Metrics
Besides layers, which Tideways can uniquely assign to a given point in time, Tideways also tracks some related metrics, which can only be measured across the whole execution of a script and might happen during the execution of any of the layers.
Metric |
Description |
Waiting for CPU |
The time the PHP process spent waiting for the operating system’s scheduler to free up a CPU core to continue processing the request. If the majority of traces indicate that they were waiting for the CPU, this is an indication of insufficient CPU resources being available. |
Non-CPU Time / Unaccounted Wait |
Any remaining time the process spent waiting that cannot be explained by any of the previously defined layers and metrics. This includes network operations using unknown protocols or SDKs. More Details. |