When saving a bulk edit of allura tickets, the response times out. The changes do take effect properly, it just takes too long. This is new behavior, since [#2502]
It works fine on project with a small number of total tickets, so it is an issue with the total number of tickets in the project -- not the number of tickets being changed.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The change to background task seems fine, and I'm merging it, but we do need some more info on why it's taking so long. I found this stats record in the logs, showing it take over 4 minutes and make over 185k mongo calls, which is way over the top.
What research did you do to determine what's causing these updates to taking so long? Can you please post the results of your research here. Can you please see if there's a way to reduce the number of mongo calls made?
At a quick glance, I expect Globals.filtered_by_subscription could be refactored to a single mongo query instead of more than one per user per ticket by replacing the classmethod subscribed call with an instance method that checks the Mailbox's properties instead of re-querying mongo needlessly. I'm not certain if that's the main source of queries, but it's definitely one that could be improved.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Also, you can see profiler logs here: before, after.
As you can see, there are still a lot of mongo calls on discussion's post, approve and ticket's commit, but I think they are not relevant to performance degradation, because they was present before [#2502]. So, I think, main source of troubles was in filtered_by_subscription (especially, when there are many users subscribed to many different tickets).
It works fine on project with a small number of total tickets, so it is an issue with the total number of tickets in the project -- not the number of tickets being changed.
Make performance improvements, or if no easy wins, change to a background task.
Created #362: [#6203] Bulk edit times out (3cp)
Related
Tickets:
#6203Closed #362.
je/42cc_6203
The change to background task seems fine, and I'm merging it, but we do need some more info on why it's taking so long. I found this stats record in the logs, showing it take over 4 minutes and make over 185k mongo calls, which is way over the top.
What research did you do to determine what's causing these updates to taking so long? Can you please post the results of your research here. Can you please see if there's a way to reduce the number of mongo calls made?
At a quick glance, I expect
Globals.filtered_by_subscription
could be refactored to a single mongo query instead of more than one per user per ticket by replacing the classmethodsubscribed
call with an instance method that checks theMailbox
's properties instead of re-querying mongo needlessly. I'm not certain if that's the main source of queries, but it's definitely one that could be improved.Yes, I think main source of problems is in
Globals.filtered_by_subscription
. We'll investigate it further.Created #377 [#6203] Optimize bulk edit (3cp)
Related
Tickets:
#6203Closed #377.
je/42cc_6203a
We've refactored
filtered_by_subscription
to a single query.Here's some timings:
Before:
After:
Also, you can see profiler logs here: before, after.
As you can see, there are still a lot of mongo calls on discussion's post, approve and ticket's commit, but I think they are not relevant to performance degradation, because they was present before [#2502]. So, I think, main source of troubles was in
filtered_by_subscription
(especially, when there are many users subscribed to many different tickets).Related
Tickets:
#2502