Concurrency is how many pages a routine fetches at once. It is the single biggest lever on how long a run takes, and every routine is created with concurrency 1. Nothing in a scrape's output mentions it, which is how an 8,198-URL browser template quietly became a 48-hour run that nobody had estimated.
get_routine_concurrency
Title: Read a routine's concurrency Upstream: GET /user-templates/routine/:routineId/concurrency
apiKey(string, required).routineId(integer ≥ 1, required).
{
"name": "get_routine_concurrency",
"arguments": { "apiKey": "js_YOUR_API_KEY", "routineId": 5120 }
}{ "routine_id": 5120, "config_id": 4412, "concurrency": 1, "max": 20 }set_routine_concurrency
Title: Set a routine's concurrency Upstream: POST /user-templates/routine/:routineId/concurrency
apiKey(string, required).routineId(integer ≥ 1, required).concurrency(integer, required) — pages fetched at once. Out-of-range values are clamped server-side, not rejected.
{
"name": "set_routine_concurrency",
"arguments": { "apiKey": "js_YOUR_API_KEY", "routineId": 5120, "concurrency": 10 }
}{ "routine_id": 5120, "requested": 10, "concurrency": 10, "max": 20 }Read the concurrency field of the response for what was actually applied rather than assuming your number stuck.
Do the arithmetic first
wall-clock ≈ urls × seconds_per_url ÷ concurrency
http mode 1–5 s per url (a JSON endpoint is at the fast end)
browser mode 8–60 s per url (20 s is typical for a heavy retail product page)
8,198 urls × 21 s ÷ 1 ≈ 48 hours
8,198 urls × 21 s ÷ 10 ≈ 5 hoursChoosing a value
- The ceiling is 20, enforced on the server.
- Start at 3 on a site you have not run before.
- Go to 10 once a wave has come back clean.
- Stay at 3 on sites that fight back (captcha, challenge pages, login walls) even when capacity is free. Concurrency is a politeness setting as much as a speed setting; a target's anti-bot treats parallel access as a risk signal.
- 10–20 is the safe range for http-mode routines over a plain JSON endpoint.
- Measure your own seconds-per-URL from the first wave with
get_job_status, recompute the estimate once, then leave it alone.
Overload looks like success. Pushing too hard does not come back as errors; it comes back as empty results while every status still says completed. Measured on one job: 28% of URLs returned empty while a second run competed for the same routine; alone, the same job sat at 1.5%. The empty rate in diagnostics is your backpressure signal, and the only one you get. If it climbs after you raise concurrency, halve it and re-check.
Set the concurrency before launching a long run, and state the estimate out loud when you report. A fast run that quietly loses a quarter of its rows is worse than a slow one.