Over the past few weeks the Dynatrace Ruxit team has run an early-access program for PHP deep monitoring for Apache and PHP FPM. It’s now time to release the beta version of Dynatrace Ruxit PHP monitoring support to the public.

Beginning with Dynatrace Ruxit Agent, v1.79, PHP monitoring can be manually enabled either for all or individual hosts. To enable PHP monitoring for all hosts in your environment:

  1. Confirm that you’re running a version of Ruxit Agent no older than v1.79.
  2. Go to Settings > Monitored technologies.
  3. Set the PHP slider to the On position.
    PHP deep monitoring
  4. To enable detection and monitoring of PHP services, you must perform a complete restart of your Apache instances that run PHP and your FPM processes.

To enable PHP monitoring for individual hosts:

  1. Confirm that you’re running a version of Ruxit Agent no older than v1.79.
  2. From the Dynatrace Ruxit homepage, click the Hosts tile.
  3. Select the host you want to configure.
  4. Click Edit on the menu bar.
  5. Set the PHP slider to the On position.
    PHP deep monitoring

What you get with PHP deep monitoring

Once you restart the Apache web server that runs PHP, select your Web Request service for analysis in Ruxit. Once the service receives a PHP request, you’ll see a small PHP logo appear next to the Apache logo. Depending on what your PHP code does, once PHP monitoring is successfully enabled, you may also notice that your Apache Web request service now calls databases and/or other services that are called from within PHP.

PHP deep monitoring

Now select a PHP request from the Top web requests list. Then click the View response time hotspots button on the following page.

PHP deep monitoring

PHP response time analysis

Notice that database requests are now visible. Every SQL statement executed from within PHP is tracked, just as they are for Java, .NET, and Node.js. If your PHP code makes HTTP requests to other systems, you’ll see those as well.

PHP deep monitoring

Further down the page in the Breakdown of service execution time section Dynatrace Ruxit shows you how much time Apache spends processing the selected request. Besides showing you Apache module times, Dynatrace Ruxit also tells you how much Total execution time and CPU time your application spent compiling PHP files for this request. Click the PHP compilation entry to view any hotspots that were encountered in compiling the files. Such information can help you tune your caches and ensure that PHP compilation time doesn’t slow down your web page.

PHP deep monitoring

Dynatrace Ruxit also tells you how much Total execution time and CPU time your PHP database interactions take. Click the Database activity entry to view database method-level details.

PHP deep monitoring

PHP CPU hot spot analysis

Another thing that’s new is CPU hotspot analysis for PHP and Apache requests. When you see a CPU intensive requests finding on a service page it means that Dynatrace Ruxit has determined that a request is consuming considerably more CPU then other requests. Click any CPU intensive requests entry to view that request’s CPU consumption chart. You can in fact view a CPU consumption chart for any request: Just click Show all requests and select the request you’re interested in.

PHP deep monitoring PHP deep monitoring

PHP deep monitoring

What’s new is that Dynatrace Ruxit now provides CPU hotspot analysis for Apache web request monitoring, which includes PHP. Click the View method hotspots button to view the analysis.

PHP deep monitoring

Hotspots analysis immediately shows you where a request consumes CPU: Apache internals, PHP compilation, or PHP execution.

Dynatrace Ruxit database support

Dynatrace Ruxit currently supports the following databases in PHP:

  • Oracle
  • PostgreSQL
  • MySQL/MariaDB (via mysql and mysqli drivers)
  • All databases from PDO drivers

What about FPM and Nginx?

Dynatrace Ruxit automatically injects into FPM and fully supports Nginx/FPM and other FPM setups. Dynatrace Ruxit automatically tracks all calls from your Nginx to specific FPM pools.

PHP deep monitoring

Each FPM pool is its own service. In the example below, the pool’s name is www. The pool hosts a Magento store. Dynatrace Ruxit automatically discovers all requests and also identifies the most CPU-intensive and slowest requests

PHP deep monitoring

You can analyze the Response time and CPU consumption of individual requests. To view response time hotspots and understand what makes specific requests slow or resource intensive, click the View response time hotspots button.

PHP deep monitoring

PHP deep monitoring

Supported environments

Dynatrace Ruxit supports PHP 5.3 and above on Linux platforms. Dynatrace Ruxit supports FPM and mod_php in Apache.

Dynatrace Ruxit currently doesn’t support the older fast-cgi in Apache, but we will add this support soon.

Known Issues

  • Automatic monitoring doesn’t currently work unless a php.ini is defined. Simply creating a default php.ini file works to solve this problem.