4 ms·
Another important aspect that seems to be overlooked in a lot of these discussions (specifically for Rails, but probably relevant in other contexts as well) is
by andrelaszlo 3y ago
Another important aspect that seems to be overlooked in a lot of these discussions (specifically for Rails, but probably relevant in other contexts as well) is that if your jobs are very heterogeneous in terms of their degree of parallelizability then it will be very difficult to do effective provisioning and capacity planning.
Let's say you have two types of jobs: one that is highly parallelizable (Eg request to third party API), and one that doesn't parallelize well (video transcoding using 100% of available CPU). Then you'd want a lot of threads assigned to each CPU for the first type, but very few for the second type. If they're on the same queue, you can have a few threads and be blocked by job type one most of the time, or have a lot of threads and get tons of context switching when the second type of job dominates. Either way your throughput will be very bad.
My current idea is to partition job types first by their degree of parallelizability (as in Amdahl's law), then by priority if necessary.
Has anyone tried this?
- deredede 3y agoDo not use the same queues for I/O jobs and compute jobs, they are not competing for the same resources.
- andrelaszlo 3y agoTotally agree.