Skip to content

Throttle the number of UPDATEs triggered by touch

Yorick Peterse requested to merge throttle-touching-of-objects into master

What does this MR do?

@_stark and I decided to pair on the issue ( https://gitlab.com/gitlab-org/gitlab-ce/issues/34763) that lead to this. He found the following graphs for the mentioned query: https://performance.gitlab.net/dashboard/db/postgres-single-query-drill-down?orgId=1&var-environment=prd&var-queryid=2989607667&var-fqdn=All

The changes in this MR throttle the number of UPDATE and SELECT queries that get triggered when calling touch on Issue, MergeRequest, or Note objects to once per minute (per object). This should lead to a reduction in UPDATE queries on e.g. merge_requests whenever a note is updated. We're using a one minute interval because this is small enough for people to most likely not notice it, while large enough to hopefully drastically reduce the number of updates.

See the commit (message) for more details.

This fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/34763.

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

https://gitlab.com/gitlab-org/gitlab-ce/issues/34763

Edited by Yorick Peterse

Merge request reports