pyroscope icon indicating copy to clipboard operation
pyroscope copied to clipboard

Profiling PHP-fpm

Open colin-redbox opened this issue 4 years ago • 1 comments

I would love to be able to accurately profile requests which are processed via PHP-FPM (in my case Magento). Essentially an opensource version of https://tideways.com/ (maybe https://github.com/tideways/php-xhprof-extension might help with this?)

I've had this working via the pyroscope 'attach' command and Docker setup but the way this profiles (all PHP operations are summarised over a time frame rather than associated to a specific request) is not suitable for my use-case.

colin-redbox avatar Sep 29 '21 08:09 colin-redbox

This is not trivial task, but it can be done with custom adapter for phpspy and pyroscope tags.

  1. Setup phpspy to gather traces.
  2. Use option --request-info=qcup to add uri, cookie and other info after each trace.
  3. Group traces by uri
  4. Make tags from uri
  5. Send traces with tags to pyroscope api.

We start implementing our custom phpspy->pyroscope adapter here: https://github.com/zoonru/pyrospy. But there is no uri grouping yet :(

xtrime-ru avatar Apr 29 '22 22:04 xtrime-ru