mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-11-14 00:07:00 +01:00
11 lines
7.9 KiB
HTML
11 lines
7.9 KiB
HTML
<!doctype html><html lang="en"><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Shared cache performance evaluation</title><style>
|
|
body{font-family:var(--font-sans,system-ui);color:var(--foreground,#17212b);line-height:1.5;margin:0}h2{font-size:20px;margin:0 0 8px}p{margin:8px 0 16px}.muted,small{color:var(--muted-foreground,#52606d)}label{font-weight:600}select{font:inherit;background:var(--card,#fff);color:inherit;border:1px solid var(--border,#aaa);border-radius:6px;padding:8px;margin:8px 0;width:100%;max-width:420px}table{border-collapse:collapse;width:100%;font-variant-numeric:tabular-nums}th,td{text-align:right;padding:12px 8px;border-bottom:1px solid var(--border,#ddd)}th:first-child,td:first-child{text-align:left;padding-left:0}thead th{font-size:12px;font-weight:600}tbody th{font-size:14px;font-weight:500}td{font-weight:650}small{display:block;font-size:11px;font-weight:400}.bad{color:var(--destructive,#ad2222)}.good{color:var(--success,#237044)}ul{padding-left:20px}li{margin:8px 0}.note{font-size:13px}a{color:var(--accent-foreground,#2563a5)}@media(max-width:420px){th,td{padding:10px 4px;font-size:13px}thead th{font-size:11px}h2{font-size:18px}}</style>
|
|
<h2>Keep shared-cache rollout disabled for now</h2>
|
|
<p>The current cache slows small and medium warm reads. Large files benefit. A benchmark-only SQLite change identifies a substantial part of the overhead.</p>
|
|
<label for="metric">Compare warm changed-text responses</label><br><select id="metric"><option value="serial:p50Ms">Median latency · 1 client · milliseconds</option><option value="concurrent8:p95Ms">p95 latency · 8 clients · milliseconds</option><option value="concurrent8:requestsPerSecond">Throughput · 8 clients · requests/second</option><option value="concurrent8:cpuMsPerRequest">CPU · 8 clients · milliseconds/request</option><option value="concurrent8:peakRssMiB">Peak sampled process memory · MiB</option></select>
|
|
<table aria-label="Warm cache benchmark comparison"><thead><tr><th>File / baseline</th><th>Baseline</th><th>Current<br>shared cache</th><th>Experimental<br>SQLite NORMAL</th></tr></thead><tbody id="rows"></tbody></table>
|
|
<p class="note muted">16 and 256 KiB: raw source cache with repeated transformation and gzip. 2 MiB: existing transformed-file cache. Two warm batches per setting: 32 serial requests or 64 requests at concurrency eight. CPU and memory include both server and benchmark client.</p>
|
|
<ul><li><strong>Correctness:</strong> 2,700 HTTP responses passed byte checks.</li><li><strong>Admin scaling:</strong> one pool statistics query reached 78.7 ms p95 at 100,000 synthetic blob records. It blocks the event loop.</li><li><strong>Eviction:</strong> the 4 MiB limit held, but cycling over a 6.25 MiB working set caused 300 misses in 300 reads.</li><li><strong>Next steps:</strong> reduce metadata commits, cache admin aggregates, and test a representative mixed workload across server processes.</li></ul>
|
|
<p class="note">NORMAL was tested only on temporary cache indexes. In WAL mode it can lose recent commits after power loss, so recovery needs validation before adoption. <a href="https://www.sqlite.org/pragma.html#pragma_synchronous">SQLite durability documentation</a>.</p>
|
|
<p class="note muted">Local compiled-code evaluation · Node 24.14.1 · 2 November 2026. Shared host, synthetic content, warm filesystem cache, no TLS or production traffic. These measurements are not production capacity guarantees. Application settings remain unchanged.</p>
|
|
<script>const data=[{"sizeBytes": 16384, "label": "16 KiB", "baseline": "raw source cache", "baselineMetrics": {"coldMs": 145.9149209999996, "serial": {"p50Ms": 8.318075000000135, "p95Ms": 10.736985999999888, "requestsPerSecond": 117.44442918645578, "cpuMsPerRequest": 11.06740625, "peakRssMiB": 146.50390625}, "concurrent8": {"p50Ms": 50.20099499999969, "p95Ms": 71.84271200000012, "requestsPerSecond": 142.73942902734086, "cpuMsPerRequest": 9.620406249999998, "peakRssMiB": 170.53125}}, "currentMetrics": {"coldMs": 709.8329450000001, "serial": {"p50Ms": 44.88915300000008, "p95Ms": 68.10151200000018, "requestsPerSecond": 20.710932531095363, "cpuMsPerRequest": 13.53253125, "peakRssMiB": 147.47265625}, "concurrent8": {"p50Ms": 362.3927130000002, "p95Ms": 462.1094459999995, "requestsPerSecond": 20.755357071571403, "cpuMsPerRequest": 11.042078125, "peakRssMiB": 154.1328125}}, "experimentalNormalMetrics": {"coldMs": 211.99763500000017, "serial": {"p50Ms": 6.900600000000395, "p95Ms": 9.86466399999972, "requestsPerSecond": 134.73985687410286, "cpuMsPerRequest": 8.7118125, "peakRssMiB": 141.24609375}, "concurrent8": {"p50Ms": 38.635037999999895, "p95Ms": 46.82847199999969, "requestsPerSecond": 197.41218048206238, "cpuMsPerRequest": 6.15025, "peakRssMiB": 147.6875}}, "gzipSavingPercent": 61.97907215871288}, {"sizeBytes": 262144, "label": "256 KiB", "baseline": "raw source cache", "baselineMetrics": {"coldMs": 100.41967600000021, "serial": {"p50Ms": 36.49021599999992, "p95Ms": 53.95963900000015, "requestsPerSecond": 26.236596142201567, "cpuMsPerRequest": 42.746187500000005, "peakRssMiB": 215.1875}, "concurrent8": {"p50Ms": 120.57758600000034, "p95Ms": 250.78685799999994, "requestsPerSecond": 53.7503475211922, "cpuMsPerRequest": 37.485390625, "peakRssMiB": 268.109375}}, "currentMetrics": {"coldMs": 726.5002400000001, "serial": {"p50Ms": 45.89932399999998, "p95Ms": 73.79595599999993, "requestsPerSecond": 20.372770202529612, "cpuMsPerRequest": 16.253875, "peakRssMiB": 160.78515625}, "concurrent8": {"p50Ms": 326.38565800000015, "p95Ms": 444.0948499999995, "requestsPerSecond": 23.057422718927143, "cpuMsPerRequest": 12.072328124999999, "peakRssMiB": 185.7578125}}, "experimentalNormalMetrics": {"coldMs": 293.5069330000001, "serial": {"p50Ms": 11.702889000000141, "p95Ms": 16.41937599999983, "requestsPerSecond": 80.13277379588973, "cpuMsPerRequest": 14.18359375, "peakRssMiB": 160.62890625}, "concurrent8": {"p50Ms": 72.28398599999946, "p95Ms": 89.62643300000036, "requestsPerSecond": 105.43423551997391, "cpuMsPerRequest": 11.027765625, "peakRssMiB": 185.6328125}}, "gzipSavingPercent": 61.890196641851716}, {"sizeBytes": 2097152, "label": "2 MiB", "baseline": "existing transformed cache", "baselineMetrics": {"coldMs": 2903.1252619999996, "serial": {"p50Ms": 236.22282199999972, "p95Ms": 288.4866490000004, "requestsPerSecond": 4.133831174669408, "cpuMsPerRequest": 362.9403125, "peakRssMiB": 336.703125}, "concurrent8": {"p50Ms": 690.5366940000022, "p95Ms": 929.2231830000001, "requestsPerSecond": 10.958910900736049, "cpuMsPerRequest": 253.19115625, "peakRssMiB": 308.02734375}}, "currentMetrics": {"coldMs": 4133.51807, "serial": {"p50Ms": 60.49789199999941, "p95Ms": 100.03485599999931, "requestsPerSecond": 15.358397676800456, "cpuMsPerRequest": 50.210843749999995, "peakRssMiB": 298.671875}, "concurrent8": {"p50Ms": 478.30868799999917, "p95Ms": 528.2149260000006, "requestsPerSecond": 16.483621344424616, "cpuMsPerRequest": 55.64621875, "peakRssMiB": 296.6875}}, "experimentalNormalMetrics": {"coldMs": 3895.830503, "serial": {"p50Ms": 25.95565600000009, "p95Ms": 32.11927700000069, "requestsPerSecond": 40.429950182644916, "cpuMsPerRequest": 43.713375, "peakRssMiB": 307.65625}, "concurrent8": {"p50Ms": 161.56209900000067, "p95Ms": 324.75534399999924, "requestsPerSecond": 43.95237969807028, "cpuMsPerRequest": 39.839515625000004, "peakRssMiB": 307.93359375}}, "gzipSavingPercent": 62.199088089151175}];const select=document.getElementById('metric');function render(){const [group,metric]=select.value.split(':');document.getElementById('rows').innerHTML=data.map(r=>{const values=['baseline','current','experimentalNormal'].map(k=>r[k+'Metrics'][group][metric]);return '<tr><th scope="row">'+r.label+'<small>'+r.baseline+'</small></th>'+values.map((v,i)=>{const ratio=v/values[0];const faster=metric==='requestsPerSecond'?ratio>1:ratio<1;return '<td class="'+(i?(faster?'good':'bad'):'')+'">'+v.toFixed(1)+'</td>'}).join('')+'</tr>'}).join('')}select.addEventListener('change',render);render();</script></html> |