Closed Bug 749696 Opened 13 years ago Closed 13 years ago

Elasticsearch churn

Categories

(addons.mozilla.org Graveyard :: Code Quality, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
2012-10-04

People

(Reporter: robhudson, Assigned: andy+bugzilla)

Details

While looking at logs there seems to be a lot of ES indexing calls for the same add-on within seconds of each other. These would then get sent to ES for indexing repeatedly. The cause is the indexing task is spawned when the add-on is saved, which can happen multiple times in a single request/response cycle. We really only need the final save()'s index to happen, but this is easy to say and hard to do. All of this may be fine, but it may cause unnecessary churn in Elasticsearch. This is especially evident in our tests. We could remove the post_save signal, but putting an index call where we need it would be difficult. Another option I've found is to use the Celery batches: http://ask.github.com/celery/reference/celery.contrib.batches.html Set it up to flush every few seconds (?) and the task method would get the batch of tasks. The task method itself would need to collapse multiple same tasks into a single task that then gets executed.
https://github.com/mozilla/zamboni/commit/980a44 Only enabled for tests at the moment, I don't know if its as big a deal for requests.
Assignee: nobody → amckay
Didn't seem to help the time it took tests to run. But hopefully it helped the ES cluster jenkins uses.
Assignee: amckay → robhudson.mozbugs
(In reply to Andy McKay [:andym] from comment #2) > Only enabled for tests at the moment, I don't know if its as big a deal for > requests. Agreed. Closing...
Assignee: robhudson.mozbugs → amckay
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → 2012-10-04
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.