Search indexing can bog down and cause cron to fail when indexing using the default settings, especially on sites that are heavy on HTML code in the front end. For example, on a site with a lot of complex data tables (i.e. tons of markup to display a bunch of numbers), cron was failing due to search timing out. This led to "attempting to re-run cron" errors. HTML filter is the likely cause; we just turned it on for full page override searches recently.
There are a few things that can be adjusted in the Panopoly Search feature settings to improve indexing performance. First, Drupal core search is still indexing content 100 nodes at a time per cron run. This is unnecessary. And second, the default setting for Search API has it doing 50 nodes at a time per cron run. Aside from initial indexing of a new site (which can be done in the UI), 20 per cron run should be sufficient for most purposes.
Patch forthcoming.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | panopoly-search-index-performance-2565175-6.patch | 2.99 KB | cboyden |
| #6 | interdiff-2-6.txt | 1.38 KB | cboyden |
| #3 | interdiff-1-2.txt | 1.75 KB | cboyden |
Comments
Comment #2
cboyden commentedPatch is attached. It sets the core search_cron_limit variable to 10 (the lowest number available in the UI), and the Search API cron_limit option to 20 - unless the cron_limit option already differs from the previous default of 50.
Comment #3
cboyden commentedUpdated patch adds core search_cron_limit variable to strongarm.
Comment #4
dsnopekThanks!
Only one small piece of review:
We should wrap this code in a check for
module_exists('search_api')because per #2555385: Check that module is enabled in update hooks this (and the search_api module) could be disabled. If the module was re-enabled later, then Features should revert and make the change for us.Comment #5
dsnopekI just manually tested the upgrade, and it works for me!
And here is the Travis build for this patch:
https://travis-ci.org/panopoly/panopoly/builds/79479448
Assuming that passes, and the fix from #4 is made, then this should be ready to commit. :-)
Comment #6
cboyden commentedUpdated patch and interdiff are attached. I thought we might put the variable_set inside the module_exists as well - if Search API is not enabled, the site might be using core search and we shouldn't change its settings.
Comment #7
dsnopekSounds good to me! Did some quick testing on the latest patch, and everything looked good. Committed, thanks! :-)