Profiling PHP-fpm
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.
This is not trivial task, but it can be done with custom adapter for phpspy and pyroscope tags.
- Setup phpspy to gather traces.
- Use option
--request-info=qcupto add uri, cookie and other info after each trace. - Group traces by uri
- Make tags from uri
- 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 :(