We have a toolset post type with a very large number of records that has recently started to cause problems on the site. There are roughly 110,000 records of this post type.
The site front-end works fine. Views and searches of that content type work fine.
We're stuck when editing a Basic Page (or any content item) in the Divi editor. At the most basic level, when creating a new blank page, then loading the Divi editor (classic editor), we receive an AJAX 500 error. This error prevents the loading of custom divi templates, which is a problem for our client.
Web log error message:
AH01071: Got error 'PHP message: PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 20480 bytes) in /var/www/docroot/wp-includes/wp-db.php on line 1889\n', referer: hidden link
That error is a test on a local instance with 256mb of memory allocated. The live site is running over 700mb of memory and still has the issue.
Disabling the content type with 110,000+ records see the error disappear, and library template layouts load normally again.
By deleting 100,000 of the records (left with around 10,000), the issue goes away. This doesn't really help us as we need all of those records.
It seems like some type of query is touching on that very large set of custom posts, even though we're working on a basic page.
Hi, I can try running a script to generate some custom posts programmatically to replicate this setup. In the meantime, can you run some tests as well?
- Temporarily deactivate all plugins except Types and Views, then activate the parent Divi theme. Test again. If the problem is resolved, reactivate your child theme and other plugins one by one until the problem returns. Try to isolate a single source of conflict.
- If limiting plugin and theme conflicts doesn't solve the problem, create a backup of the current local database. Then modify the post type slug of all these custom posts to be "post". Deactivate all Toolset plugins and try again. This should help determine whether the problem is Toolset-specific.
Let me know what you find out and I will update you tomorrow with some findings of my tests.
It turns out that I was able to reproduce a similar problem in the Divi Builder without any Toolset plugins active. I created about 105k Posts (native WordPress posts), and attempted to edit one of the posts using Divi Builder. When I tried to save the update, a Fatal error was triggered. So I think the issue should be addressed with the Divi support team, since Toolset isn't directly involved in this case.
Thank you! Hadn't considered that possibility. We'll tackle the Divi angle ourselves.