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

Remove sleeps from workers, use schedules #131

Open
daronco opened this issue Jun 27, 2016 · 0 comments
Open

Remove sleeps from workers, use schedules #131

daronco opened this issue Jun 27, 2016 · 0 comments

Comments

@daronco
Copy link
Member

daronco commented Jun 27, 2016

Some workers have sleep calls inside of them, to wait for a while before executing. See https://github.com/mconf/bigbluebutton_rails/blob/master/app/workers/bigbluebutton_meeting_updater.rb#L9

This is bad because it locks the worker until the sleep is done, so the overall time it takes to run the worker is the process time plus the sleep time. Workers that take longer are bad because there is usually a limited amount of workers processing jobs in an application.

There are better ways of doing it using resque. One of the possibilities is to use resque-scheduler to schedule the execution of the worker, so the wait will be done by the scheduler and will not have any influence in the time it takes to run the worker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant