viewof msgRate = Inputs.range([0.1, 1000], {
value: 100,
step: 0.1,
label: "Message rate (msg/s)"
})
viewof msgPayload = Inputs.range([10, 2000], {
value: 120,
step: 10,
label: "Average payload (bytes)"
})
viewof qosLevel = Inputs.select(
["At-Most-Once", "At-Least-Once", "Transactional model"],
{value: "At-Least-Once", label: "Illustrative delivery-cost model"}
)
// Illustrative overhead assumptions, not fixed AMQP protocol sizes or guarantees
qosOverhead = qosLevel === "At-Most-Once" ? 116 :
qosLevel === "At-Least-Once" ? 156 : 316
totalMsgSize = msgPayload + qosOverhead
bytesPerSecond = (msgRate * totalMsgSize).toFixed(0)
kiloBitsPerSecond = (bytesPerSecond * 8 / 1000).toFixed(1)
megaBitsPerSecond = (bytesPerSecond * 8 / 1000000).toFixed(3)
messagesPerHour = (msgRate * 3600).toFixed(0)
dataPerHour = (bytesPerSecond * 3600 / 1000000).toFixed(1)
bandwidthColor = megaBitsPerSecond < 0.1 ? "#16A085" :
megaBitsPerSecond < 1 ? "#E67E22" : "#E74C3C"
html`
<div style="background: #f8f9fa; padding: 20px; border-radius: 8px; border-left: 4px solid #2C3E50; margin: 20px 0;">
<div style="display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-bottom: 20px;">
<div>
<div style="font-size: 14px; color: #7F8C8D; margin-bottom: 5px;">Message Rate</div>
<div style="font-size: 24px; font-weight: bold; color: #2C3E50;">${msgRate.toFixed(1)} msg/s</div>
<div style="font-size: 12px; color: #7F8C8D; margin-top: 2px;">${Number(messagesPerHour).toLocaleString()} msg/hr</div>
</div>
<div>
<div style="font-size: 14px; color: #7F8C8D; margin-bottom: 5px;">Message Size</div>
<div style="font-size: 24px; font-weight: bold; color: #2C3E50;">${totalMsgSize} B</div>
<div style="font-size: 12px; color: #7F8C8D; margin-top: 2px;">${msgPayload}B payload + ${qosOverhead}B overhead</div>
</div>
<div>
<div style="font-size: 14px; color: #7F8C8D; margin-bottom: 5px;">QoS Overhead</div>
<div style="font-size: 24px; font-weight: bold; color: #E67E22;">${qosOverhead} B</div>
<div style="font-size: 12px; color: #7F8C8D; margin-top: 2px;">${qosLevel}</div>
</div>
</div>
<div style="background: white; padding: 15px; border-radius: 6px; margin-bottom: 15px;">
<div style="font-size: 14px; color: #7F8C8D; margin-bottom: 10px;">Bandwidth Requirements</div>
<div style="display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 15px;">
<div>
<div style="font-size: 13px; color: #7F8C8D;">Bytes/second</div>
<div style="font-size: 20px; font-weight: bold; color: #2C3E50;">${Number(bytesPerSecond).toLocaleString()}</div>
</div>
<div>
<div style="font-size: 13px; color: #7F8C8D;">Kbps</div>
<div style="font-size: 20px; font-weight: bold; color: ${bandwidthColor};">${kiloBitsPerSecond}</div>
</div>
<div>
<div style="font-size: 13px; color: #7F8C8D;">Mbps</div>
<div style="font-size: 20px; font-weight: bold; color: ${bandwidthColor};">${megaBitsPerSecond}</div>
</div>
</div>
</div>
<div style="background: white; padding: 15px; border-radius: 6px;">
<div style="font-size: 14px; color: #7F8C8D; margin-bottom: 10px;">Hourly Throughput</div>
<div style="font-size: 13px; color: #2C3E50; line-height: 1.8;">
• <strong>${Number(messagesPerHour).toLocaleString()}</strong> messages per hour<br>
• <strong>${dataPerHour} MB</strong> data per hour<br>
• Network recommendation:
${megaBitsPerSecond < 0.01 ? "Low-power networks (LoRaWAN, NB-IoT) suitable" :
megaBitsPerSecond < 0.1 ? "Standard IoT networks (Zigbee, BLE) suitable" :
megaBitsPerSecond < 1 ? "Wi-Fi or cellular required" :
"High-bandwidth network required (Wi-Fi, Ethernet)"}
</div>
</div>
</div>
`Interactive Calculator: AMQP Bandwidth Requirements
Interactive Calculator: AMQP Bandwidth Requirements
animation
amqp
protocols
messaging
Try Set average payload to 120 bytes and change the illustrative delivery-cost model.
Observe Watch Message Size and bandwidth requirements at 100 msg/s.
Explain Explain why 156 bytes of overhead increases Message Size.
Technical boundaries. Overhead values are illustrative assumptions, not fixed AMQP protocol sizes or guarantees. Bandwidth is message rate multiplied by payload plus overhead.