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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

wmostrey’s picture

Status: Active » Postponed (maintainer needs more info)

The queries to Solr need to happen of course. It shouldn't normally take so long though. Do normal search request also take quite long?

lambic’s picture

Normal 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.

TravisCarden’s picture

Status: Postponed (maintainer needs more info) » Needs review
FileSize
538 bytes

apachesolr_attachments_remove_attachments_from_index(), called from apachesolr_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.

janusman’s picture

Version: 6.x-2.x-dev » 7.x-1.x-dev

Should be fixed in -1.x branches first. Switching version to 7.x-1.x. Probably needs a new patch as well.

janusman’s picture

Nick_vh’s picture

Issue summary: View changes
Status: Needs review » Fixed

Committed

  • Nick_vh committed 1ecfcee on 7.x-1.x authored by janusman
    Issue #1310136 by janusman, TravisCarden | lambic: Fixed hook_nodeapi is...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.