viewof msgRate = Inputs.range([10, 10000], {
value: 500,
step: 10,
label: "Message rate (msg/s):",
width: 400
})
viewof uptimeDays = Inputs.range([1, 90], {
value: 30,
step: 1,
label: "Broker uptime before restart (days):",
width: 400
})
viewof payloadBytes = Inputs.range([50, 5000], {
value: 200,
step: 50,
label: "Average payload size (bytes):",
width: 400
})
viewof diskLatencyMs = Inputs.range([0.1, 10], {
value: 0.5,
step: 0.1,
label: "Disk write latency (ms per message):",
width: 400
})
html`<div style="margin: 20px 0; padding: 20px; background: #f8f9fa; border-left: 4px solid #2C3E50; border-radius: 4px;">
<h4 style="margin-top: 0; color: #2C3E50;">Impact Analysis</h4>
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 15px 0;">
<div style="background: white; padding: 15px; border-radius: 8px; border: 2px solid #E67E22;">
<div style="font-size: 12px; color: #7F8C8D; text-transform: uppercase; margin-bottom: 5px;">Without Persistence</div>
<div style="font-size: 28px; font-weight: bold; color: #E67E22; margin: 10px 0;">
${(msgRate * uptimeDays * 86400).toLocaleString()}
</div>
<div style="font-size: 14px; color: #2C3E50;">messages lost</div>
<div style="font-size: 24px; font-weight: bold; color: #E74C3C; margin: 10px 0;">
${((msgRate * uptimeDays * 86400 * payloadBytes) / 1000000000).toFixed(2)} GB
</div>
<div style="font-size: 14px; color: #2C3E50;">data lost per restart</div>
</div>
<div style="background: white; padding: 15px; border-radius: 8px; border: 2px solid #16A085;">
<div style="font-size: 12px; color: #7F8C8D; text-transform: uppercase; margin-bottom: 5px;">With Persistence</div>
<div style="font-size: 28px; font-weight: bold; color: #16A085; margin: 10px 0;">
0
</div>
<div style="font-size: 14px; color: #2C3E50;">messages lost</div>
<div style="font-size: 24px; font-weight: bold; color: #16A085; margin: 10px 0;">
${((msgRate * diskLatencyMs) / 1000 * 100).toFixed(1)}%
</div>
<div style="font-size: 14px; color: #2C3E50;">CPU usage (one core)</div>
</div>
</div>
<div style="background: white; padding: 15px; border-radius: 8px; margin-top: 15px;">
<div style="font-size: 14px; color: #7F8C8D; margin-bottom: 10px;">Recovery time with persistence:</div>
<div style="font-size: 20px; font-weight: bold; color: #3498DB;">
${((msgRate * uptimeDays * 86400 * diskLatencyMs / 1000) / 60).toFixed(1)} minutes
</div>
<div style="font-size: 12px; color: #7F8C8D; margin-top: 10px;">
Time to restore ${(msgRate * uptimeDays * 86400).toLocaleString()} messages from disk at ${diskLatencyMs}ms per message
</div>
</div>
<div style="margin-top: 15px; padding: 12px; background: #fff3cd; border-radius: 6px; border-left: 3px solid #E67E22;">
<strong style="color: #E67E22;">Key Insight:</strong>
<span style="color: #2C3E50;">
The ${((msgRate * diskLatencyMs) / 1000 * 100).toFixed(1)}% CPU overhead is negligible compared to losing
${((msgRate * uptimeDays * 86400 * payloadBytes) / 1000000000).toFixed(2)} GB of data.
Always use <code>delivery_mode=2</code> for critical messages.
</span>
</div>
</div>`Interactive Calculator: Message Persistence Impact
Interactive Calculator: Message Persistence Impact
animation
amqp
protocols
messaging
Try Change broker uptime before restart to 30 days.
Observe Watch Impact Analysis and Recovery time with persistence after Calculate impact.
Explain Explain why With Persistence shows 0 messages lost.
Technical boundaries. Without persistence, all messages from the entire uptime are counted as lost. With persistence, loss is fixed at 0 and recovery uses disk latency per message.