If there are many documents to be processed by a DocumentsCorePack service, it may occur that one service is not enough. This issue can be solved by enabling DocumentsCorePack (DCP) Load Balancing. It allows to scale up document generation power significantly. The Impact of Load-Balancing can be seen in this article: “Performance benchmark, limitations & scalability“.
This article outlines the functionality of such a DocumentsCorePack Load Balancing Service and how to install it.
Requirements: DocumentsCorePack (Online/OnPremise) version 2016.173 and higher.
The functionality of the Load Balancing Service
In the default setup, all document generation requests are assigned to the same service. The service processes one job after the other in the queue – comparable to a printing service. Although single document requests are prioritized (they will be generated between the batch document jobs), users might need to wait for the completion of a batch to get their document and if the batch is big they might need more than one cup of coffee! So if you run large batches it can be really helpful to have multiple services to get better performance.
The logic of the LoadBalancer works as described in the following figure.
Basically it allows splitting the workload to be handled by multiple services. The main priority is always on manually triggered document generation requests since users are actively waiting for the documents to be finished to continue their work.
Thus, with Load Balancing being active, there will always be at least one service exclusively reserved for single document generation jobs- e.g. DCP Service 1 in the below figure. At least one is reserved for batch document generation requests and background jobs (PowerAutomate or workflows) – DCP Service 2 and 3 in the below figure. The basic load balancing package will provide you with a total of 5 services.
It is possible to add even more services to your LoadBalancer, where you can define how many should be available for single document generation jobs as well as for batchs.
Figure 1: Functionality of the DCP Load Balancing Service (example with 3 working services)
How to configure a Load Balancing Service online?
First of all, please create a new service in DCP Online (If you have not set up a service yet, please have a look at this video with the corresponding blog article). Once you have created a new service, you will be provided with the Online Configuratin window where you can configure your service in detail. If you have already configured a service, you get an overview of your hosted service(s).
The Load Balancing licenses can be found on our website. You first have to choose which size of DocumentsCorePack you require and in the so opened window you can buy the DocumentsCorePackP Load Balancing Service. The minimum package contains five services. It is possible to add more services to your LoadBalance. This guarantees that the documents are generated as fast as possible.
The configuration for Load Balancing Service is very easy. Select the service you want to configure in the Online Configuration window and click on the [configure load balancing]-button (highlighted in yellow).
Figure 2: Online Configuration window
For example: There are 5 Load Balancing licenses available and want to configure all 5 and reserve 2 of them only for single documents and the rest are for batch document generation (see figure below).
Figure 3: Load Balancer Configuration window
How to create a Load Balancing Service in DocumentsCorePack On-Premise
(If you have not installed a service yet, please have a look at this article)
The creation of a Load Balancing Service in DocumentsCorePack On-Premise is different than in DocumentsCorePack Online. Therfore you need to set up a DCP service and categorize it as Load Balancing service. We recommend naming the service according to its future task (here: DCPLoadBalancer). Next, you create some more services and categorize them as subordinated to the Load Balancing Service.
Set a category for your Load Balancing Service
Basically you have to differentiate between the category for the main service and the category of the sub-services.
The category number for the main service consists of six digits and follows the below structure:
99XXYY
99….. categorizes the service as Load Balancing Service
XX….. defines how many services are subordinated to the Load Balancing Service
YY….. defines how many of these subordinated services are reserved for the generation of single documents only. It is mandatory to have at least 2 worker services for batch operations. That means the minimum configuration is 990301. If it is needed to have multiple single document services, it is mandatory to have at least 4 worker services and the configuration is 990402.
For example:
990502… There are 5 services subordinated to the Load Balancing Service and the first two services process single documents only. The other three services are reserved for the generation of batch documents.
991105… There are 11 services subordinated to the Load Balancing Service and the first five services process single documents only. The other six services are reserved for the generation of batch documents.
The categories must be set in the category field of the DCP On-Premise Service (highlighted in yellow below).
Please note: It is recommended to set the batch delay to 10 seconds.
Figure 4: Load Balancing Service for DCP ServerBased On-Premise
The Load Balancing Service can have many subordinated sub-services. The category number for the sub-service starts with 10 as you can see in the figure below. For each additional sub-service, the category number increases by 1 and continues with 11, 12, … As explained before, the category must be set in the category field, highlighted below.
Figure 5: Set category for the sub-service
How to remove the Load Balancing service (On-Premise)
- Make sure there is only one DCP Service running for the organization with the Category: 0
- Restore the default value for the “AzureServiceName” settingskey
The name of the key must be “AzureServiceName” and the value has to be “none” - Delete the “LBConfig” Settingskey
- Shut down and restart the DCP service
- Clear your browser cache and restart your browser
That’s it! we appreciate your feedback! Please share your thoughts by sending an email to support@mscrm-addons.com.