“The faster, the better“: Certainly true when waiting for documents to be generated so you can finalize your daily tasks. This article will also give you an idea of the performance you can expect when using DocumentsCorePack to generate and process your documents.
It is important to note that typically it’s not sufficient to simply generate the document but to also process the document as required by your business process. Thus, we will also consider the impact of document processing going forward.
How long does it take to create a single document?
Starting with an important metric: On average, a “standard” 1-page document (e.g. a common quote) is generated and processed in ~3.5 seconds.
There are of course many factors that will have a major impact on this duration. Note: Detailed insights on the performance of your documents can be found inside the “Doc statistics” of your DocumentsCorePack service.
Key performance impact:
- “How large is the document?“: The size of the template and the amount of data mapped into the document will of course impact the time to create the document itself.
- Keep your template small: Avoid large high-res pictures, images, and unnecessary formatting in the template.
- Avoid unused relationships: Try to only load data you really need in your document.
- “How is the document processed?“: Depending on how your document is processed via DocumentsCorePack, the processing will take some time.
- Save to SharePoint: ~2-3s (Hint: file size is key)
- Attach to Email: ~0,5s
- Attach as Note: ~0,5s
- “How good is the connectivity of the DocumentsCorePack Service?“: The service configuration allows selecting the data center the service is hosted in. (Note: We do select the best bandwidth on default during service setup)
- “Are there other documents in the queue that need to be generated first?” One of the main drivers is naturally the workload of the DocumentsCorePack Service. What if many users do require documents to be generated every morning (e.g. accounting)? Or what if you need to generate a whole batch of documents? The answer to those questions will be given in the next section.
Scalability: How long does it take to generate high volumes of documents?
Important to know: When setting up a DocumentsCorePack service, this service is responsible to generate every document requested. All document requests from your organization (from users or a flow) are entering a queue and will be processed one at a time. Thus, a huge batch of documents can block the service for other users (see metrics below).
To overcome this issue, DocumentsCorePack supports Load-Balancing. It will provide you with additional services to handle document jobs in a parallel manner.
Key Metrics: To give you an idea of the achievable performance, the following table shows the time required to generate & process a batch of 1000 documents from a Flow in three different setups:
- Standard setup (1 service)
- Basic Load-Balancing setup (3 services for batches*)
- Basic Load-Balancing setup + 3 additional. services (6 services for batches*)
* In the basic Load-Balanced configuration you are provided with 5 services. Two services are always reserved for the DocumentsCorePack Dialog to avoid long wait times for users generating a single document during a bulk- operation.
|Use Case||1 Service||Load-Balanced|
|Generate 1000 documents||31 minutes||10 minutes||6 minutes|
|Generate 1000 documents|
& save them to SharePoint
|55 minutes||19 minutes||10 minutes|
|Generate 1000 documents|
& send them by E-mail
|49 minutes||16 minutes||9 minutes|
What limits performance?
Benchmark & Limitations: Next to the options to optimize the time required to generate & process single documents (see section 1), the maximum achievable performance is defined by the following limits:
- Number of Load-Balancing services: As can be seen above, a higher number of services typically reduces the processing time. Please note that the more services you have, the sooner you will hit limit #2.
- Service Protection API Limit (max 6000 requests in 5 minutes): Microsoft introduced a limit to ensure that users running applications cannot interfere with each other based on resource constraints. (See: Service Protection API limit )
Please note: Whereas the number of services can be scaled up, the API service protection is a hard- limit that cannot be overcome. On high volumes adding additional services will no longer improve your performance as the Service protection API limit will become the defining metric.
Example: While 6 services took 6 minutes to generate 1000 documents, 10 services actually took 6:30 minutes! The reason is the enforced delay between requests by Microsoft that you can see inside the “service logs” of your service:
Conclusion: Due to the limits and the metrics given above, the standard setup should be sufficient to handle most use-cases. If you have a very high utilization or need to create documents in batch, the Basic Load-Balancing provided by mscrm-addons.com gets you close to the best possible performance.
That’s it! We appreciate your feedback! Please share your thoughts by sending an email to email@example.com.