You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tune queue_size defaults per input type and document recommendations
An unset queue_size now defaults to 1000 for local directories (where the
queue holds only file paths, as it historically did) and to 1.2 * n for
archive and s3 streaming (where a whole chunk is materialized in memory),
keeping 20% headroom over the thread pool. The queue_size entry was
dropped from the shipped config.json so these defaults apply out of the
box, and the README gains a "Choosing a queue size" section with tuning
guidance.
|`grobid_server`| GROBID server URL |`http://localhost:8070`|
406
-
|`queue_size`| Number of files queued per processing chunk. If not set, it follows the concurrency `n` so the thread pool is never starved. **Tune carefully: a large queue size will result in the data being written less frequently, and on the archive/S3 paths a whole chunk is held in memory at once**| same as `n`|
405
+
|`queue_size`| Number of files queued per processing chunk. See [Choosing a queue size](#choosing-a-queue-size). | 1000 for local directories, 1.2 × `n`for archives and S3|
407
406
|`sleep_time`| Wait time when server is busy (seconds) | 5 |
408
407
|`timeout`| Client-side timeout (seconds) | 180 |
409
408
|`coordinates`| XML elements for coordinate extraction | See above |
@@ -413,6 +412,24 @@ settings.
413
412
> Since version 0.0.12, the config file is optional. The client will use default localhost settings if no configuration
414
413
> is provided.
415
414
415
+
### Choosing a queue size
416
+
417
+
`queue_size` controls how many files are grouped into one processing chunk. It is a memory/durability knob, not a
418
+
concurrency one: parallelism toward the GROBID server is set by `-n`, and each chunk is processed `n` files at a time.
419
+
When `queue_size` is not set, the client picks a sensible default per input type (see the table above); set it
420
+
explicitly only if you need to override that. A few guidelines:
421
+
422
+
-**Never set it below `n`.** Effective parallelism is `min(n, queue_size)`: a queue smaller than the thread pool
423
+
leaves workers idle. A bit of headroom above `n` (the default streaming value is 1.2 × `n`) keeps the pool busy.
424
+
-**Results are written per chunk.** Output files land on disk only once a whole chunk has been processed, so a
425
+
larger queue means results are written less frequently and an interrupted run loses at most one chunk of work
426
+
(already-written results are skipped on re-run unless `--force` is used).
427
+
-**Local PDF directories:** the queue holds only file paths, so large values are essentially free — the default is
428
+
1000. Lower it if you want results flushed to disk more often on long runs.
429
+
-**Archives (zip/tar) and S3:** each chunk is read or downloaded *into memory* before processing starts, so peak RAM
430
+
grows with `queue_size × average file size`. Keep it moderate — the 1.2 × `n` default is a safe floor; going up to
431
+
a few multiples of `n` (e.g. 2–5 ×) trades memory for slightly better throughput around chunk boundaries.
432
+
416
433
> [!WARNING]
417
434
> **Citation consolidation and the `timeout` setting.** When `--consolidate_citations` (or `consolidate_citations=True`)
418
435
> is enabled, GROBID queries external services (e.g. CrossRef) to enrich the extracted references. This is considerably
0 commit comments