Skip to content

Reduce limit for RemoveOldThrottlesJob#6199

Merged
mitchellhenke merged 2 commits intomainfrom
mitchellhenke/longer-timeout-old-throttles-job
Apr 15, 2022
Merged

Reduce limit for RemoveOldThrottlesJob#6199
mitchellhenke merged 2 commits intomainfrom
mitchellhenke/longer-timeout-old-throttles-job

Conversation

@mitchellhenke
Copy link
Contributor

We get some failures every so often because the statement timeout is reached, this increases it to 30 seconds

Copy link
Contributor

@zachmargolis zachmargolis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

another option would be to decrease the limit, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's a much better idea, I will drop all of these changes and halve (?) both limits

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to ensure and set the timeout back to the default value? I forget the scope of these

@mitchellhenke mitchellhenke force-pushed the mitchellhenke/longer-timeout-old-throttles-job branch from baba368 to 132b0dd Compare April 14, 2022 21:37
changelog: Internal, Maintenance, Reduce limit for background job that cleans up old Throttle database rows
@mitchellhenke mitchellhenke force-pushed the mitchellhenke/longer-timeout-old-throttles-job branch from 132b0dd to 8c385b0 Compare April 14, 2022 21:37
@mitchellhenke mitchellhenke changed the title Longer timeout for RemoveOldThrottlesJob Reduce limit for RemoveOldThrottlesJob Apr 14, 2022
discard_on GoodJob::ActiveJobExtensions::Concurrency::ConcurrencyExceededError

def perform(now, limit: 1000, total_limit: 100_000)
def perform(now, limit: 500, total_limit: 50_000)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe even drop this more? since it may be a sparse table, the limit might be expensive to search for

Another idea: we could use a find_in_batches kind of approach that uses id key to search + page (because LIMIT / OFFSET is expensive)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The index should help here, so I'm ok with trying this for now

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, never mind, I understand now

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, we don't use offset here, do we?

Going to roll forward with this for now.

@mitchellhenke mitchellhenke merged commit 6b733cf into main Apr 15, 2022
@mitchellhenke mitchellhenke deleted the mitchellhenke/longer-timeout-old-throttles-job branch April 15, 2022 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants