1"use strict";(self.webpackChunkpdftools_doc=self.webpackChunkpdftools_doc||[]).push([["14965"],{254706(e,n,r){r.r(n),r.d(n,{metadata:()=>o,default:()=>g,frontMatter:()=>a,contentTitle:()=>c,toc:()=>d,assets:()=>l});var o=JSON.parse('{"id":"guides/scale","title":"Scale Pdftools OCR Service","description":"Learn how to scale the Pdftools OCR Service.","source":"@site/ocr-service_versioned_docs/version-1.0.1/guides/scale.mdx","sourceDirName":"guides","slug":"/guides/scale","permalink":"/docs/ocr-service/1.0.1/guides/scale","draft":false,"unlisted":false,"tags":[{"inline":false,"label":"Guides","permalink":"/docs/ocr-service/1.0.1/tags/guides","description":"Step-by-step guides for configuring and using the Pdftools OCR Service."},{"inline":false,"label":"Configure ocr","permalink":"/docs/ocr-service/1.0.1/tags/configure-ocr","description":"Guides on configuring OCR processing settings in the Pdftools OCR Service."},{"inline":false,"label":"Scaling and architecture","permalink":"/docs/ocr-service/1.0.1/tags/scaling-and-architecture","description":"Documentation on scaling and architecture of the Pdftools OCR Service."}],"version":"1.0.1","frontMatter":{"title":"Scale Pdftools OCR Service","sidebar_label":"Scale","description":"Learn how to scale the Pdftools OCR Service.","keywords":["ocr","optical character recognition","text extraction","image to text","document digitization","scanned document processing","searchable pdf","text recognition","ocr service","document automation","image processing","text extraction from images","ocr api","ocr software","document conversion","pdftools","pdftools ocr","configure ocr","ocr configuration","scale","architecture","scaling"],"tags":["Guides","Configure OCR","Scaling and architecture"]},"sidebar":"ocrService","previous":{"title":"Monitor","permalink":"/docs/ocr-service/1.0.1/guides/monitor"},"next":{"title":"Work with profiles","permalink":"/docs/ocr-service/1.0.1/guides/profiles"}}'),s=r(474848),i=r(28453),t=r(366497);let a={title:"Scale Pdftools OCR Service",sidebar_label:"Scale",description:"Learn how to scale the Pdftools OCR Service.",keywords:["ocr","optical character recognition","text extraction","image to text","document digitization","scanned document processing","searchable pdf","text recognition","ocr service","document automation","image processing","text extraction from images","ocr api","ocr software","document conversion","pdftools","pdftools ocr","configure ocr","ocr configuration","scale","architecture","scaling"],tags:["Guides","Configure OCR","Scaling and architecture"]},c,l={},d=[{value:"Scaling worker nodes",id:"scaling-worker-nodes",level:2},{value:"Scaling manager nodes",id:"scaling-manager-nodes",level:2}];function h(e){let n={a:"a",admonition:"admonition",code:"code",h2:"h2",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:["The Pdftools OCR service uses a ",(0,s.jsx)(n.strong,{children:"master-worker"})," architecture. The central ",(0,s.jsx)(n.strong,{children:"master"})," node, called the ",(0,s.jsx)(n.strong,{children:"Pdftools OCR Service Manager"}),", distributes tasks to multiple ",(0,s.jsx)(n.strong,{children:"worker"})," nodes, called ",(0,s.jsx)(n.strong,{children:"Pdftools OCR Service Workers"}),", which perform the actual processing."]}),"\n",(0,s.jsxs)(n.p,{children:["In the Pdftools OCR Service installer, you can set up ",(0,s.jsx)(n.strong,{children:"Pdftools OCR Service Manager"})," that communicates with a ",(0,s.jsx)(n.strong,{children:"Pdftools OCR Service Worker"}),". The following diagram illustrates this configuration:"]}),"\n",(0,s.jsx)("div",{className:"resized-image-wrapper-medium",children:(0,s.jsx)("img",{src:(0,t.default)("/img/ocr/v-1-0-0/ocr-simple-setup.png"),alt:"This diagram illustrates the communication between the Conversion Service and the Pdftools OCR Service worker and manager nodes."})}),"\n",(0,s.jsx)(n.p,{children:"Learn how to scale the Pdftools OCR Service horizontally by configuring the manager to work with multiple worker nodes in this guide."}),"\n",(0,s.jsx)(n.h2,{id:"scaling-worker-nodes",children:"Scaling worker nodes"}),"\n",(0,s.jsx)(n.p,{children:"The manager node communicates with worker nodes through a RESTful API. In the scaled worker setup, you can create an architecture similar to the following:"}),"\n",(0,s.jsx)("div",{className:"resized-image-wrapper-medium",children:(0,s.jsx)("img",{src:(0,t.default)("/img/ocr/v-1-0-0/ocr-scale-worker-setup.png"),alt:"This diagram illustrates the communication between the Conversion Service and the Pdftools OCR Service Manager with a load balancer and two worker nodes."})}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["Locate the manager configuration file. In a default installation, the file is located at:","\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{children:"C:\\Program Files\\Pdftools\\Pdftools OCR Service\\PdftoolsOcrService\\appsettings.json\n"})}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["Point ",(0,s.jsx)(n.code,{children:"ServiceCommunication"})," to your load balancer:","\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-json",children:'{\n "ServiceCommunication": {\n "ServiceCommunicationType": "Rest",\n "ConnectionString": "http://localhost:8080/"\n }\n}\n'})}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["Install worker nodes on different host machines. You don\u2019t need to install the manager again.","\n",(0,s.jsx)("div",{className:"resized-image-wrapper-small",children:(0,s.jsx)("img",{src:(0,t.default)("/img/ocr/v-1-0-0/ocr-win-installer-worker.only.png"),alt:"Screenshot of the Pdftools OCR Service Windows MSI installer."})}),"\n"]}),"\n",(0,s.jsx)(n.li,{children:"Configure a load balancer to distribute requests to your worker nodes."}),"\n",(0,s.jsxs)(n.li,{children:["Locate the worker configuration file. In a default installation, the file is located at:","\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{children:"C:\\Program Files\\Pdftools\\Pdftools OCR Service\\PdftoolsOcrWorker\\appsettings.json\n"})}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["Add a license key to each worker node:","\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-json",children:'{\n "Licensing": {\n "LicenseKey": "<LICENSE_KEY>
1"\n }\n}\n'})}),"\n","In a default installation, the worker configuration file is located at:","\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{children:"C:\\Program Files\\Pdftools\\Pdftools OCR Service\\PdftoolsOcrWorker\\appsettings.json\n"})}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["Share a common file storage between all manager and worker nodes:","\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-json",children:'{\n "FileStorage": {\n "FileStorageType": "HostFileSystem",\n "FilesDirectoryPath": "F:/SharedFolder/ProgramData/Pdftools/OcrService/Files"\n }\n}\n'})}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"FileStorage"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"FileStorageType"}),": Storage system type (for example, ",(0,s.jsx)(n.code,{children:"HostFileSystem"}),")."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"FilesDirectoryPath"}),": Directory path for storing OCR-processed files."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["Make sure every ",(0,s.jsx)(n.strong,{children:"manager"})," and all ",(0,s.jsx)(n.strong,{children:"worker"})," nodes:","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["Uses the same ",(0,s.jsx)(n.code,{children:"FileStorage"})," settings."]}),"\n",(0,s.jsx)(n.li,{children:"Has read and write permission for the shared directory."}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"scaling-manager-nodes",children:"Scaling manager nodes"}),"\n",(0,s.jsx)(n.p,{children:"You can scale the manager nodes similarly to the worker nodes."}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["Switch to ",(0,s.jsx)(n.strong,{children:"PostgreSQL"})," instead of SQLite to support horizontal scaling of manager nodes. The PostgreSQL database lets you share the state of multiple managers. For more information, review ",(0,s.jsx)(n.a,{href:"/docs/ocr-service/1.0.1/guides/monitor#default-appsettingsjson",children:"Default appsettings.json"}),"."]})}),"\n",(0,s.jsx)("div",{className:"resized-image-wrapper-medium",children:(0,s.jsx)("img",{src:(0,t.default)("/img/ocr/v-1-0-0/ocr-scale-manager-worker-setup.png"),alt:"This diagram illustrates the communication between the Conversion Service, a load balancer, followed by two host systems with OCR manager nodes, a shared database, and another load balancer spreading the workload to two host systems with worker nodes."})}),"\n",(0,s.jsx)(n.p,{children:"The following steps add to the previous section, where worker nodes were already scaled."}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["Locate the manager configuration file. In a default installation, the file is located at:","\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{children:"C:\\Program Files\\Pdftools\\Pdftools OCR Service\\PdftoolsOcrService\\appsettings.json\n"})}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["Configure ",(0,s.jsx)(n.strong,{children:"PostgreSQL"}),":","\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-json",children:'{\n "Database": {\n "DatabaseType": "PostgreSql",\n "ConnectionString" : "User ID=myUser;Password=mySecurePassword;Server=my.database.com;Port=5432;Database=ocr-service-db;",\n "DeleteJobsAfterDays": 2\n }\n}\n'})}),"\n"]}),"\n",(0,s.jsx)(n.li,{children:"Install manager nodes on separate hosts."}),"\n",(0,s.jsx)(n.li,{children:"Configure a load balancer for the manager nodes."}),"\n"]})]})}function g(e={}){let{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(h,{...e})}):h(e)}},28453(e,n,r){r.d(n,{R:()=>t,x:()=>a});var o=r(296540);let s={},i=o.createContext(s);function t(e){let n=o.useContext(i);return o.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:t(e.components),o.createElement(i.Provider,{value:n},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.