Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add internal_query_count_limit configuration #63

Conversation

garyhtou
Copy link
Contributor

This allows the internal count limit in Solid Queue to be configured using an internal_query_count_limit option.

MissionControl::Jobs.internal_query_count_limit = 5_000
# or
config.mission_control.jobs.internal_query_count_limit = 5_000

The default value is 500,000.

It can be configured via
```ruby
MissionControl::Jobs.internal_query_count_limit = 5_000
```
or
```ruby
config.mission_control.jobs.internal_query_count_limit = 5_000
```
It appears that only the Solid Queue adapter implements an internal query count limit. The Resque adapter doesn't have a similar functionality
@garyhtou
Copy link
Contributor Author

At the moment, only the Solid Queue adapter implements this configuration. Are there any plans to implement an internal count limit for the Resque adapter too?

If not, maybe this internal_query_count_limit config should be renamed to solid_queue.internal_query_count_limit. Thoughts?

@rosa
Copy link
Member

rosa commented Feb 12, 2024

At the moment, only the Solid Queue adapter implements this configuration. Are there any plans to implement an internal count limit for the Resque adapter too?

Not really, because Resque doesn't have a problem with counting jobs like Solid Queue has, thanks to the llen operation in Redis, that has O(1) time complexity. Unfortunately, this is not true for some DB storage engines, notably InnoDB 😅 This is why we had to introduce it for Solid Queue.

If not, maybe this internal_query_count_limit config should be renamed to solid_queue.internal_query_count_limit. Thoughts?

Yes, I think that could work, but I'd prefer to delay (or even avoid completely) having per-adapter configuration options if possible. Having the option doesn't mean the adapter needs to use it, so I think it's ok to leave it like this, without modifying Resque.

README.md Outdated Show resolved Hide resolved
…nt_limit`

Co-authored-by: Rosa Gutierrez <rosa.ge@gmail.com>
@garyhtou
Copy link
Contributor Author

I'd prefer to delay (or even avoid completely) having per-adapter configuration options if possible.

I agree!

Having the option doesn't mean the adapter needs to use it, so I think it's ok to leave it like this, without modifying Resque.

Yeah, that makes sense 👍

@garyhtou garyhtou requested a review from rosa February 12, 2024 22:37
Copy link
Member

@rosa rosa left a comment

Choose a reason for hiding this comment

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

Awesome, thank you so much 🙏

@rosa rosa merged commit b6ea7d0 into rails:main Feb 13, 2024
0 of 2 checks passed
@garyhtou garyhtou deleted the garyhtou/add-internal-query-count-limit-configuration branch February 14, 2024 03:38
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