diff --git a/src/components/ImportModal.tsx b/src/components/ImportModal.tsx index b4a3b7d..31f976d 100644 --- a/src/components/ImportModal.tsx +++ b/src/components/ImportModal.tsx @@ -358,11 +358,11 @@ export default function ImportModal({ {rawCount > 0 && cloud && (
{local - ? 'Raw files are demosaiced by the Luminary local engine (LibRaw) on this PC, four ' + + ? 'Raw files are demosaiced by the Luminary local engine (LibRaw) on this PC, two ' + 'at a time; the rest of your selection waits its turn. A 24 MP raw takes a few ' + 'seconds; a 40 MP compressed Fuji file takes closer to twenty. Nothing leaves ' + 'your computer.' - : 'Raw files are demosaiced by the server (LibRaw), four at a time; the rest of your ' + + : 'Raw files are demosaiced by the server (LibRaw), two at a time; the rest of your ' + 'selection waits its turn. A 24 MP raw takes a few seconds; a 40 MP compressed ' + 'Fuji file takes closer to twenty.'} {' '}A file the engine cannot decode still imports from the camera’s own preview. diff --git a/src/lib/import.ts b/src/lib/import.ts index 9f33e0b..632211d 100644 --- a/src/lib/import.ts +++ b/src/lib/import.ts @@ -45,13 +45,20 @@ const IMPORT_CONCURRENCY = 4; /** * Raws and TIFFs are decoded by the server, which is where the work piles up, so - * this window matches the decoder pool rather than the network. Eight 12 MP NEFs - * took 20.8 s two at a time and 17.4 s four at a time; eight at once was 15.8 s, - * not enough to justify holding that much memory. The X-Trans frames that once - * made a wide window pathological now demosaic in one Markesteijn pass, so four - * no longer turns a Fuji selection into a queue of timeouts. + * this window is about one thing: how long a single upload request stays open. + * + * Measured on a 12-core server with 40 MP X-Trans RAFs through the real decode + * path: one file 28.4 s, two at once 44.4-45.4 s each, four at once 87.4-102.4 s + * each. Parallel X-Trans decodes barely scale here, so four-wide made every + * request about 1.5 minutes long and still finished sixteen files slower than + * two-wide (about 410 s against 360 s). Anything sitting in front of the server + * with a 60 s read timeout - the nginx default - answers 504 while the origin + * carries on decoding, which looks like a failed import of the files that were + * still in flight. Two keeps a request at ~45 s and is faster overall; Bayer + * files lose a little (8 NEFs took 20.8 s two at a time, 17.4 s four at a time) + * in exchange for every raw import staying inside a proxy's patience. */ -const RAW_IMPORT_CONCURRENCY = 4; +const RAW_IMPORT_CONCURRENCY = 2; export function uid(): string { if (typeof crypto !== 'undefined' && 'randomUUID' in crypto) return crypto.randomUUID();