[Solved] Fatal Error on Network Activate (Multisite with approximately 7700 blogs)
I manage a Wordpress 5.7.2 installation on an internal corporate network. We are running multisite and have about 7700 blogs. When attempting to Network Activate wpDiscuz, it processes a chunk of sites and then experiences a fatal error. No other information is dumped to the screen for Wordpress.
When looking at the tables that were added, we noticed the first attempt to activate had about 695 blogs that were processed. The second time we tried to network activate, while watching transactions at the mariadb we noticed that it iterated through the initial ~695 blogs with various "show tables like" queries and we watched it increment through the list. Once it got to the next blog that hadn't been processed, it started creating tables again. The second run died after a total of 1,293 were complete (~600 new blogs processed). Third iteration died around 1,860 total. The fourth iteration is currently running but took about 23 minutes to count through the 1,860 that were already done and then appears to have picked up where the previous run left off.
All indications are that because of the size of our multisite collection, that something is timing out. I just don't know what. Between iterations 2 and 3, I edited the .htaccess file to add the following line:
php_value maximum_execution_time 3600
The idea was to give ample time for the Network Activate task to complete. Unfortunately, it doesn't appear to have made any difference. Unfortunately, for DLP reasons, I'm unable to send any screenshots or log files but if I know what to look for, I'm happy to comb through logs and try to find relevant information that I can hand-jam into a reply message.
Any ideas on where to look or what timeout values to try to increase would be greatly appreciated.
Okay... so I think we found a solution. A combination of the .htaccess change above and deactivating the WPMU Plugin Stats plugin seems to have yielded the magic necessary. The current run (#4 detailed above) is still running over 2 hours later and based on activity that we're seeing at the mariadb level, looks like it is creating tables for blog_id 3697. which is roughly the same number that my first 3 iterations were able to complete before it crashed.
I wanted to make sure that I provided an update so that nobody is spinning wheels trying to Offer possible solutions. I'll provide a final update once the plugin activation completes.