title: How to handle RabbitMQ tasks w/ different memory footprints being queued to the same exchange?
body: <p>Imagine a RabbitMQ queue that collects "tasks" essentially. These tasks are then retrieved by a Node.js app with a <code>prefetch</code> value of 100. So, the app prefetches up to 100 tasks to do and then processes them when possible.</p>
  
  <p>The issue with this setup is that the tasks can have a different memory footprint and thus it is difficult to predict what sort of <code>prefetch</code> value I can set before the Node.js app runs out of memory. For some of the smaller tasks, I could prefetch a 100 of them and the app would run fine, and then some task payloads could cause the app to use more memory than usually and only a prefetch of 50 would be okay before the app runs out of memory.</p>
  
  <p>I could split these tasks in different queues or try to normalize them so that they have a more standard memory footprint. What other sort of approaches can you suggest?</p>