Calculator inputs
Use the responsive grid below. It shows three columns on large screens, two on medium screens, and one on mobile.
Example data table
These sample scenarios show how different workloads shift the dominant latency driver.
| Scenario | Rows Scanned | Cache Hit % | RTT (ms) | Disk Reads | Payload (KB) | Estimated P50 (ms) | Likely Bottleneck |
|---|---|---|---|---|---|---|---|
| Point lookup API | 2,000 | 98 | 2 | 8 | 12 | 8.60 | Network RTT |
| Reporting query | 180,000 | 84 | 10 | 420 | 640 | 132.40 | Disk I/O |
| Hot-row update path | 12,000 | 95 | 5 | 18 | 24 | 41.10 | Lock Wait |
| Wide export endpoint | 60,000 | 90 | 9 | 140 | 1,024 | 88.70 | Network Transfer |
Formula used
This calculator estimates query latency by summing storage, compute, concurrency, and network delays.
Network Transfer (ms) = ((Query KB + Result KB) × 8 ÷ 1024 ÷ Bandwidth Mbps) × 1000
CPU Scan (ms) = ((Rows Scanned ÷ 1000) × CPU ms per 1000 rows) ÷ Parallel Workers
Effective Disk Reads = Disk Reads × (1 − Cache Hit Ratio ÷ 100)
Disk I/O (ms) = Effective Disk Reads × Average Disk Read ms
Contention Penalty (ms) = (CPU Scan + Disk I/O + Lock Wait + Connection Wait) × Contention Penalty %
Total Latency (P50) = Connection Wait + Parse + Planning + CPU Scan + Disk I/O
+ Network RTT + Network Transfer + Lock Wait
+ Contention Penalty + Serialization + App Processing
P95 = P50 × (1 + Variability %)
P99 = P50 × (1 + Variability % × 1.8)
QPS Estimate = 1000 ÷ P50
This is an engineering estimation model. It is useful for comparing scenarios, not replacing full production tracing.
How to use this calculator
- Enter workload size details, including rows scanned, rows returned, and payload sizes.
- Fill in network values to reflect distance, round-trip time, and available throughput.
- Add execution costs for parsing, planning, CPU work, disk reads, and serialization.
- Include concurrency effects with connection wait, lock wait, and contention penalty.
- Set a variability percentage to estimate P95 and P99 latency behavior.
- Submit the form to view the result summary, bottleneck ranking, and Plotly chart.
- Use the CSV or PDF buttons to export the calculated scenario.
Frequently asked questions
1. What does this calculator actually estimate?
It estimates end-to-end query latency by combining network, CPU, disk, contention, and application overhead. The result is a planning model for performance analysis and scenario comparison.
2. Why are P50, P95, and P99 all shown?
P50 reflects typical latency. P95 and P99 show tail behavior, which matters for user experience, timeouts, and service-level objectives under bursty or uneven workloads.
3. How does cache hit ratio affect results?
A higher cache hit ratio lowers effective disk reads. That directly reduces storage latency, especially for read-heavy queries with frequent page reuse.
4. Does more bandwidth always reduce latency?
Not always. Bandwidth mostly affects transfer time for large payloads. Small requests are often dominated by round-trip delay, CPU work, or lock waits instead.
5. What is contention penalty in this model?
It represents extra delay from shared resource pressure, such as CPU saturation, queue buildup, buffer churn, or storage contention during peak concurrency.
6. When should I increase parallel workers?
Increase parallel workers when scans and aggregations are CPU-heavy and the engine supports parallel execution. It helps most when data distribution and worker coordination are efficient.
7. Can this be used for both OLTP and analytics?
Yes. For OLTP, focus on RTT, locks, and small payloads. For analytics, emphasize scans, storage reads, cache behavior, and large result transfers.
8. What should I optimize first?
Start with the largest component in the latency chart. That usually provides the highest return, whether it is disk I/O, lock waits, network transfer, or CPU scanning.