Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Running a batch API process, I discovered that node_delete was being very slow.
I tracked this down to the call to apachesolr_attachments_nodeapi, and further to the $solr->commit in apachesolr_attachments_remove_attachments_from_index().
Is there any way to speed this up? It's currently taking 1-3 seconds.
Comment | File | Size | Author |
---|---|---|---|
#5 | apachesolr_attachments-remove-commit-131013-5.patch | 1.35 KB | janusman |
#3 | apachesolr_attachments-hook_nodeapi-slow-1310136-3.patch | 538 bytes | TravisCarden |
Comments
Comment #1
wmostrey CreditAttribution: wmostrey commentedThe queries to Solr need to happen of course. It shouldn't normally take so long though. Do normal search request also take quite long?
Comment #2
lambic CreditAttribution: lambic commentedNormal queries seem fine. We are in the process of tuning our solr installation so that might improve things, but commits are the slowest operation that solr does, so maybe they should be deferred where possible.
Comment #3
TravisCarden CreditAttribution: TravisCarden commentedapachesolr_attachments_remove_attachments_from_index()
, called fromapachesolr_attachments_nodeapi()
, invokes a Solr commit—an expensive, long-running operation which should not be waited on during a node save, and which according to Acquia, Solr runs automatically every few minutes anyway. Acquia recommends removing the operation as in the attached patch.Comment #4
janusman CreditAttribution: janusman commentedShould be fixed in -1.x branches first. Switching version to 7.x-1.x. Probably needs a new patch as well.
Comment #5
janusman CreditAttribution: janusman commentedNew patch.
Comment #6
Nick_vhCommitted