Skip to content

.tip

· one of the small things

One queue per latency class, not one queue for everything

A password reset email and a ten minute CSV export in the same queue means the email waits behind the export. Split the queues by how long the caller can wait, and give each its own workers.

new Worker("emails", sendEmail, { connection, concurrency: 20 });
new Worker("exports", buildExport, { connection, concurrency: 2 });

The sizing is the point: twenty workers for jobs of 200ms, two for the one that burns a core for minutes. A spike in exports then delays only exports, and queue depth per class shows you which work is behind.

queuesreliability