Hold raw imports to two files in flight

A raw upload request stays open for the whole decode, and four X-Trans frames
decoded together took 87-102 s each on a 12-core server against 28 s alone, so
every request outlived a 60 s reverse-proxy read timeout and came back as 504
while the server was still working. Two-wide keeps a request near 45 s and
finishes a 16-file batch sooner as well; Bayer files give up a little.
This commit is contained in:
2026-12-02 17:21:14 +00:00
parent 8f23e96b92
commit bd90264c3c
2 changed files with 15 additions and 8 deletions
+2 -2
View File
@@ -358,11 +358,11 @@ export default function ImportModal({
{rawCount > 0 && cloud && (
<div className="banner info">
{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.
+13 -6
View File
@@ -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();