Commit 9161fbd
perf(waterdata): emit compact CQL2 JSON to halve POST chunk count (#292)
monitoring-locations is the one service that POSTs a CQL2 body (it doesn't
support comma-separated multi-value GET). The body was pretty-printed via
json.dumps(indent=4), ~39 B/value, so it counted ~2x against both the
server's ~8 KB request-size cap and the chunk planner's byte budget. The
tightest separators (~17 B/value) roughly double how many ids fit per
sub-request, halving the chunk count and API requests for large id lists:
n_ids indent=4 compact
500 4 2
1000 8 4
5000 32 16
Live check: a 500-id query returns all 500 rows in 2 sub-requests (was 4).
The WAF body limit (403) is empirically ~8.2-8.4 KB, so 8000-byte compact
bodies stay safely under it. Locked in with a compactness assertion on the
monitoring-locations POST test.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 7f64c2d commit 9161fbd
2 files changed
Lines changed: 19 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
316 | 316 | | |
317 | 317 | | |
318 | 318 | | |
319 | | - | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
320 | 330 | | |
321 | 331 | | |
322 | 332 | | |
323 | 333 | | |
324 | 334 | | |
325 | 335 | | |
326 | 336 | | |
327 | | - | |
| 337 | + | |
328 | 338 | | |
329 | 339 | | |
330 | 340 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
160 | 167 | | |
161 | 168 | | |
162 | 169 | | |
| |||
0 commit comments