Web Farms and Web Garden Support
- 3 minutes to read
This document describes how to make web applications that use the Web Document Viewer or Report Designer’s Preview work properly in a clustered web environment (also known as Web Farms or Web Garden).
Web farms and web garden technologies allow you to run a web application on several web servers (web farms), or on the same server but in different processes, each process executed using its own processor (web garden). This is specified by the Internet Information Services (IIS) settings of the server host on which you deploy your web application.
By using a clustered environment, you can significantly improve the performance of large web applications. This, however, requires that XtraReports share its data between multiple processes/servers when a report is generated, printed or exported.
Do the following to adjust your Web reporting application to properly operate in web farms and the web garden:
Open reports in the Document Viewer using the OpenReport(String) (WebForms)) / Bind(String) (MVC) / Bind(String) (ASP.NET Core MVC) method overload passing a report’s unique name as a parameter.
Implement the ICachedReportSourceWebResolver interface to associate the report’s unique name with a CachedReportSourceWeb object that possesses the corresponding report. The Document Viewer requests the provided CachedReportSourceWeb object to generate a report document.
Documents generated using the CachedReportSourceWeb object are cached in the MemoryDocumentStorage storage by default. Utilize file storage instead by calling the UseFileDocumentStorage(String, StorageSynchronizationMode) (.NET Framework)/ UseFileDocumentStorage(String, StorageSynchronizationMode) (.NET Core) method. Pass InterProcess as a method parameter.
(This step is required for the Report Designer’s Preview) If the report includes interactive features, the Document Viewer recreates the document using the report instance that is stored in memory by default. Use the UseFileReportStorage(String, StorageSynchronizationMode) (.NET Framework)/ UseFileReportStorage(String, StorageSynchronizationMode) (.NET Core) method to specify a path to the directory to which the result of the report xml serialization will be saved and which the Document Viewer will use to recreate the document when the memory cache is empty. Pass InterProcess as a method parameter.
If the asynchronous export mode is enabled explicitly or content editing is enabled in an exported document, use the UseFileExportedDocumentStorage(String, StorageSynchronizationMode) (.NET Framework) / UseFileExportedDocumentStorage(String, StorageSynchronizationMode) (.NET Core) method to use file storage and the InterProcess synchronization mode.
Provide time settings for cleaning the in-memory cache that stores documents and reports. Create an instance of the CacheCleanerSettings object and register it in your application using the RegisterSingleton<T>(T) method.
Provide time settings for cleaning the file storage that stores documents, exported documents and reports. Create an instance of the StorageCleanerSettings object and register it in your application using the RegisterSingleton<T>(T) method.