phpsymfonyxhprof

xhprof not working for php rabbitmq consumers


I have rabbitmq consumers written in php with symfony2-framework, and I'm trying to see the inner workings and issues of the system with xhprof. Problem is that it's not saving anything into the mongodb. Mongo is totally empty.

I've tried to set the auto_prepend_file(which adds the necessary header-file) in php.ini, the applications .htaccess -file, and the apaches virtual hosts.

I set the profiler to profile every request and it profiles everything else just fine, eeexcept the rabbitmq-consumers running in the background. But why not?

For instance, I called phpinfo.php -file and it profiled it perfectly, but not the consumers, nope.


Solution

  • Xhprof profiles the data when the script exists which is kinda never for the rabbitmq consumers, since they are processes running in the background.

    So: One solution would be to add the appropriate begin and exit -codes from the header-file in to the scripts that are running, but this is way too much trouble for me.

    I ended up using PHP's own XDebug with visualizing tool: Webgrind.