Using Xdebug to profile PHP on pfSense
-
I'm trying to get a handle on what's causing my slow dashboard load times. See post.
Was wondering about using Xdebug to do some profiling of the PHP execution. Is that still possible with the latest snapshots? I do remember playing around with it circa 2018 and getting it hooked up via VSCode extension, but it's been a while.
I see https://docs.netgate.com/pfsense/en/latest/development/additional-php-modules.html mentions it but doesn't have much detail on usage.
-
-
We used to include the xdebug module but we dropped it in ~2018 because it failed to build with the PHP version we were upgrading to. We never looked into it again after since nobody seemed to care and it was extra technical debt we didn't want to keep carrying.
-
@jimp Ok, that's what I thought. How do you guys debug performance then? Is there another way? Or can the module be compiled on another FreeBSD system and then copied over?
-
I'm not sure what the other devs do there. I rarely dig into those kinds of problems, though in some cases it's fairly obvious if you watch the network pane on the browser debug as it requests/receives data and you can see which things take longer to come back.
-
@jimp Nope all I get is 1 giant bar for the initial pageload, so no real insight on the debug console. E.g.
Unless you think there's a reason why it definitely won't work, I guess I can try my other idea of compiling the module(s) on another FreeBSD 12.3 system and moving them over.
-
If it compiles against the same version of PHP it should be OK. At the time it was removed it was broken and I'm not sure if anyone fixed it, but give it a shot. Maybe upstream did something different in the meantime it has been a few years.