Merge pull request 'perf(prefetch): pcat gunluk butce 30k->45k' (#255) from dev into main

This commit was merged in pull request #255.
This commit is contained in:
2026-08-01 14:32:44 +03:00

View File

@@ -155,7 +155,14 @@ const SOURCE_RATE_MAX: Record<string, number> = {
const SOURCE_DAILY_MAX: Record<string, number> = {
pl24: Number(process.env.PREFETCH_DAILY_PL24) || 15_000,
emex: Number(process.env.PREFETCH_DAILY_EMEX) || 20_000,
"parts-catalogs": Number(process.env.PREFETCH_DAILY_PCAT) || 30_000,
// 45k (1.5x): the 2026-07-09 incident that created this guard was ~74k calls /
// ~10 GB in a day, so 45k ≈ 61% of that — a reversible step at ~6 GB/day. With
// DAILY_FAST_RESERVE the backfill (main) lane gets 36k, i.e. +20% over the old
// effective 30k while still leaving 9k for user decodes. Burst rate is
// UNCHANGED (SOURCE_RATE_MAX pcat 90/min), so per-IP ban pressure is the same —
// this only sustains that pace for more of the day. Rollback signal: any hour
// with >2 pcat HTTP 402 (DataImpulse quota) → back to 30_000.
"parts-catalogs": Number(process.env.PREFETCH_DAILY_PCAT) || 45_000,
};
/**
* Per-job pacing for parts-catalogs only (its browser/JWT capture is heavy).