-
Notifications
You must be signed in to change notification settings - Fork 62
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
:poolboy.checkout returning :full #59
Comments
WorkersManager watches the workers and keep track of the free workers. We do this because We could simply start using the I would try this approach changing this private function: https://github.com/edgurgel/verk/blob/v0.9.13/lib/verk/workers_manager.ex#L210-L212 Then doing some quick benchmarks to see if it affects too much. If it's decreasing the performance we could potentially call Does this make any sense? :P |
Makes sense to me. |
going to have a go at this |
Awesome @mitchellhenke. I was thinking on a simple way to run benchmarks for workers. I was thinking on:
We would get for free a pipeline of workers running. OFC that the FinishBenchWorker wouldn't be the strict last worker to run as it will run concurrently with the NoOpworkers in the end. It will be a good estimate still. This may even become part of our test suite somehow. Thoughts? |
So I started investigating this on my machine (2.7 GHz Intel Core i5 / 8 GB 1867 MHz DDR3 for what it's worth). From this limited benchmark, it doesn't look like
The code for the benchmark is here: https://github.com/mitchellhenke/verk/compare/master...benching?expand=1 The code for the What I did notice was that the current bottleneck is likely the Would it make sense to have the workers handle the dequeuing of jobs? Sidekiq switched from something resembling verk's current manager style dequeuing to having the workers themselves dequeue jobs. It would be a heavier undertaking, but would solve the issue at hand and potentially increase throughput. I will probably play around with it and see what happens. Outside of that, should I PR the |
Great findings. I already have a local branch with some work to investigate extracting part of the workers manager processing to the workers. I will push this soon so we can start discussing. Is this fair? I would still push forward the :poolboy.status change so we fix the current issue. What do you think? |
That sounds great! I've opened #67 for this issue. I'd be glad to take a look or help for the worker manager/worker changes whenever :) |
I should also point that it's important to tweak the benchmark as well to check with workers that spend more time doing something. I think it's safe to say you wouldn't put stuff to be done as a job if you can do it instantly. I'm keen to try with some random sleep (say 0 to 60 seconds). So then we have a less artificial benchmark. I will play with the benchmark today :) |
I forgot to add a comment to this:
Sidekiq can't be a real comparison because of the concurrency that the Erlang VM can deal with. The amount of workers and queues that Verk can handle is much greater. We have 400+ queues running each more than 10 workers per machine. If all of them start hitting Redis to dequeue jobs we may overload the Redis connections with unnecessary requests. The monitoring also can't be avoided completely as a Worker can simply die and we need to keep track of such failures. (I thought that it would be a good addition to this discussion.) I'm currently thinking of different approaches to speed up the "happy path". |
That makes sense, yeah. Appreciate the explanation. Is splitting up the things the workers manager has to do (queueing, handling monitoring, etc.) into separate processes worth looking into? |
@mitchellhenke yeah. I just created this issue so we can discuss more! I'm keen to improve the |
https://github.com/edgurgel/verk/blob/master/lib/verk/workers_manager.ex#L188 on version 0.9.13 (but would happen the same on 10) returns :full
If you need more details from our redis instance we can grab them for you.
The text was updated successfully, but these errors were encountered: