Each item costs a producer c of work and makes a consumer wait d for the device. Three limits cap throughput: what the producers can make, what the consumers can take, and what the cores can run. Throughput follows the lowest of the three.
So give the slower role more processes until the cores run out. A surplus on the side that waits is almost free, because a blocked process holds no core; a surplus on the side that computes takes cores. A VM changes nothing in the model, only its costs: waiting can start to burn CPU, and some hypervisors charge for idle vCPUs.
We ran all 36 splits, 1 to 32 producers by 1 to 32 consumers, on five platforms, with two ways to wait (block: sleep until woken, as real queues do; sleep: check, sleep 1 µs, check again) and two doses: ⟨10,100⟩, where consumers are slower, and ⟨100,10⟩, where producers are. Each square is a split's throughput as a share of the best.
We fed the model costs from five runs of the even split (4,4) on each platform, let it pick a split, and committed the pick before the sweep. We compared it with a simple tuner that starts at (4,4) and keeps doubling or halving whichever role helps, like tf.data's AUTOTUNE. The table gives each method's largest loss against the best split.