-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Honour disabling yourself when disabled in the Wordpress dashboard #2
Comments
So they had deactivated the plugin but left wptop_enable() on? I think adding the http://codex.wordpress.org/Function_Reference/is_plugin_active check and suppress enable/disable would work in honour of disabling the plugin. |
That's exactly what they'd done, so it was causing pretty hellish problems. They were surprised that it was still running "but we disabled that weeks ago!?", and told me categorically that they had no profiling plugins running. The smoking gun was that I couldn't actually Long story short, no data was being logged, and we found |
Thanks. Acknowledged and will fix later today. How detrimental would you say the plugin was to application performance? |
Setup was 7 servers, 5 responsible for web. 8 cores (3.+ghz 64bit intel), 12Gb of RAM and all SSDs… the following script was enoguh to cripple the site with the plugin enabled:
The result was a near instant failure of PHP-FPM, since when being traced the worker processes don't seem to respond to signals. A single request would respond fairly quickly, 45-50sec, with the plugin disabled, we're closer to 3-4 sec response times now which is as good as we can get (they have ~40-50 WP plugins, including some large ones line buddy press and LMS, which we are still trying to tune). With I'll point out whilst I'm here too that although they were using SSDs, they had a bind-mount of a remote NFS over the webroot, which causes things that should be fast like |
Interesting. Was /tmp/ mounted over NFS as well? |
|
Oh, just realized, that wouldn't matter; all profiles are stored in the database, not the flat filesystem. Also looking at the code I realize that since
So what sort of failure? Did they freeze? Segfault? And what sort of signals were being sent. It's quite surprising to see XHProf, a production-target profiler, fail so miserably. |
Hard to say, they locked up, essentially, but without ever It seems however that because they never enter state The interesting thing is that it was like a live-lock, the CPU and RAM were essentially idle and empty, and it was impossible to strace or measure the processes because of the Also processes that never sleep don't always respond well to signals, as signals are buffered in the kernel, so if our processes were slowing down because of too many profiling signals the might be failing to drain the queue fast enough to respond to signal handlers for hard-timeouts, and other PHP-FPM pool management signals |
Indeed, I noticed this too, and of course that makes sense, since loading Wordpress itself has a cost, and that cost is an important part of deciding how to configure something like an object cache or APC. In your shoes I might be tempted to set a variable (global? eek.) somewhere in Or, perhaps it's enoguh to fix the documentation in the wordpres admin UI that the plugin is only the report viewer, but that profiling will happen regardless as long as the "# Installation" guidelines were followed, as that exists before the WP context is up. |
I'll think about adding a message upon plugin deactivation to remind people to remove the enable scaffolding. I wonder whether the problem lies in not running xhprof_disable. Or were the same issues observed with the plugin active? |
We didn't enable the plugin again, but that's a valid point, if it's never stopped, where does the trace log go, if anywhere? |
I'm guessing traces should be kept in memory of XHProf internally (I'd have to look at their source code later today), but who knows what happens to them if they're not stopped/dumped, especially in a static worker setup, maybe it keeps accumulating allocating heap for each request and never freeing it up. Will know more in a couple of hours after having a chance to look at XHProf closely. |
Cool: note the static change I made was mostly so that I could |
Perhaps a saner installation option might be to recommend that profiling runs on ~1% of requets…
|
I recently had to fix a customer machine where they'd been running all their web requests with full profiling enabled (
wptop_enable()
) . That's really more their problem from oversight in development/ops than it is a problem of the plugins.Perhaps you could raise a fatal error if profiling is started, but the plugin is disabled, I'm not sure.
I'm actually not a Wordpress or PHP developer, just a guy who got lucky solving someone's server hosting hell for them.
The text was updated successfully, but these errors were encountered: