Bug #6731: Out-of-control queries on production server
GES resulting in infinite loop
In response to recent server problems, I've written a diagnostic tool that sends me a notification any time a WP request exceeds 200 database queries. (Some interesting discoveries!!) The reasoning is that the performance problems seem like they're due to a script that is improperly querying the database too much - like a bad loop.
I found some GES behavior that is a bit wonky, and was hoping I could get Ray's eyes on it. A log file is attached (see the query list at the end). A lot of what's happening here is just the result of uncached queries - an independent issue. But, without completely understanding what's happening, there seems to be too much back-and-forth between GES and bp_get_email(). There's a bunch of hooking and unhooking in ass_send_email() - is it possible that there's a load-order issue, so that something that ought to be unhooked isn't getting unhooked in time?
I'm going to continue diagnosing myself, but I wanted to get this in front of you as soon as I could, because you might be able to see something that's not obvious to me.
#1 Updated by Raymond Hoh over 2 years ago
Since we now add the GES email content during upgrade, I think I might be able to remove the runtime
term_exists() check in GES to remove some of the DB queries.
#2 Updated by Boone Gorges over 2 years ago
Yeah, that's a good point. It will help.
On review, I don't think that what's in this log is really an infinite loop. There may be some inefficiencies, though, and it would make sense if it were connected to the BP 2.5 email migration. So please continue to think it over from your end :-D
#3 Updated by Raymond Hoh over 2 years ago
Also, when I looked at this a few weeks ago, I remember seeing the BP deprecated email filters firing a lot during the email sendout runtime. Maybe we can disable them? If not, we can post a ticket upstream.
Perhaps we can use
BP_IGNORE_DEPRECATED? I know there were some issues in BP 2.7.x with this, but maybe it's worth giving it a shot on cdev?
#6 Updated by Raymond Hoh over 2 years ago
The taxonomy type check has been removed during email sendouts.
Still need to look into disabling the email filters. I think I might try a more, cautious approach, rather than turning off all BP deprecated code.