Document Conversion Service uses an application pool for each converter to provide the ability to process multiple documents of the same type at the same time.

The application factory for each converter controls the maximum size of it's application pool through its MaxInstances setting. This value is set to "auto" when first installed, meaning that Document Conversion Service will automatically set the application pool size to a value appropriate to the capabilities of your computer, and only limited by your license model. This is the recommended setting to get the best experience from Document Conversion Service. Setting this to a value that is too high for the capabilities of the computer can cause the computer to work very slowly.

The application pool is dynamic and self regulating. Each pool starts with a single instance at the beginning and adds new instances, up to the maximum allowed, as they are needed to accommodate the volume of documents of that type that are being converted.

After an application in the pool has been idle, meaning it has not been used by a converter for a set period of time, that instance is removed from the pool, freeing up resources. This idle timeout period can be configured if needed, or set to zero (0) to have the applications stay in the pool indefinitely. For best performance we recommend leaving the idle timeout set to it's default of an hour.

Each application in the application pool itself can be recycled at preset intervals based on the number of documents processed and the virtual size of the running application. This allows you to tailor the resources used to meet the capabilities of the computer the conversion service is running on.

 

Application Virtual Size

To check the Virtual Size of a running application we recommend using Process Explorer from SysInternals and adding the appropriate column. You cannot see the virtual size as a single column on Task Manager's Process tab.

 

The application factory for each converter uses the following settings to control the application pool. Each of these settings can be set individually on the <AppFactory> for each converter, or at the global <AppFactories> level to control all converters.

Setting

Value

MaxInstances

The maximum size of the application pool for this converter. For best performance leave this set to "auto" to have the size of the application pool tailored to the capabilities of your computer. If this setting is not provided, or set to 0 or less, a single application instance will be created.

 

The application pool is dynamic and will start with a single application in the pool with new applications added as needed. If an application in the pool is idle, meaning it has not processed any conversions, for a certain amount of time it is removed from the pool. This is controlled by the AppTeardownIdleTimeout setting below.

MaxRetryAttempts

Controls the number of times to retry converting a document if it was not successful on printing. Minimum value is 0, meaning we will not retry, and the maximum number of retries is 5. The default is 2.

 

Setting this value in the application pool level will override this setting in the Document Conversion Service Printer Pool section.

MaxSpooledPagesAllowed

Sets the maximum number of pages that are allowed to be printed/spooled. The default value value is 0, meaning there is no limit. If a document exceeds this count, it enters an error state and no file is created. To limit how many pages to convert see the PageRange setting in General Converter Options.

 

Setting this value in the application pool level will override this setting in the Document Conversion Service Printer Pool section.

 

This option can also be overridden on a per document basis using profiles as described in Creating and Customizing Profiles.

RecycleThreshold

Maximum number of documents each application can process before it is recycled and a new instance started to replace it.

 

This is set to 0 by default, meaning the application doesn't recycle.  

ReadyThreshold

The maximum length of time to wait after the application has been initialized before Document Conversion Service initiates communication with the application. This value may need to be increased for machines running high volume with many other applications running.

AppInitializationThreshold

Some applications need more time than others to complete their initialization. Enter in the length of time, in microseconds, to wait for the application to initialize.

AppTeardownIdleTimeout

The amount of time, in milliseconds, to wait before an idle application is closed and removed from the application pool. An idle application is one that has not processed any conversions in the specified time period. These idle applications are removed from the pool to free up resources. They are added back in on demand as needed.

 

This is set to 3,600,000 milliseconds (1 hour) by default in the global <AppFactories> section.

 

If this is set to 0, the applications in the pool will start dynamically but will not be dynamically removed from the pool. They will only be removed if they are recycled due to conversion failure or the settings for RecycleThreshold, RecycleVirtualSizeThreshold, RecycleGDIandUserHandleCountThreshold, and RecycleProcessHandleCountThreshold.

AppSynchronousPrintModeCheckPrintQueue

Some applications print synchronously, meaning control doesn't return toDocument Conversion Service until the file has been sent to the printer. In some cases we need to check the printer queue to see if the print action actually submitted a job. If it has not we fail the conversion gracefully. This setting is false for most applications.

RecycleVirtualSizeThreshold

The size (in 1024KB blocks) at which to recycle the application. For example, 1400000 is 1.4GB meaning the application will be recycled when its virtual size is larger than 1.4 GB. Is it important to keep this value below the 2GB virtual size for 32-bit applications. While you can disable the application recycling based on Virtual Size by setting this to 0 or removing the value completely, we do not recommend this.

RecycleGDIandUserHandleCountThreshold

The maximum number of combined user and GDI handles allowed for each application instance. When this number of user and GDI handles exceed this threshold the application will be recycled and a new instance started to replace it in the application pool. If this value is not set, or set to zero, the maximum number of combined handles is 8000.

RecycleProcessHandleCountThreshold

The maximum number of process handles allowed for each application instance. When this number exceeds this threshold the application will be recycled and a new instance started to replace it in the application pool. If this value is not set, or set to zero, the maximum number of combined handles is 2000.

ZeroByteFiles

Determines if files with a size of zero (0 bytes) are skipped or failed when processed. When set to Fail, an error is produced. When set to Skip, the file is skipped and a message is produced instead of an error. Default behaviour is to fail the file.

Modifying the Application Pool

As the application pool is dynamic and self-regulating, in most cases you should not need to configure the individual instances of the application pool on a per-converter basis. If you do decide you need to, the following steps show you how this can be done.

Opening the Configuration File

Go to Start - All Programs - PEERNET Document Conversion Service 3.0 - Edit DCS Configuration File to edit the configuration file using the DCS Editor. The configuration file can also be opened in any XML editor and can be found here:

Configuration file location:

C:\Program Files\Document Conversion Service 3.0\Core\PNJobItemProcessor.exe.config

Changing the Application Pool Size

As an example, if you mainly need to convert Word and PDF documents, and only occasionally need to convert Excel documents, you can reduce the size of the application pool for the Excel converter and increase the pools used by the Word and PDF converters. This would give you higher throughput on the documents you need to convert more often.

The sample below shows a possible configuration for this scenario:

The Microsoft Word and Adobe Acrobat Reader converter will both have an application pool of 5.

The Microsoft Excel converter has an application pool of 2.

The default MaxInstances, if not provided in the <AppFactory> section, is auto as set in the <Settings> section at the bottom of the <AppFactories> section. When set to auto the size of the application pool is tailored based on the capabilities of your computer using the same formula as Configuring Parallel Processing.

 

1.In the <AppFactories> section find the <AppFactory> section for the converter whose application pool you want to adjust.

2.Set the MaxInstances value to an appropriate higher or lower value.

 

AppFactories Configuration Section

 

<AppFactories>

  <Factories>

 

    <AppFactory Name="Microsoft Word"

                Type="PEERNET.PNDocConv.Applications.PNWordApplicationFactory"

                Assembly="PNWordApplicationFactory">

      <Settings>

        <add Name="Enabled" Value="auto"/>

        <add Name="MaxInstances" Value="5"/>

        <add Name="RecycleThreshold" Value="100"/>

      </Settings>

    </AppFactory>

 

    <AppFactory Name="Adobe Acrobat Reader"

           Type="PEERNET.PNDocConv.Applications.PNAcrobatReaderApplicationFactory"

           Assembly="PNAcrobatReaderApplicationFactory">

      <Settings>

        <add Name="Enabled" Value="auto"/>

        <add Name="MaxInstances" Value="5"/>

      </Settings>

    </AppFactory>

 

    <AppFactory Name="Microsoft Excel"

                Type="PEERNET.PNDocConv.Applications.PNExcelApplicationFactory"

                Assembly="PNExcelApplicationFactory">

        <Settings>

          <add Name="Enabled" Value="auto"/>

          <add Name="MaxInstances" Value="2"/>

        </Settings>

      </AppFactory>

    ... 

    

  </Factories>

  <Settings>

    <!-- Global factory settings -->

    <add Name="MaxInstances" Value="auto"/>

    <add Name="RecycleThreshold" Value="0"/>

    <add Name="ReadyThreshold" Value="5000" />

    <add Name="AppInitializationThreshold" Value ="30000" />

    <add Name="RecycleVirtualSizeThreshold" Value="1400000"/>

    <add Name="RecycleGDIandUserHandleCountThreshold" Value="8000"/>

    <add Name="RecycleProcessHandleCountThreshold" Value="2000"/>

    <add Name="AppTeardownIdleTimeout" Value="3600000"/>

 

  </Settings>

</AppFactories>

 

Changing the Application Recycle Count and Threshold

You can also change how often an application in the pool is recycled. Recycling an application keeps long running applications from slowly consuming resources.

An application is recycled for three reasons:

The RecycleThreshold for the number of document processed by this instance has been met.

The RecycleVirtualSizeThreshold value for the virtual size of the running application has been exceeded.

If a file fails to convert Document Conversion Service will automatically recycle the application. This cannot be changed.

 

The sample below shows a possible configuration for the following:

The Microsoft Word converter will be recycled after 100 documents or if the application's virtual size exceeds the 1.7GB limit set in the global settings section at the end of the <AppFactories> section

The Adobe Acrobat Reader converter has a custom RecycleVirtualSizeThreshold of 1GB but it does not have a setting for RecycleThreshold. It will default to the RecycleThreshold value of 200 in the global settings section at the end of the <AppFactories> section.

 

1.In the <AppFactories> section look for the <AppFactory> section for the converter whose recycle count or size threshold you want to adjust.

a.Set the RecycleThreshold to the desired value. Take care when adjusting this value too low as recycling an application takes time; recycling too often will decrease the throughput and the Document Conversion Service will spend too much time stopping and restarting the application.

b.Set the RecycleVirtualSizeThreshold value to the desired size. This value is specified in 1024KB blocks (1=1024KB).

2.You can change the global RecycleThreshold and RecycleVirtualSizeThreshold for all converters in the <Settings> section at the bottom of the <AppFactories> section. These values will be used if they are not specified in the converters' <AppFactory> section.

 

AppFactories Configuration Section

 

<AppFactories>

  <Factories>

 

    <AppFactory Name="Microsoft Word"

                Type="PEERNET.PNDocConv.Applications.PNWordApplicationFactory"

                Assembly="PNWordApplicationFactory">

      <Settings>

        <add Name="Enabled" Value="auto"/>

        <add Name="MaxInstances" Value="3"/>

        <add Name="RecycleThreshold" Value="100"/>

      </Settings>

    </AppFactory>

 

    <AppFactory Name="Adobe Acrobat Reader"

           Type="PEERNET.PNDocConv.Applications.PNAcrobatReaderApplicationFactory"

           Assembly="PNAcrobatReaderApplicationFactory">

      <Settings>

        <add Name="Enabled" Value="auto"/>

        <add Name="MaxInstances" Value="3"/>

         <add Name="RecycleVirtualSizeThreshold" Value="100000"/>

      </Settings>

    </AppFactory>

 

    ... 

    

  </Factories>

  <Settings>

    <!-- Global factory settings -->

    <add Name="MaxInstances" Value="3"/>

    <add Name="RecycleThreshold" Value="200"/>

    <add Name="RecycleVirtualSizeThreshold" Value="1700000"/>

  </Settings>

</AppFactories>

Restoring the Configuration File

A backup copy of the original configuration file is stored in the following location for easy recovery.

Configuration file location:

C:\Program Files\Document Conversion Service 3.0\Core\Backup\PNJobItemProcessor.exe.config