- Issue created by @mediabounds
- π©πͺGermany mkalkbrenner π©πͺ
Are you using the suggester? If not, you should turn it off in the Search API Server settings.
buildOnCommit slows down reindexing significantly. That's why it has been offloaded to cron. But you can increase the index timeout in the Search API Server settings.
- πΊπΈUnited States mediabounds
Yes, we do use suggester.
In our Search API server settings, we currently have the timeouts configured as follows:
- Query timeout: 5 seconds
- Index timeout: 10 seconds
- Optimize timeout: 10 seconds
- Finalize timeout: 30 secondsAs of 4.3.0, the addition of the
suggest.buildAll
query during cron is using the Query timeout. I would have to increase that to over 130 seconds to avoid an error during cron...but I don't want all queries to be given that long of a timeout, so that's a no-go.buildOnCommit
seems to be working fine in that I'm not seeing errors in the log and the suggester index seems to get updated. - π©πͺGermany mkalkbrenner π©πͺ
but I don't want all queries to be given that long of a timeout, so that's a no-go.
This is not correct. Queries use the "query timeout".
If building the suggester takes 130 seconds, then the "index timeout" has to be raised. Depending on your index' state and the concrete update query, every single update query could cause such a long running query if you "buildOnCommit".
Especially on large indexes, buildOnCommit behaves really bad. If you configured Solr to commit after 2000 docs, imagine how often the build will happen if you have millions of documents. You only have less than 100k documents and it already takes 130 seconds per build.But if you really want to, you can reactivate "buildOnCommit" via custom field configs or by subscribing to a config-set generation event.
I don't want to reactivate it in the module, not even optional.But I agree that we have an issue here, because we might exceed the max cron time. So the solution might be to trigger an asynchronous build and to introduce a config option about its frequency.
- π©πͺGermany mkalkbrenner π©πͺ
I'll try to build such an asynchronous option into Solarium.
- π©πͺGermany mkalkbrenner π©πͺ
- Status changed to Needs review
11 months ago 5:03pm 3 January 2024 - last update
11 months ago 31 pass - π©πͺGermany mkalkbrenner π©πͺ
Here's an experimental patch that leverages the PR for Solarium.
-
mkalkbrenner β
committed 324a7aed on 4.x
Issue #3409900 by mkalkbrenner, mediabounds: cron should not wait for...
-
mkalkbrenner β
committed 324a7aed on 4.x
- Status changed to Fixed
10 months ago 1:34pm 10 January 2024 - πΊπΈUnited States mediabounds
Thanks, mkalkbrenner!
I "backported" the patch so it applied to the current release of the module 4.3.1, updated Solarium, and disabled
buildOnCommit
in our index configuration. Cron appears to be working and there are no Solr errors in watchdog; it appears like the suggester is correctly getting rebuilt during cron if content changed since the last cron run. Automatically closed - issue fixed for 2 weeks with no activity.
- πΊπΈUnited States AaronBauman Philadelphia
@mediabounds can you post a patch that applies to 4.3.1?
- πΊπΈUnited States mediabounds
@AaronBauman -- absolutely, though I think it would be recommended to update to 4.3.2 of this module which has this issue addressed.
That being said, attached is the backported patch to apply to 4.3.1.
In addition to applying the patch, you will need to update the version of solarium to 6.3.5 (while the patch updates the referenced version in composer.json, you probably still need to do the update manually).
Also for good measure, you may need to go through your exported config and disable
buildOnCommit
. - πΊπΈUnited States AaronBauman Philadelphia
Thanks for the patch!
Unfortunately i'm stuck in D9, so updating to latest 4.3.2 is not an option. - πΊπΈUnited States neclimdul Houston, TX
for what its worth, this has likely triggered a bunch of noisy output from cron π buildAll command output durring cron runs. Active
- πΊπΈUnited States AaronBauman Philadelphia
Updated to search_api_solr 4.3.1 and solarium 6.3.5, and applied patch #15
Suggester is enabled, and buildOnCommit is offStill getting the timeout errors in logs, not sure what else to do.