Back to .md Directory

Marker Page Chunking Benchmark

Benchmarks Marker chunk sizes (10, 20, 30) for PDF parsing speed and GPU memory, recommending chunk size 10 for production.

May 2, 2026
0 downloads
0 views
ai eval
View source

What this file does

Benchmarks Marker chunk sizes (10, 20, 30) for PDF parsing speed and GPU memory, recommending chunk size 10 for production.

When to use it

  • Tuning Marker PDF parsing for GPU memory constraints
  • Scaling Marker workers without OOM risk
  • Choosing chunk size for concurrent PDF processing
  • Benchmarking Marker performance on your own PDF dataset

Assumes this stack

MarkerPDFGPU

Marker Page Chunking Benchmark

Objective

Measure the impact of MARKER_CHUNK_SIZE on PDF parsing speed and GPU memory usage. Page chunking splits large PDFs into fixed-size page ranges and dispatches them across all available Marker workers in parallel, rather than sending the entire file to a single worker.

Setup

Worker configuration

VariableValue
MARKER_MAX_PROCESSES5
MARKER_MAX_TASKS_PER_CHILD100

Disabled features

The following features were disabled to isolate the measurement to pure PDF parsing time, avoiding bias from downstream processing:

CONTEXTUAL_RETRIEVAL=false
IMAGE_CAPTIONING=false
VDB_ENABLE_INSERTION=false

Dataset

MetricMinMaxMeanStd
Pages per PDF114021.08.3
Size per PDF (MB)0.0325.811.893.84

Results

Tested with MARKER_CHUNK_SIZE values of 10, 20, and 30

Chunk sizeParsing durationMax GPU spike (GB)Spike duration
3016m 27s2.2 - 4.05s to ~2 min (file-dependent)
2016m 44s2.2 - 35s to ~1 min
1017m 29s1.9 - 2.55s - 30s

Analysis

Speed

These results are at equal number of workers (MARKER_MAX_PROCESSES=5). All chunk sizes perform similarly (~16-17 min), and with smaller chunks the workload per worker actually increases since each worker handles more tasks (more chunks to process).

The main advantage of chunking is therefore not raw speed at fixed worker count, but the ability to scale the number of workers without risking OOM. By keeping per-worker memory spikes low and spike duration low aswell, chunking allows safely increasing MARKER_MAX_PROCESSES, which is where the real speed gains come from.

The GPU memory constraint can be estimated as:

available_gpu_mem >= max_spike * num_workers + marker_model_gpu_size + other_gpu_processes

With a chunk size of 10 (max spike ~2.2 GB) you can fit more workers in the same GPU budget than with unchunked processing (where spikes can reach 4+ GB per worker).

GPU memory

Smaller chunk sizes produce lower and shorter memory spikes:

  • Chunk size 10: Safest option. Peak stays around 1.9-2.5 GB with spikes lasting at most 30 seconds. Memory drops quickly since 10 pages are processed fast.
  • Chunk size 20-30: Spikes can reach 3-4 GB and persist for up to 2 minutes, increasing the risk of OOM when multiple workers hit peak usage simultaneously.

Spike behavior

  • Spikes occur primarily during Marker's "Recognizing text" phase.
  • For chunk sizes 20 and 30, spike duration can extend to ~2 minutes with peaks between 2.3 and 4 GB. This raises OOM risk when several processes spike concurrently.
  • Files with complex or non-searchable text are the worst case: Marker spends significantly more time in the recognition phase (layout recognition, text recognition, OCR error detection, bbox detection), keeping memory elevated for longer.

Recommendation

A chunk size of 10 offers the best trade-off: parsing speed is comparable to larger chunks, while GPU memory stays controlled with short-lived spikes. This reduces OOM risk in production, especially under concurrent load.

What's inside

Objective, setup table, disabled features, dataset stats, results table, analysis of speed and memory, recommendation.

Change this for your project

  • Replace MARKER_MAX_PROCESSES=5 with your worker count
  • Replace MARKER_CHUNK_SIZE values with your test range
  • Replace dataset metrics with your own PDF corpus stats

Where it goes

Keep it in your repository where the agent or team that needs it will read it.

Worth borrowing

  • Isolating downstream features to measure pure parsing time
  • Estimating GPU memory constraint formula for worker scaling

Related Documents