Operate and recover dataset jobs
Plan capacity, assign job ownership, handle shutdown, and respond to incomplete or failed work.
In this guide
1. Give every job an owner
Assign a unique output directory to each independent input and configuration. One worker owns that directory at a time. The state database uses an exclusive lock, so starting another writer does not provide parallel processing of the same job.
Persist the URL file, configuration, state, shards and collector version together. Input contents and serialized job configuration are checked on resume; changed inputs require a fresh directory.
2. Set separate resource budgets
| Control | Bounds | Important distinction |
|---|---|---|
| concurrency | In-flight page processing in one job. | It is not requests per second. |
| Session rate limit | Per-host request pacing in one session. | Separate processes do not share a global limiter. |
| checkpoint_pages | Input lines in a checkpoint batch. | A page may produce many records. |
| checkpoint_bytes | Pending exact-dedup identity payload. | It is not a process memory limit. |
| max_response_bytes | Fetched response size accepted by the job. | The job check is after fetching. |
| max_records_per_page | Number of row containers allowed on a page. | It does not select the most useful rows for you. |
| max_record_bytes | Serialized extracted fields accepted for a record. | It does not guarantee complete document text. |
3. Estimate a workload before scaling
Estimate required pages as target accepted records divided by accepted unique records per page. Then account for the permitted request rate, discovery, robots requests, retries and actual source latency.
For example, one million single-record pages at one page per second need at least 11.6 days of request time. At 20 accepted records per page the same target needs 50,000 pages, or at least 13.9 hours at that rate. These are arithmetic examples, not measured live-site performance.
Estimate storage from measured serialized record sizes, plus error shards, deduplication state, temporary files and derived datasets. Profile representative pages rather than applying the local small-page benchmark to every source.
4. Run a small pilot
- Include multiple page shapes, long responses and expected missing values.
- Start at a source-appropriate request rate and small concurrency.
- Measure source latency, accepted records per page, errors, output bytes and worker memory.
- Compare representative extracted fields against the source.
- Keep the pilot separate from your production snapshot and record its configuration.
5. Handle shutdown and cancellation
Call cancel on the active DatasetJob handle, then wait for the run to return and release its output directory. Cancellation requests do not synchronously wait for the worker to stop.
A cancelled handle stays cancelled. Construct a new job with the same configuration and input to resume. An unfinished batch can be replayed; keep state and committed shards together.
6. Resume after interruption
Start the same job using the unchanged input and configuration, with no other worker using the directory. The engine checks state and committed shard integrity before continuing.
After a hard crash, resume before consuming a final output boundary. Do not remove checkpoint state to force a changed configuration through; use a new directory for a new job.
The PEP experiment tested restart after a completed job. It did not prove behavior for process kills, disk-full conditions or corrupted storage. Test those failure modes for your own deployment.
7. Distinguish a partial result from a fatal error
A job can reach the end of its input while reporting failed pages or rejected records. A constructor or run error, by contrast, can indicate invalid configuration, storage access problems or an incompatible resume.
Preserve the error details and decide whether partial output is acceptable. To revisit committed failures after fixing a problem, prepare a new job and output directory rather than expecting a completed resume to refetch them.
8. Integrate with a worker or scheduler
Your service owns job scheduling, admission control, destination policy, storage and observability. Crawlingo runs the collection within that boundary and writes a report and local files.
A Docker worker needs a native package for its own operating system and CPU architecture. Keep the output on a persistent volume if the job must resume after container replacement. Never copy a Windows native addon into a Linux container.
If users can submit URLs, apply a separate destination and network policy in your service. The job URL validator alone is not a complete SSRF defense.
9. Pin and verify your runtime
The published SDKs are alpha releases. Pin the version you tested, verify the native binary on the target platform and run a small fixture before deploying a worker.
Development-source documentation can describe changes that are not present in the registry package. Review the implementation status and package version before relying on an individual method.
10. Operational handoff checklist
- Job owner, source policy and target output directory are documented.
- Input, configuration, runtime version and state have a durable location.
- Only one writer can operate on each output directory.
- Shutdown waits for cancellation to complete before another worker resumes.
- Reports, errors, disk usage and source-specific request rates are monitored.
- A small fixture and realistic failure cases are exercised on the target platform.