A box of workers that knows when to ask for help
Each batch of photos has a deadline. The box predicts the work from the image sizes, hands it out ten images at a time to whichever task is due first, and turns away what it cannot finish. Below that, you can let the naive version run the box for a minute and watch what happens when workers that fall behind call helpers, who call helpers.
Workers busy
–
Tasks in the queue
–
Images per second
0.0
Reconnecting to the box…
What the box is doing
- Waiting for something to happen.
Let a splitting policy run the box
For a minute the pool steps aside and a policy that gives each task its own workers takes over, with tasks arriving at 1.2 times what the box can do. Workers that fall behind call helpers. Everything runs inside the box's limits: 1.5 CPUs, 1.5 GB, 35 processes.