Reduce Time Spent Troubleshooting PHP Applications with Continuous CPU Profiling in Production

October 19, 2020


PHP profiling is used by developers to identify performance issues or bottlenecks in their code. Profilers enable developers to drill into individual lines of code to ascertain which ones are running slow or are resource intensive. There are several reasons why a program might consume more CPU resources than it is expected to. To troubleshoot and/or optimize a PHP application’s consumption of CPU resources, a PHP CPU profiler is necessary. Without it, it would take a lot of guesswork, recreations of issues, code modifications, and diagnostics to localize the hot spots. In other words, it would be extremely difficult to find the specific lines of code where the majority of CPU is being used.

Profiling PHP applications in dev

Traditionally, profiling for PHP applications has been done in development environments due to the high level of overhead typically associated with their use. However, this approach of relegating profiling to development environments is not suitable for modern cloud-native environments. The more complex application environments become, the more difficult it is to maintain parity between development and production environments. If you’re trying to troubleshoot an issue by recreating it in development, you’ll need a development environment that has the same load, configuration, and infrastructure, just to name a few. This is not a sustainable approach when dealing with the ever changing nature of cloud-native, microservices based environments.

Additionally, it is important to understand how applications are constantly running in production, in order to know the dynamics of the hot spots with associated historical context (e.g. an application release version, runtime version or other metrics). In other words, it is important to understand when the problem started and why the problem started. This is simply not possible in a dev environment.

Using Instana AutoProfile™ for continuous production profiling

Instana’s always-on PHP profiler is designed for profiling and monitoring production environments. Instana AutoProfile automatically attaches itself to the running processes with no restarts or reconfiguration required. Users are able to continuously analyze code-level performance, quickly discover bottlenecks, visualize performance, and dig deep into the applications ‘hot paths’, in production. Instana AutoProfile, which is initialized in the application, records and reports regular CPU profiles to the Dashboard.

Word Image 298

Instana AutoProfile for PHP collects a codepath capture for every request, no sampling. Each codepath capture is aggregated into a profile every 2 minutes which includes every invocation that was captured.

Get started troubleshooting your PHP bottlenecks today

Stop trying to recreate production issues in dev environments. Get started optimizing your PHP applications with Instana’s always on PHP production profiler in your Instana instance today. If you don’t already have an Instana instance, check out PHP Profiling with a free trial instance now. Once you see the power of profiling PHP applications in production, you’ll wonder why profiling was relegated to development environments to begin with.

Play with Instana’s APM Observability Sandbox

Announcement, Conceptual, Developer, Engineering, Product
According to AWS: “[Graviton2 is] custom built by Amazon Web Services using 64-bit Arm Neoverse cores to deliver the best price performance for your cloud workloads running in Amazon EC2” At Instana...
There are multiple reasons why a program will consume more CPU resources than excepted. In the case of a high computational complexity of an algorithm, the amount of data it operates on...
Developer, Engineering, Product
Laravel is one of the most beloved web framework for PHP. It was developed as an alternative to CodeIgniter and today is the most popular PHP project on GitHub based on the...

Start your FREE TRIAL today!

Instana, an IBM company, provides an Enterprise Observability Platform with automated application monitoring capabilities to businesses operating complex, modern, cloud-native applications no matter where they reside – on-premises or in public and private clouds, including mobile devices or IBM Z.

Control hybrid modern applications with Instana’s AI-powered discovery of deep contextual dependencies inside hybrid applications. Instana also gives visibility into development pipelines to help enable closed-loop DevOps automation.

This provides actionable feedback needed for clients as they to optimize application performance, enable innovation and mitigate risk, helping Dev+Ops add value and efficiency to software delivery pipelines while meeting their service and business level objectives.

For further information, please visit