colors = ({
navy: "#2C3E50",
teal: "#16A085",
orange: "#E67E22",
blue: "#3498DB",
gray: "#7F8C8D",
purple: "#9B59B6",
red: "#E74C3C"
})
viewof messageRate = Inputs.range([10, 10000], {
value: 500,
step: 10,
label: "Message rate (msg/sec):",
width: 400
})
viewof messageSize = Inputs.range([64, 2048], {
value: 128,
step: 64,
label: "Average message size (bytes):",
width: 400
})
viewof numQueues = Inputs.range([1, 10], {
value: 3,
step: 1,
label: "Number of queues:",
width: 400
})
viewof targetBacklog = Inputs.range([5, 300], {
value: 10,
step: 5,
label: "Target backlog capacity (seconds):",
width: 400
})
// Calculations
queueDepth = messageRate * targetBacklog
memoryPerMessage = 1 // KB (includes metadata overhead)
totalMemory = numQueues * queueDepth * memoryPerMessage / 1024 // MB
brokerBaseMemory = 200 // MB
totalBrokerMemory = brokerBaseMemory + totalMemory
throughputBytes = messageRate * messageSize
dailyVolume = (messageRate * messageSize * 86400) / (1024 * 1024 * 1024) // GB
html`
<div style="background: linear-gradient(135deg, ${colors.navy} 0%, ${colors.teal} 100%); padding: 25px; border-radius: 12px; color: white; margin: 20px 0; box-shadow: 0 4px 6px rgba(0,0,0,0.1);">
<h3 style="margin-top: 0; color: white; border-bottom: 2px solid rgba(255,255,255,0.3); padding-bottom: 10px;">Queue Capacity Analysis</h3>
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-top: 20px;">
<div style="background: rgba(255,255,255,0.1); padding: 15px; border-radius: 8px; border-left: 4px solid ${colors.orange};">
<div style="font-size: 0.9em; opacity: 0.9; margin-bottom: 5px;">Messages per Queue</div>
<div style="font-size: 2em; font-weight: bold;">${queueDepth.toLocaleString()}</div>
<div style="font-size: 0.85em; opacity: 0.8; margin-top: 5px;">${targetBacklog} seconds of backlog</div>
</div>
<div style="background: rgba(255,255,255,0.1); padding: 15px; border-radius: 8px; border-left: 4px solid ${colors.blue};">
<div style="font-size: 0.9em; opacity: 0.9; margin-bottom: 5px;">Queue Memory</div>
<div style="font-size: 2em; font-weight: bold;">${totalMemory.toFixed(1)} MB</div>
<div style="font-size: 0.85em; opacity: 0.8; margin-top: 5px;">for ${numQueues} queue${numQueues > 1 ? 's' : ''}</div>
</div>
<div style="background: rgba(255,255,255,0.1); padding: 15px; border-radius: 8px; border-left: 4px solid ${colors.purple};">
<div style="font-size: 0.9em; opacity: 0.9; margin-bottom: 5px;">Total Broker Memory</div>
<div style="font-size: 2em; font-weight: bold;">${totalBrokerMemory.toFixed(0)} MB</div>
<div style="font-size: 0.85em; opacity: 0.8; margin-top: 5px;">base + queues</div>
</div>
<div style="background: rgba(255,255,255,0.1); padding: 15px; border-radius: 8px; border-left: 4px solid ${colors.teal};">
<div style="font-size: 0.9em; opacity: 0.9; margin-bottom: 5px;">Throughput</div>
<div style="font-size: 2em; font-weight: bold;">${(throughputBytes / 1024).toFixed(1)} KB/s</div>
<div style="font-size: 0.85em; opacity: 0.8; margin-top: 5px;">${dailyVolume.toFixed(2)} GB/day</div>
</div>
</div>
<div style="margin-top: 20px; padding: 15px; background: rgba(255,255,255,0.05); border-radius: 8px; border: 1px solid rgba(255,255,255,0.1);">
<strong>Recommendation:</strong>
${totalBrokerMemory < 512
? `✓ ${Math.round(totalBrokerMemory * 2)} MB RAM sufficient (2x capacity for headroom)`
: totalBrokerMemory < 1024
? ` ${Math.round(totalBrokerMemory * 1.5)} MB RAM recommended (1.5x for bursts)`
: ` ${Math.ceil(totalBrokerMemory / 1024)} GB RAM required - consider message pruning or faster consumers`}
</div>
</div>
`AMQP Queue Capacity Calculator
AMQP Queue Capacity Calculator
animation
amqp
protocols
messaging
Try Change Target backlog capacity (seconds): from 10 to 300.
Observe Watch Messages per Queue, Queue Memory, and Total Broker Memory as backlog capacity increases from 10 seconds.
Explain Explain why 1 KB per message makes Queue Memory depend on queue depth and number of queues.
Technical boundaries. Queue memory assumes 1 KB per message including metadata overhead, plus 200 MB broker base memory. Average message size affects throughput and daily volume, but does not change the memory calculation.
AMQP Queue Capacity Calculator
Calculate memory requirements, queue depth limits, and backlog tolerance for production AMQP deployments.