Give users turns at batch processing in the self-hosted PostgreSQL queue
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Reducto","colors":{"primary":"#5c0c5c","light":"#c77dba","dark":"#5c0c5c"},"logo":{"light":"https://cdn.reducto.ai/logo.svg","dark":"https://cdn.reducto.ai/logo-dark.svg"},"favicon":"https://mintcdn.com/reducto/7owl8-bq0hdh9XB8/favicon.ico?fit=max\u0026auto=format\u0026n=7owl8-bq0hdh9XB8\u0026q=85\u0026s=90372b27ca6d42c4f6192cbba673afb5","api":{"examples":{"languages":["python","javascript","go"]}},"appearance":{"default":"light"},"navbar":{"links":[{"href":"https://reducto.ai/?utm_source=docs\u0026utm_medium=referral\u0026utm_campaign=docs_product_bridge\u0026utm_content=navbar_product","label":"Product"},{"href":"https://reducto.ai/blog","label":"Blog"}],"primary":{"type":"button","label":"Log In","href":"https://studio.reducto.ai/"}},"footer":{"socials":{"x":"https://x.com/reductoai","linkedin":"https://www.linkedin.com/company/reducto-ai"},"links":[{"header":"Product","items":[{"label":"Homepage","href":"https://reducto.ai/"},{"label":"Pricing","href":"https://reducto.ai/pricing"},{"label":"Playground","href":"https://studio.reducto.ai/"}]},{"header":"Company","items":[{"label":"Careers","href":"https://reducto.ai/careers"},{"label":"Blog","href":"https://reducto.ai/blog"},{"label":"Support","href":"mailto:support@Reducto.ai"}]},{"header":"Legal","items":[{"label":"Privacy Policy","href":"https://reducto.ai/privacy"},{"label":"Terms of Service","href":"https://reducto.ai/terms"}]}]},"fonts":{"heading":{"family":"Reducto Sans Bold","source":"https://cdn.reducto.ai/fonts/ReductoSansBold.woff2","format":"woff2"},"body":{"family":"Reducto Sans","source":"https://cdn.reducto.ai/fonts/ReductoSans.woff2","format":"woff2"}},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"styling":{"latex":true},"navigation":{"global":{"anchors":[{"anchor":"Status","icon":"signal","href":"https://status.reducto.ai"},{"anchor":"Studio","icon":"browser","href":"https://studio.reducto.ai"},{"anchor":"Support","icon":"envelope","href":"mailto:support@reducto.ai"},{"anchor":"Model Versions","icon":"bell","href":"/reference/model-versions"},{"anchor":"Changelog","icon":"clock-rotate-left","href":"/reference/changelog"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"reducto","hasAudioNarration":false,"actualSubdomain":"reducto","customDomains":["docs.reducto.ai"],"gitSource":{"type":"github","owner":"reductoai","repo":"api","deployBranch":"main","contentDirectory":"docs","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae2d960ede4fef7af72efa4","collectionId":"c3e5f311-6fe0-49e7-8249-740ef57ac6ab","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae2d960ede4fef7af72efa4"},"feedback":{"issues":false,"edits":false,"thumbs":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"REMOVE_BRANDING":{"status":"ENABLED"},"CONTEXTUAL_FEEDBACK":{"status":"ENABLED"},"CODE_SNIPPET_FEEDBACK":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6ae3acfdf5ef0fb7e1c11d94","clientVersion":"0.0.4021","searchFilterCounts":[{"language":"default","tag":"Documentation","count":81},{"language":"default","tag":"API Reference","count":36},{"language":"default","tag":"SDKs","count":30},{"language":"default","tag":"Document Processing","count":24},{"language":"default","tag":"Configurations","count":18},{"language":"default","tag":"Core Methods","count":18},{"language":"default","tag":"On-premise Resources","count":16},{"language":"default","tag":"Core Functions","count":15},{"language":"default","tag":"Reference","count":11},{"language":"default","tag":"Utilities","count":10}]},"assistantConfig":{"deflection":{"enabled":true,"email":"support@reducto.ai","showHelpButton":true}},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"per-site-search-delta","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-private-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"onprem/fair_queueing","slug":"/onprem/fair_queueing","pageMetadata":{"title":"Self-hosted fair queueing with Reducto","description":"Give users turns at batch processing in the self-hosted PostgreSQL queue","href":"/onprem/fair_queueing"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Give users turns at batch processing in the self-hosted PostgreSQL queue\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];const PasswordProtect=({children})=>{const[password,setPassword]=useState(``);const[isAuthenticated,setIsAuthenticated]=useState(false);const[error,setError]=useState(``);const correctPasswordHash=`9daff39ca2584edc54444193f62e5e54dce0bcd5e5d604b1748c79bfb3d7d1fd`;const hashPassword=async inputPassword=>{const encoder=new TextEncoder;const data=encoder.encode(inputPassword);const hashBuffer=await crypto.subtle.digest(`SHA-256`,data);const hashArray=Array.from(new Uint8Array(hashBuffer));return hashArray.map(b=>b.toString(16).padStart(2,`0`)).join(``)};useEffect(()=>{const storedPassword=localStorage.getItem(`reducto-onprem-password`);if(storedPassword){checkStoredPassword(storedPassword)}},[]);const checkStoredPassword=async storedPassword=>{const hashedStored=await hashPassword(storedPassword);if(hashedStored===correctPasswordHash){setIsAuthenticated(true);setError(``)}};const handleSubmit=async e=>{e.preventDefault();const hashedInput=await hashPassword(password);if(hashedInput===correctPasswordHash){setIsAuthenticated(true);setError(``);localStorage.setItem(`reducto-onprem-password`,password)}else{setError(`Incorrect password. Please try again.`);setPassword(``)}};if(isAuthenticated){return _jsx(_Fragment,{children})}return _jsxs(`div`,{style:{padding:`2rem`,border:`2px solid #e2e8f0`,borderRadius:`8px`,textAlign:`center`,margin:`2rem 0`},children:[_jsx(`div`,{style:{fontSize:`2rem`,marginBottom:`1rem`},children:`🔒`}),_jsx(`h2`,{children:`Protected Content`}),_jsx(`p`,{children:`This content requires a password to access.`}),_jsxs(`form`,{onSubmit:handleSubmit,style:{marginTop:`1rem`},children:[_jsx(`input`,{type:`password`,value:password,onChange:e=>setPassword(e.target.value),placeholder:`Enter password`,style:{padding:`0.5rem`,border:`1px solid #cbd5e0`,borderRadius:`4px`,marginRight:`0.5rem`,fontSize:`1rem`}}),_jsx(`button`,{type:`submit`,style:{padding:`0.5rem 1rem`,backgroundColor:`#5c0c5c`,color:`white`,border:`none`,borderRadius:`4px`,cursor:`pointer`,fontSize:`1rem`},children:`Unlock`})]}),error\u0026\u0026_jsx(`p`,{style:{color:`red`,marginTop:`1rem`},children:error})]})};function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,CodeGroup,Heading,Table,_MdxComponentBoundary}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!_MdxComponentBoundary)_missingMdxReference(`_MdxComponentBoundary`,true);return _jsx(_MdxComponentBoundary,{name:`PasswordProtect`,children:_jsxs(PasswordProtect,{children:[_jsx(_components.p,{children:`Fair queueing rotates available worker slots among users with queued work. A large\ndocument receives a separate turn for each batch, so its backlog cannot occupy\nevery subsequent slot ahead of another user.`}),_jsx(Heading,{level:`3`,id:`when-to-use-fair-queueing`,children:`When to use fair queueing`}),_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Several users share the legacy PostgreSQL compute workers.`}),`\n`,_jsx(_components.li,{children:`One user’s multi-batch documents delay other users’ queued work.`}),`\n`,_jsx(_components.li,{children:`You need fair dispatch opportunities alongside pages-per-second admission limits.`}),`\n`]}),_jsx(Heading,{level:`3`,id:`enable-fair-queueing`,children:`Enable fair queueing`}),_jsxs(_components.p,{children:[_jsx(_components.code,{children:`ONPREM_FAIR_QUEUE_ENABLED`}),` defaults to `,_jsx(_components.code,{children:`false`}),`. Set it to `,_jsx(_components.code,{children:`true`}),` on every legacy\non-prem worker after upgrading the database, API pods, and worker pods. This\nsetting applies to the PostgreSQL compute queue, including legacy traffic during\na streaq migration. It does not change streaq scheduling.`]}),_jsx(_components.p,{children:`Upgrade in this order:`}),_jsxs(_components.ol,{children:[`\n`,_jsx(_components.li,{children:`Apply all three database migrations with the flag disabled. They add queue indexes,\nbackfill identities from saved job metadata where available, and install the\nPostgreSQL claim function.`}),`\n`,_jsx(_components.li,{children:`Upgrade all API and worker pods with the flag still disabled. New requests\npersist their scheduling identity even while fair queueing is off.`}),`\n`,_jsx(_components.li,{children:`Pause new submissions and drain existing work if all queued work must receive\nper-user fairness immediately. Tasks enqueued while disabled remain runnable\nas one anonymous group after enabling; there is no automatic queue backfill.`}),`\n`,_jsxs(_components.li,{children:[`Set `,_jsx(_components.code,{children:`ONPREM_FAIR_QUEUE_ENABLED=true`}),` and restart the API and all legacy worker pods.\nMixed FIFO and fair consumers do not\nprovide a fairness guarantee until every consumer uses fair scheduling.`]}),`\n`]}),_jsx(_components.p,{children:`The migration backfill and index builds hold queue-table locks. Schedule a\nmaintenance window based on the existing queue size, even with the flag disabled.`}),_jsxs(_components.p,{children:[`Set `,_jsx(_components.code,{children:`ONPREM_FAIR_QUEUE_ENABLED=false`}),` and restart the API and all legacy worker pods\nto restore priority-first FIFO and the original metrics query without per-user logs.\nLeaving the variable unset also disables fair queueing and these logs.\nQueued tasks stay in the same tables and do not need to move. Keep the additive\ndatabase migrations in place when rolling back the flag.`]}),_jsx(_components.p,{children:`While disabled, queue operations use the original columns without identity lookup\nqueries, fair-queue cursor access, or per-user metrics queries. Existing queue\ntables continue to process work, and PostgreSQL still maintains installed indexes\nand column defaults. The same drain guidance applies when re-enabling.`}),_jsx(Heading,{level:`3`,id:`identify-users`,children:`Identify users`}),_jsxs(_components.p,{children:[`Send a stable `,_jsx(_components.code,{children:`user-id`}),` header with requests to `,_jsx(_components.code,{children:`/parse`}),` or `,_jsx(_components.code,{children:`/parse_async`}),`.`]}),_jsx(_components.p,{children:`Queue identity is independent of the pages-per-second throttle setting. Enabling\nfair queueing does not change page-throttle admission limits or rejection behavior.`}),_jsx(Heading,{level:`3`,id:`configuration`,children:`Configuration`}),_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Setting or header`}),_jsx(_components.th,{children:`Default`}),_jsx(_components.th,{children:`Behavior`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`ONPREM_FAIR_QUEUE_ENABLED`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`false`})}),_jsx(_components.td,{children:`Enables fair scheduling on legacy workers and per-user scrape logs on API pods. Restart the pods after changing it.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`user-id`})}),_jsx(_components.td,{children:`Unset, anonymous group`}),_jsx(_components.td,{children:`Scheduling identity for on-prem requests; at most 1,024 characters when fairness is enabled.`})]})]})]}),_jsx(_components.p,{children:`When fair queueing is enabled, on-prem requests whose selected identity exceeds\nthe limit return HTTP 400 before creating a job. Disabled and hosted requests\nretain their existing header behavior. Use opaque identifiers: when enabled,\nthe operator’s scrape logs include these IDs. Keep personal data, secrets, and\ncredentials out of the headers; truncating logged IDs is not redaction.`}),_jsx(Heading,{level:`3`,id:`setup-and-request-examples`,children:`Setup and request examples`}),_jsxs(_components.p,{children:[`After the migrations and application upgrades above, set the flag on both\nDeployments. The Kubernetes example uses your namespace and Deployment names.\nWhen Helm manages these workloads, also save the environment setting in your\ndeployment configuration so subsequent upgrades retain it. Set\n`,_jsx(_components.code,{children:`REDUCTO_API_URL`}),` to your self-hosted API URL and `,_jsx(_components.code,{children:`REDUCTO_API_KEY`}),` to its API key\nfor the request examples.`]}),_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`Kubernetes`,numberOfLines:`5`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`kubectl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --namespace`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$NAMESPACE`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` set`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` env`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` deployment/\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$API_DEPLOYMENT`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` deployment/\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$WORKER_DEPLOYMENT`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ONPREM_FAIR_QUEUE_ENABLED=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`kubectl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --namespace`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$NAMESPACE`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` rollout`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` status`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` deployment/\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$API_DEPLOYMENT`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`kubectl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --namespace`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$NAMESPACE`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` rollout`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` status`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` deployment/\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$WORKER_DEPLOYMENT`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`Python`,numberOfLines:`14`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`14`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` os`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`response `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests.post(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` os.environ[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"REDUCTO_API_URL\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`].rstrip(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"/\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`+`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"/parse_async\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` json`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"input\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://ci.reducto.ai/onepager.pdf\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` headers`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"user-id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"document-review-app\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Bearer \"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` +`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` os.environ[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"REDUCTO_API_KEY\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` timeout`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`600`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`response.raise_for_status()`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(response.json())`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`Node.js`,numberOfLines:`12`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`12`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` baseUrl`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` process`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`REDUCTO_API_URL`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`replace`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D16969`},children:`/`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-light-font-weight\":`bold`,\"--shiki-dark\":`#D7BA7D`,\"--shiki-dark-font-weight\":`inherit`},children:`\\\\/`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#DCDCAA`},children:`$`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D16969`},children:`/`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` response`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` fetch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`baseUrl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"/parse_async`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` method:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"POST\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` headers:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"application/json\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\" `Bearer \"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`process`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`env`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`REDUCTO_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"user-id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"document-review-app\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` body:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` JSON`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`stringify`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`input:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://ci.reducto.ai/onepager.pdf\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }),`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`!`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`response`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ok`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`throw`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` Error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`Request failed: \"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`response`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`status`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` response`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`json`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`());`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`cURL`,numberOfLines:`5`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --fail-with-body`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:' \"${'}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`REDUCTO_API_URL`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`%/`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`}/parse_async\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$REDUCTO_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"user-id: document-review-app\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --data`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{\"input\":\"https://ci.reducto.ai/onepager.pdf\"}'`})]}),`\n`]})})})]}),_jsx(Heading,{level:`3`,id:`response-structure`,children:`Response structure`}),_jsx(_components.p,{children:`The asynchronous request returns a job ID after acceptance. Fair queueing does\nnot add fields to the response or change how you retrieve the result.`}),_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`3`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"job_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"7600c8c5-a52f-49d2-8a7d-d75d1b51e141\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsxs(_components.p,{children:[`Use this ID to `,_jsx(_components.a,{href:`/workflows/async-overview`,children:`retrieve the job result`}),`.\nSynchronous `,_jsx(_components.code,{children:`/parse`}),` requests return the existing\n`,_jsx(_components.a,{href:`/parse/response-format`,children:`Parse response`}),` after processing finishes.`]}),_jsx(Heading,{level:`3`,id:`scheduling-guarantees`,children:`Scheduling guarantees`}),_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Users take turns before priority is considered. Within a user, priority tasks\nrun before normal tasks, and tasks at the same priority start in FIFO order.`}),`\n`,_jsx(_components.li,{children:`Each turn starts one compute task: a batch or job preparation. A single-batch\njob keeps its inline processing path within its preparation turn.`}),`\n`,_jsx(_components.li,{children:`One active user can use every free worker. Running work finishes normally;\nnewly active users wait for an available slot.`}),`\n`,_jsx(_components.li,{children:`Turns do not guarantee equal pages per second, CPU time, or completion order.\nBatch sizes and processing times can differ. Completion work keeps its existing\nIO queue scheduling.`}),`\n`]}),_jsx(Heading,{level:`3`,id:`database-load`,children:`Database load`}),_jsx(_components.p,{children:`The scheduler uses indexed lookups for the next user and task. It does not count,\nsort, or rank the full backlog on each claim. Each claim runs as one PostgreSQL\nfunction call in autocommit mode. Its shared cursor lock covers only database\nwork, with no intervening client round trips or separate commit request. Claims\nare serialized; batches execute concurrently after the locks are released.`}),_jsxs(_components.p,{children:[`More submitted tasks still require more writes and storage. Keep PostgreSQL\nautovacuum healthy and avoid long-lived transactions that prevent cleanup of\ndeleted queue rows. Monitor claim latency and cursor lock waits as worker\nconcurrency increases. Existing exact queue-depth metrics use `,_jsx(_components.code,{children:`COUNT(*)`}),`, so\ntheir database cost grows with backlog independently of fair scheduling.`]}),_jsx(Heading,{level:`3`,id:`queue-depth-logs`,children:`Queue-depth logs`}),_jsxs(_components.p,{children:[`With `,_jsx(_components.code,{children:`ONPREM_FAIR_QUEUE_ENABLED=true`}),` on the API pods, every on-prem `,_jsx(_components.code,{children:`/metrics`}),`\nscrape logs an `,_jsx(_components.code,{children:`onprem.queue_depth.snapshot`}),` summary and up to 100\n`,_jsx(_components.code,{children:`onprem.queue_depth.user`}),` entries, selecting the largest queued compute backlogs. This\nalso applies to `,_jsx(_components.code,{children:`/prometheus`}),` and\nrequires no separate logging setting. When the flag is false or unset, scrapes\nuse the original total-count query with no per-user counting or queue-depth logs.\nRestart the API pods after changing the flag. JSON and Prometheus responses keep their\nexisting metrics; user IDs are not added as Prometheus labels.`]}),_jsxs(_components.p,{children:[`User entries contain `,_jsx(_components.code,{children:`user_id`}),`, `,_jsx(_components.code,{children:`user_key`}),`, `,_jsx(_components.code,{children:`normal_depth`}),`, `,_jsx(_components.code,{children:`priority_depth`}),`, and\ntheir sum, `,_jsx(_components.code,{children:`queue_depth`}),`. Logged IDs are limited to 256 characters;\n`,_jsx(_components.code,{children:`user_id_truncated=true`}),` marks shortened values. The full hashed `,_jsx(_components.code,{children:`user_key`}),`\ndistinguishes IDs with the same displayed prefix, including older oversized IDs.\nAnonymous work has `,_jsx(_components.code,{children:`user_id=null`}),` and `,_jsx(_components.code,{children:`user_key=\"anonymous\"`}),`.\nThe shared `,_jsx(_components.code,{children:`scrape_id`}),` ties entries to their summary, which is logged even when\nthe queues are empty. Its `,_jsx(_components.code,{children:`user_count`}),`, `,_jsx(_components.code,{children:`logged_user_count`}),`, and\n`,_jsx(_components.code,{children:`omitted_user_count`}),` distinguish a complete listing from capped detail. Overall\nqueue totals remain exact regardless of the detail limit. Counts describe waiting compute tasks, including job\npreparation; running tasks are excluded. Completion queues contribute only to\nthe summary’s `,_jsx(_components.code,{children:`io_depth`}),`, `,_jsx(_components.code,{children:`priority_io_depth`}),`, and overall totals.`]}),_jsx(_components.p,{children:`The scrape groups the existing count scan by indexed user key and reads one\nidentity payload only for groups selected for logging. It reuses these counts\nfor the response and holds no scheduler locks. Exact counting still scales with\nqueued tasks. Each scrape emits at most 101 queue-depth log entries; scrape\nfrequency still affects total log volume.`}),_jsx(Heading,{level:`3`,id:`inspect-recent-jobs`,children:`Inspect recent jobs`}),_jsxs(_components.p,{children:[_jsx(_components.code,{children:`/jobs`}),` lists jobs in the authenticated organization. On deployments that use\n`,_jsx(_components.code,{children:`user-id`}),` as the organization ID, send the same header used to submit the job.\nThe examples set `,_jsx(_components.code,{children:`exclude_configs=true`}),` to omit saved request configurations;\nthis option defaults to `,_jsx(_components.code,{children:`false`}),`.`]}),_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`Python`,numberOfLines:`14`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`14`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` os`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`response `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests.get(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` os.environ[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"REDUCTO_API_URL\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`].rstrip(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"/\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`+`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"/jobs\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` params`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"exclude_configs\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`True`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` headers`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"user-id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"document-review-app\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Bearer \"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` +`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` os.environ[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"REDUCTO_API_KEY\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` timeout`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`30`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`response.raise_for_status()`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(response.json())`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`Node.js`,numberOfLines:`9`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`9`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` baseUrl`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` process`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`REDUCTO_API_URL`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`replace`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D16969`},children:`/`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-light-font-weight\":`bold`,\"--shiki-dark\":`#D7BA7D`,\"--shiki-dark-font-weight\":`inherit`},children:`\\\\/`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#DCDCAA`},children:`$`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D16969`},children:`/`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` response`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` fetch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`baseUrl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"/jobs?exclude_configs=true`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` headers:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\" `Bearer \"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`process`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`env`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`REDUCTO_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"user-id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"document-review-app\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`!`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`response`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ok`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`throw`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` Error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`Request failed: \"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`response`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`status`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` response`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`json`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`());`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`cURL`,numberOfLines:`3`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --fail-with-body`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:' \"${'}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`REDUCTO_API_URL`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`%/`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`}/jobs?exclude_configs=true\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$REDUCTO_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"user-id: document-review-app\"`})]}),`\n`]})})})]}),_jsx(_components.p,{children:`For example, a newly accepted job can appear as:`}),_jsx(CodeBlock,{filename:``,numberOfLines:`17`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`17`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"jobs\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"job_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"7600c8c5-a52f-49d2-8a7d-d75d1b51e141\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Pending\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Parse\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"raw_config\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"created_at\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2026-09-24T12:00:00Z\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"source\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"num_pages\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"total_pages\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"duration\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"bucket\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"next_cursor\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsxs(_components.p,{children:[_jsx(_components.code,{children:`next_cursor=null`}),` means there are no more results. Otherwise, send the returned\ncursor as the next request’s `,_jsx(_components.code,{children:`cursor`}),` query parameter.`]}),_jsx(Heading,{level:`3`,id:`troubleshooting`,children:`Troubleshooting`}),_jsx(Heading,{level:`4`,id:`a-user’s-tasks-appear-in-the-anonymous-group`,children:`A user’s tasks appear in the anonymous group`}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Problem`}),`: Queue-depth logs show `,_jsx(_components.code,{children:`user_id=null`}),` for work you expected to identify.`]}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Solution`}),`: Send a nonempty, stable `,_jsx(_components.code,{children:`user-id`}),`. Confirm your proxy forwards the header. Jobs submitted before identity\ncapture was available can remain anonymous; new headers cannot relabel them.`]}),_jsx(Heading,{level:`4`,id:`metrics-scrapes-produce-no-per-user-logs`,children:`Metrics scrapes produce no per-user logs`}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Problem`}),`: `,_jsx(_components.code,{children:`/metrics`}),` returns queue totals but no `,_jsx(_components.code,{children:`onprem.queue_depth.user`}),` entries.`]}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Solution`}),`: Set `,_jsx(_components.code,{children:`ONPREM_FAIR_QUEUE_ENABLED=true`}),` on the API pods as well as the\nlegacy workers, then restart them. This logging path requires PostgreSQL.\nEmpty compute queues produce only the snapshot summary; running tasks do not\ncontribute to queue depth. Check `,_jsx(_components.code,{children:`omitted_user_count`}),` when a particular user is\nabsent from the largest 100 backlogs.`]}),_jsx(Heading,{level:`4`,id:`another-user-still-waits-after-enablement`,children:`Another user still waits after enablement`}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Problem`}),`: A newly submitted job does not start immediately.`]}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Solution`}),`: Verify every legacy worker has restarted with the flag enabled.\nWorkers finish running batches before taking another turn; fair queueing does\nnot preempt work. Check that clients send distinct identities and that the work\nuses the PostgreSQL queue. Streaq scheduling follows its own policy.`]}),_jsx(Heading,{level:`4`,id:`a-request-returns-http-400-for-an-identity-header`,children:`A request returns HTTP 400 for an identity header`}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Problem`}),`: The error says the selected header must not exceed 1,024 characters.`]}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Solution`}),`: Use a shorter stable identifier. This input\nlimit applies only when fair scheduling is enabled.`]})]})})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{PasswordProtect,default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Self-hosted fair queueing with Reducto","description":"Give users turns at batch processing in the self-hosted PostgreSQL queue","href":"/onprem/fair_queueing"}}},"mdxSourceWithNoJs":null,"noJsSplices":[[19,38,""],[151,2252,")=>null;function _cr"]]},"mdxExtracts":{"tableOfContents":[{"title":"When to use fair queueing","slug":"when-to-use-fair-queueing","depth":3,"children":[]},{"title":"Enable fair queueing","slug":"enable-fair-queueing","depth":3,"children":[]},{"title":"Identify users","slug":"identify-users","depth":3,"children":[]},{"title":"Configuration","slug":"configuration","depth":3,"children":[]},{"title":"Setup and request examples","slug":"setup-and-request-examples","depth":3,"children":[]},{"title":"Response structure","slug":"response-structure","depth":3,"children":[]},{"title":"Scheduling guarantees","slug":"scheduling-guarantees","depth":3,"children":[]},{"title":"Database load","slug":"database-load","depth":3,"children":[]},{"title":"Queue-depth logs","slug":"queue-depth-logs","depth":3,"children":[]},{"title":"Inspect recent jobs","slug":"inspect-recent-jobs","depth":3,"children":[]},{"title":"Troubleshooting","slug":"troubleshooting","depth":3,"children":[]},{"title":"A user’s tasks appear in the anonymous group","slug":"a-user’s-tasks-appear-in-the-anonymous-group","depth":4,"children":[]},{"title":"Metrics scrapes produce no per-user logs","slug":"metrics-scrapes-produce-no-per-user-logs","depth":4,"children":[]},{"title":"Another user still waits after enablement","slug":"another-user-still-waits-after-enablement","depth":4,"children":[]},{"title":"A request returns HTTP 400 for an identity header","slug":"a-request-returns-http-400-for-an-identity-header","depth":4,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"reducto","siteName":"Reducto","title":"Self-hosted fair queueing with Reducto - Reducto","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-06T14:50:34.577Z","originalFileLocation":"onprem/fair_queueing.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"light\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Give users turns at batch processing in the self-hosted PostgreSQL queue\">\u003cmeta data-mint-head name=\"application-name\" content=\"Reducto\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/reducto/riSUMTseceMg4CLB/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/reducto/riSUMTseceMg4CLB/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/reducto/riSUMTseceMg4CLB/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/reducto/riSUMTseceMg4CLB/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/reducto/riSUMTseceMg4CLB/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/reducto/riSUMTseceMg4CLB/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/reducto/riSUMTseceMg4CLB/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/reducto/riSUMTseceMg4CLB/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/reducto/riSUMTseceMg4CLB/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Self-hosted fair queueing with Reducto - Reducto\">\u003cmeta data-mint-head property=\"og:description\" content=\"Give users turns at batch processing in the self-hosted PostgreSQL queue\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Reducto\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.reducto.ai/onprem/fair_queueing\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://reducto.mintlify.app/_mintlify/api/og/v2?division=On-premise+Resources\u0026amp;title=Self-hosted+fair+queueing+with+Reducto\u0026amp;description=Give+users+turns+at+batch+processing+in+the+self-hosted+PostgreSQL+queue\u0026amp;theme=e351366ecfb2cc50f96edafd\u0026amp;signature=7c66102775fd9e44579b42302a91cde4d58fc8d4324027b95ae539a18325d8ed\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Self-hosted fair queueing with Reducto - Reducto\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Give users turns at batch processing in the self-hosted PostgreSQL queue\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://reducto.mintlify.app/_mintlify/api/og/v2?division=On-premise+Resources\u0026amp;title=Self-hosted+fair+queueing+with+Reducto\u0026amp;description=Give+users+turns+at+batch+processing+in+the+self-hosted+PostgreSQL+queue\u0026amp;theme=e351366ecfb2cc50f96edafd\u0026amp;signature=7c66102775fd9e44579b42302a91cde4d58fc8d4324027b95ae539a18325d8ed\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/reducto/riSUMTseceMg4CLB/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Reducto\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#5c0c5c\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.reducto.ai/onprem/fair_queueing\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/onprem/fair_queueing.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.reducto.ai/#organization\",\"name\":\"Reducto\",\"url\":\"https://docs.reducto.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://cdn.reducto.ai/logo.svg\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.reducto.ai#website\",\"name\":\"Reducto\",\"url\":\"https://docs.reducto.ai\",\"publisher\":{\"@id\":\"https://docs.reducto.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.reducto.ai/onprem/fair_queueing#webpage\",\"url\":\"https://docs.reducto.ai/onprem/fair_queueing\",\"name\":\"Self-hosted fair queueing with Reducto\",\"description\":\"Give users turns at batch processing in the self-hosted PostgreSQL queue\",\"dateModified\":\"2026-10-06T14:50:34.577Z\",\"isPartOf\":{\"@id\":\"https://docs.reducto.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.reducto.ai/onprem/fair_queueing#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.reducto.ai/onprem/fair_queueing#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"On-premise Resources\",\"item\":\"https://docs.reducto.ai/onprem/hybrid-vpc-deployment\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Self-hosted fair queueing with Reducto\",\"item\":\"https://docs.reducto.ai/onprem/fair_queueing\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.reducto.ai/onprem/fair_queueing#article\",\"headline\":\"Self-hosted fair queueing with Reducto\",\"name\":\"Self-hosted fair queueing with Reducto\",\"description\":\"Give users turns at batch processing in the self-hosted PostgreSQL queue\",\"url\":\"https://docs.reducto.ai/onprem/fair_queueing\",\"mainEntityOfPage\":{\"@id\":\"https://docs.reducto.ai/onprem/fair_queueing#webpage\"},\"dateModified\":\"2026-10-06T14:50:34.577Z\",\"publisher\":{\"@id\":\"https://docs.reducto.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.reducto.ai#website\"}}]}\u003c/script>","siteName":"Reducto","nav":{"global":{"anchors":[{"anchor":"Status","icon":"signal","href":"https://status.reducto.ai"},{"anchor":"Studio","icon":"browser","href":"https://studio.reducto.ai"},{"anchor":"Support","icon":"envelope","href":"mailto:support@reducto.ai"},{"anchor":"Model Versions","icon":"bell","href":"/reference/model-versions"},{"anchor":"Changelog","icon":"clock-rotate-left","href":"/reference/changelog"}]},"tabs":[{"tab":"Documentation","groups":[{"group":"Get Started","public":true,"pages":[{"title":"Overview","icon":"house","sidebarTitle":"Overview","href":"/overview"},{"title":"API Quickstart","icon":"rocket","href":"/quickstart"},{"title":"Studio Quickstart","icon":"crystal-ball","href":"/studio-quickstart"},{"title":"Reducto API Reference for Coding Agents","sidebarTitle":"Agent Guide","icon":"robot","href":"/agent-guide"}]},{"group":"Developer Tools","pages":[{"title":"Reducto CLI","icon":"code","iconType":"solid","href":"/cli"},{"title":"Reducto MCP Server","icon":"plug","iconType":"solid","href":"/mcp-server"}]},{"group":"Core Functions","public":true,"pages":[{"group":"Upload","pages":[{"title":"Upload","href":"/upload/overview"},{"title":"Uploading Large Files","href":"/upload/large-files"}]},{"group":"Parse","pages":[{"title":"Parse overview","sidebarTitle":"Overview","href":"/parse/overview"},{"title":"Parse r-1","sidebarTitle":"Parse r-1","href":"/parse/r-1"},{"title":"Parse Response Format","sidebarTitle":"Response Format","href":"/parse/response-format"},{"title":"Parse Best Practices","sidebarTitle":"Best Practices","href":"/parse/best-practices"}]},{"group":"Extract","pages":[{"title":"Extract","sidebarTitle":"Overview","href":"/extract/overview"},{"title":"Extract Response Format","sidebarTitle":"Response Format","href":"/extract/response-format"},{"title":"Schema Keyword Support","sidebarTitle":"Schema Keywords","href":"/extract/schema-keywords"},{"title":"Extract Best Practices","sidebarTitle":"Best Practices","href":"/extraction/best-practices-extract"}]},{"title":"Split","href":"/split"},{"group":"Classify","pages":[{"title":"Classify","sidebarTitle":"Overview","href":"/classify/overview"},{"title":"Classify Response Format","sidebarTitle":"Response Format","href":"/classify/response-format"},{"title":"Classify Best Practices","sidebarTitle":"Best Practices","href":"/classify/best-practices"}]},{"title":"Edit","href":"/editing/edit-overview"}]},{"group":"Workflows and Pipelines","public":true,"pages":[{"group":"Pipelines","pages":[{"title":"Pipeline Basics","href":"/workflows/pipeline-basics"},{"title":"Multi-document Pipelines","href":"/workflows/multi-document-pipelines"}]},{"title":"Chaining API Calls","href":"/workflows/chaining-endpoints"},{"group":"Async Processing \u0026 Webhooks","pages":[{"title":"Async Processing","href":"/workflows/async-overview"},{"title":"Svix Webhooks","href":"/workflows/svix-webhooks"},{"title":"Direct Webhooks","href":"/workflows/direct-webhooks"},{"title":"Batch Processing","href":"/workflows/batch-processing"},{"title":"Batch Queue","href":"/workflows/batch-queue"},{"title":"Deleting Jobs \u0026 Uploads","href":"/workflows/deletion"}]}]},{"group":"Configurations","public":true,"pages":[{"title":"Configuration Overview","href":"/configs/overview"},{"group":"Parse Configurations","pages":[{"title":"r-1 configuration compatibility","sidebarTitle":"r-1 compatibility","href":"/configs/parse/r-1-configuration-compatibility"},{"group":"Enhance","pages":[{"title":"Agentic Modes","href":"/configs/parse/agentic-modes"},{"title":"Chart Extraction","href":"/configs/parse/chart-extraction"}]},{"group":"Retrieval","pages":[{"title":"Chunking Methods","href":"/configs/parse/chunking-methods"}]},{"group":"Formatting","pages":[{"title":"Table Output Formats","href":"/configs/parse/table-output-formats"},{"title":"Additional Document Data","href":"/configs/parse/additional-document-data"}]},{"group":"Spreadsheet","pages":[{"title":"Spreadsheet Processing","href":"/configs/parse/spreadsheet"}]},{"group":"Settings","pages":[{"title":"Processing Settings","href":"/configs/parse/ocr-settings"},{"title":"Page Ranges","href":"/configs/parse/page-ranges"},{"title":"Word and Cell Citations","href":"/configs/parse/citations"}]}]},{"group":"Extract Configurations","pages":[{"title":"Deep Extract","href":"/configs/extract/deep-extract"},{"title":"Array Extraction","href":"/configs/extract/array-extraction"},{"title":"Citations","href":"/configs/extract/citations"}]},{"group":"Split Configurations","pages":[{"title":"Split Configuration","href":"/configs/split/configuration"},{"title":"Deep Split","href":"/configs/split/deep-split"}]},{"group":"Classify Configurations","pages":[{"title":"Classify Configuration","href":"/configs/classify/configuration"}]},{"group":"Edit Configurations","pages":[{"title":"Form Schema","href":"/configs/edit/form-schema"}]}]},{"group":"Reference","public":true,"pages":[{"title":"Version Pinning","href":"/reference/version-pinning"},{"title":"Error Codes","href":"/reference/error-codes"},{"title":"Rate Limits","href":"/reference/rate-limits"},{"title":"Checking API Health \u0026 Usage","href":"/reference/checking-api-health"},{"title":"Concurrency Throttle","href":"/reference/throttling"},{"title":"Usage and Pricing","href":"/reference/credit-usage"},{"title":"Pricing Migration Guide","href":"/reference/pricing-migration"},{"title":"Usage Export API","href":"/reference/usage-export-api"},{"title":"Per-Page Billing Breakdown","href":"/reference/page-billing-breakdown"},{"title":"Glossary","href":"/reference/glossary"},{"title":"Frequently Asked Questions","href":"/reference/faq"}]},{"group":"Hidden pages","public":true,"hidden":true,"pages":[{"title":"Legacy Credit Usage and Rates","href":"/faq/legacy-credit-usage-overview"},{"title":"Legacy Credit Usage","href":"/reference/legacy-credit-usage"},{"title":"OpenAPI Schema","href":"/api-reference/openapi.json"}]},{"group":"Components","public":true,"pages":[{"title":"SpreadsheetViewer","href":"/components/spreadsheet-viewer"}]},{"group":"Enterprise Resources","public":true,"pages":[{"title":"Enterprise Readiness","href":"/enterprise/enterprise-readiness"},{"title":"Deployment options (Cloud, On-prem, Hybrid)","href":"/onprem/enterprise_deployment_options"}]},{"group":"Security and privacy","public":true,"pages":[{"title":"Data policies \u0026 compliance","href":"/security/policies"},{"title":"Filing Complaints","href":"/security/filing-complaints"},{"title":"EU data residency \u0026 processing","href":"/security/eu-data-residency"},{"title":"Single sign-on (SSO) FAQ","href":"/security/sso-saml-faq"}]},{"group":"On-premise Resources","icon":"archway","pages":[{"group":"Hybrid VPC","pages":[{"title":"Hybrid VPC Deployment","href":"/onprem/hybrid-vpc-deployment"},{"title":"Hybrid VPC — AWS S3","href":"/onprem/hybrid-vpc-aws"},{"title":"Hybrid VPC — Azure Blob Storage","href":"/onprem/hybrid-vpc-azure"},{"title":"Hybrid VPC — Box","href":"/onprem/hybrid-vpc-box"},{"title":"Hybrid VPC — Google Cloud Storage","href":"/onprem/hybrid-vpc-gcs"}]},{"title":"On-prem security model","href":"/onprem/security_model"},{"title":"Securing Reducto","href":"/onprem/securing_reducto"},{"title":"OCR provider configuration","href":"/onprem/ocr_options"},{"title":"LLM \u0026 service configuration options","href":"/onprem/llm_options"},{"title":"Database configuration","href":"/onprem/database_configuration"},{"title":"On-premise changelog","href":"/onprem/changelog"},{"title":"Observability \u0026 Monitoring","href":"/onprem/observability"},{"title":"Operations","description":"Runtime configuration for on-premise Reducto worker health and restart behavior","href":"/onprem/operations"},{"title":"Self-hosted fair queueing with Reducto","href":"/onprem/fair_queueing"},{"title":"Automatic file cleanup","description":"Configure automatic deletion of uploaded files in Reducto","href":"/onprem/file_cleanup"},{"title":"Air-gapped usage for billing","href":"/onprem/usage_for_billing"}]}]},{"tab":"API Reference","versions":[{"version":"Current","groups":[{"group":"Document Processing","pages":[{"openapi":"openapi.json post /parse","title":"Parse","href":"/api-reference/parse"},{"title":"Parse Async","openapi":"openapi.json post /parse_async","href":"/api-reference/async-parse"},{"openapi":"openapi.json post /upload","title":"Upload","href":"/api-reference/upload"},{"openapi":"openapi.json post /extract","title":"Extract","href":"/api-reference/extract"},{"openapi":"openapi.json post /extract_async","title":"Extract Async","href":"/api-reference/extract-async"},{"openapi":"openapi.json post /split","title":"Split","href":"/api-reference/split"},{"openapi":"openapi.json post /split_async","title":"Split Async","href":"/api-reference/split-async"},{"openapi":"openapi.json post /classify","title":"Classify","href":"/api-reference/classify"},{"openapi":"openapi.json post /classify_async","title":"Classify Async","href":"/api-reference/classify-async"},{"openapi":"openapi.json post /edit","title":"Edit","href":"/api-reference/edit"},{"openapi":"openapi.json post /edit_async","title":"Edit Async","href":"/api-reference/edit-async"},{"openapi":"openapi.json post /pipeline","title":"Pipeline","href":"/api-reference/pipeline"},{"openapi":"openapi.json post /pipeline_async","title":"Pipeline Async","href":"/api-reference/pipeline-async"}]},{"group":"Job Management","pages":[{"title":"Retrieve Job","openapi":"openapi.json get /job/{job_id}","href":"/api-reference/retrieve-parse"},{"openapi":"openapi.json post /cancel/{job_id}","title":"Cancel Job","href":"/api-reference/cancel-job"},{"title":"Delete Job","openapi":"openapi.json delete /job/{job_id}","href":"/api-reference/delete-job"},{"openapi":"openapi.json get /jobs","title":"Get Jobs","href":"/api-reference/get-jobs"}]},{"group":"File Management","pages":[{"title":"Delete Upload","openapi":"openapi.json delete /upload/{file_id}","href":"/api-reference/delete-upload"}]},{"group":"Utilities","pages":[{"openapi":"openapi.json post /configure_webhook","title":"Webhook Portal","href":"/api-reference/webhook-portal"},{"openapi":"openapi.json get /version","title":"Get Version","href":"/api-reference/get-version"}]}]},{"version":"Legacy API","pages":[{"title":"Legacy API","href":"/api-reference/legacy/parse"}]}]},{"tab":"Cookbooks","pages":[{"title":"Cookbooks","href":"/cookbooks/overview"}]},{"tab":"SDKs","versions":[{"version":"Python","groups":[{"group":"Get Started","pages":[{"title":"Python SDK Overview","sidebarTitle":"Overview","href":"/sdk/python/overview"}]},{"group":"Core Methods","pages":[{"title":"Upload","sidebarTitle":"Upload","href":"/sdk/python/upload"},{"title":"Parse","sidebarTitle":"Parse","href":"/sdk/python/parse"},{"title":"Extract","sidebarTitle":"Extract","href":"/sdk/python/extract"},{"title":"Split","sidebarTitle":"Split","href":"/sdk/python/split"},{"title":"Edit","sidebarTitle":"Edit","href":"/sdk/python/edit"},{"title":"Pipeline","sidebarTitle":"Pipeline","href":"/sdk/python/pipeline"}]},{"group":"Async \u0026 Utilities","pages":[{"title":"Async Client","sidebarTitle":"Async Client","href":"/sdk/python/async"},{"title":"Job Management","sidebarTitle":"Job Management","href":"/sdk/python/job-management"},{"title":"Error Handling","sidebarTitle":"Error Handling","href":"/sdk/python/error-handling"}]}]},{"version":"JavaScript","pages":[{"title":"JavaScript","href":"/sdk/javascript/overview"}]},{"version":"Go","pages":[{"title":"Go","href":"/sdk/go/overview"}]}]},{"tab":"Studio","pages":[{"title":"Studio","href":"/studio-parse"}]}]},"title":"Self-hosted fair queueing with Reducto - Reducto","buildId":"dpl_EnxDqhjaNc9a8MVa833TGULPd9uJ","deploymentId":"dpl_EnxDqhjaNc9a8MVa833TGULPd9uJ","dynamics":[],"chunks":[]}