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

October 19, 2020

Post

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

Profiling
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...
|
Announcement, Product
As you may have already heard from us back in December 2019, Instana has acquired StackImpact. During the last few months, we were working hard integrating StackImpact’s continuous profiling functionality to Instana,...
|

Start your FREE TRIAL today!

As the leading provider of Automatic Application Performance Monitoring (APM) solutions for microservices, Instana has developed the automatic monitoring and AI-based analysis DevOps needs to manage the performance of modern applications. Instana is the only APM solution that automatically discovers, maps and visualizes microservice applications without continuous additional engineering. Customers using Instana achieve operational excellence and deliver better software faster. Visit https://www.instana.com to learn more.