How to profile your PHP applications with Xdebug

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • Cloudways - Managed Cloud Hosting Platform
  • Scout APM - Less time debugging, more time building
  • SonarLint - Clean code begins in your IDE with SonarLint
  • clockwork

    Clockwork - php dev tools in your browser - server-side component

    Funny timing — I just spent 4 hours this morning comparing Xdebug, Blackfire, and New Relic.

    After feeling like my SaaS application is starting to hit some scaling bottlenecks, I had a play with all 3 services to try and get some insight for a real-world application.

    A brief summary:

    - Xdebug: Slow. Fiddly to set up. Fine for a development environment and day-to-day profiling, but things like Clockwork[0] are, practically speaking, far more insightful.

    - Blackfire: Terrible UX. Difficult setup process. Their free plan is almost impossible to evaluate as it only shows you glorified stack traces, most of which are littered with vendor and framework files. I didn’t want to commit to paying a full year of their standard plan (no monthly payment unless options, unless you go for the highest tiers), so I happily uninstalled and moved on.

    - New Relic: wow… one command and a server reboot later, and I’m seeing performance profiling, consolidated dashboards, error logging, MariaDB and Redis queries, frontend performance, and server capacities - with REAL data, on production! I’m very, very impressed. And it’s free for a single user…?!

    [0] Clockwork: https://underground.works/clockwork/

  • php-spx

    A simple & straight-to-the-point PHP profiling extension with its built-in web UI

    https://github.com/NoiseByNorthwest/php-spx

    SPX could be loaded with docker-compose like this article does for Xdebug. But if you already have a PHP environment, the easiest way to install it is to compile it (sudo apt install php-dev && make && cp modules/spx.so /usr/lib/php/....).

  • Cloudways

    Managed Cloud Hosting Platform. Cloudways leverages advanced technology and powerful servers. Cloudways is a one-click managed cloud hosting platform that provides cloud application and server management solutions.

  • enlive

    a selector-based (à la CSS) templating and transformation system for Clojure

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts