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

lower default wake_interval #8

Closed
joevandyk opened this issue Jan 13, 2014 · 3 comments
Closed

lower default wake_interval #8

joevandyk opened this issue Jan 13, 2014 · 3 comments

Comments

@joevandyk
Copy link
Contributor

5 seconds seems pretty high?

The polling query should be pretty quick. I have three worker processes set to 0.01 running and there's no noticeable postgresql cpu or disk activity.

Maybe set it to 1 or 0.25 or 0.1?

@chanks
Copy link
Collaborator

chanks commented Jan 13, 2014

The defaults assume that you'll be running Que in a web process where you
have other threads serving requests - that way, when one of those threads
commits a transaction that inserts a job, it can simply wake up one of that
process' workers to run it (this already happens automatically if you're
using Sequel, and I'd like to find a way to have ActiveRecord do it as
well). The wake_interval is there mainly to pick up scheduled jobs in case
there aren't any workers awake when their time comes.

So it makes sense to me to set a lower default wake_interval when running
workers as a rake task, where you wouldn't have the benefit of
intra-process communication, but not in the more typical (I hope) case of
running in a web process. I think it would also make sense for the rake
task to respect a WAKE_INTERVAL environment variable, too. Would that be
enough?

I've also been putting together plans for a LISTEN-NOTIFY system that would
replace the current polling setup. I'm going to spend some time
experimenting with it soon - if it works well, that'll be the long-term
solution to this.

On Sun, Jan 12, 2014 at 9:04 PM, Joe Van Dyk notifications@github.comwrote:

5 seconds seems pretty high?

The polling query should be pretty quick. I have three worker processes
set to 0.01 running and there's no noticeable postgresql activity. Maybe
set it to 1 or 0.25 or so?


Reply to this email directly or view it on GitHubhttps://github.com//issues/8
.

@joevandyk
Copy link
Contributor Author

Yes, a QUE_WAKE_INTERVAL + lower default setting for rake tasks would work.

@joevandyk
Copy link
Contributor Author

One nice thing about the polling system is that you don't have to keep a connection open. You can start a new connection on each poll (say, you are using pgbouncer).

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

No branches or pull requests

2 participants