Though the activePDF Server software has been designed to perform well under stress to meet typical performance needs, in some situations performance can be further enhanced through changes to system and application settings. This article details the process of evaluating Server's performance and identifying opportunities to improve software performance.
There are a number of ways to evaluate software performance, which can quickly turn performance analysis into a lengthy process. As such, this article will focus on four key performance analysis goals:
Gather the measurements necessary to determine if the conversion process is meeting the performance requirements of the business solution.
Establish baseline performance statistics to evaluate the effect of changes to application and system configurations.
Outline the system and application changes that can impact performance.
Provide a simplified approach to obtaining a brief overview of current performance, to quickly identify opportunities for performance improvements and direct further research.
For the purposes of this article, Server performance is measured by evaluating the time required to perform simple conversions, including image to PDF, PostScript® to PDF, and Microsoft® Word (.doc) to PDF.
NOTE: For more information on these Server functions, refer to the Related Articles near the bottom of the page.
The VBScript code necessary to perform each conversion and capture performance information can be obtained by clicking the Download link below. The code details for the included ServerCnvtImg1 example file (TIFF to PDF conversion) can also be found below.
Please note that these code samples are not intended to be used "as is" and should be modified to better represent the target application. Refer to the Running the Code Samples section below for details on variables that should be configured before performing the tests.
NOTE: VBScript was chosen for these examples due to its simple syntax, making it easy to translate into other programming languages. It was also chosen as it can be executed on any system and easily viewed and changed with a simple editor such as Notepad.
Sample Code Structure
The sample code provided is structured as follows:
Definition of variables
Definition of test files to be used
Working directories
Setup logging to capture performance measurements
Initialization of data for measurement
“Code Under Test”
Logging performance measurements and summary analsys
Running the Code Samples
The code samples provided in this article require Microsoft Server 2003 and Microsoft Office 2000, 2003, or 2007. To run the code samples, perform the following steps:
Click the Download to download the .zip file. When prompted for a save location, navigate to your system's desktop and click Save, to ensure the file is easy to locate.
Once the download is complete, unzip the folder to extract the contents.
Open the 12050-VBS > SV Test Code folder to view the available code files. Right-click the sample you would like to run, and select Open With. From the list of available programs, choose Notepad and click Open.
Review the code in Notepad and change the input file and number of conversions to perform to better represent your application requirements.
NOTE: A sample input file is included for each example and the default number of conversions to perform is set to 1.
Once you have made the necessary changes, click File > Save and exit Notepad.
Double-click to run the VBS file.
Review the log file for the information outlined in the Performance Analysis section below.
Performance Analysis
The log file obtained after each conversion contains the following performance details:
The time required to complete the conversion.
The expected average time to convert a file with similar characteristics, based on the above time.
Calculated conversion rates as conversions per minute and conversions per hour.
The following is a sample log file from the conversion of a small Postscript file:
File to convert: SmFile.PS of size: 340898 Bytes
10:30:38 AM 'SmFile.ps' Conversion time: 2
Number of Successful Conversions: 1
Test Start Time: 10/13/2008 10:30:36 AM
Test Completion Time: 10:30:38 AM - Duration: 2 sec
Code Under Test Time: 2 sec
Time including overhead per Conversion: 2
Time per Conversion (Code Under Test): 2
Conversions per Minute (Calculated): 30
Conversions per Hour (Calculated): 1800
Bytes per second: 170449 bytes/sec
By taking several measurements using different input files, a more comprehensive overview of performance dependencies will develop. For example, in the following conversion, a larger test file is used:
File to convert: MedFile.PS of size: 1115991 Bytes
Test Start Time: 10/13/2008 10:36:54 PM
Test Completion Time: 10:36:56 PM - Duration: 2.328125 sec
Code Under Test Time: 2.328125 sec
Time including overhead per Conversion: 2.328125
Time per Conversion (Code Under Test): 2.328125
Conversions per Minute (Calculated): 25.77181
Conversions per Hour (Calculated): 1546.309
Bytes per second: 479351.838926175 bytes/sec
Although the test file used above is approximately three times larger than the first input file, the conversion time increased by only 20%. This implies that larger file conversions are more efficient than smaller file conversions under the current system and software configurations. With further study, it may be found that a faster processor may enhance the performance for smaller files.
The following is a sample log file from the conversion of a single-page TIFF file.
File to convert: TestImage1.TIF - File Size: 90236
Successful Conversions: 50 out of 50 attempts.
Test Start Time: 10:43:42 AM
Test Completion Time: 10:43:52 AM - Duration: 9.640625 sec
Time per Conversion: 0.1928125
Conversions per Minute (Calculated): 311.1831
Conversions per Hour (Calculated): 18670.99
Bytes per second: 467998.703403566 bytes/sec
The log file reveals that a simple image conversion is significantly faster than the PostScript conversions viewed above, as image files require little data processing and are probably limited by the system's data transfer rate. In this scenario, a system with a faster disk drive and I/O channel may exhibit better performance especially for larger files.
Performing Additional Tests
The sample code files obtained by clicking the Download above contain additional, more complex measurement examples that can be used to further analyze software and system performance. For example, the ServerCnvtPS1.vbs contains a measurement to determine if logging the conversion affects the conversion length.
The following is the code sample of the TIFF to PDF conversion which is the simplest of the measurement applications. Sample applications for converting Postscript and Word documents are also included. These other applications show different or additional steps to measure performance. For example, the application to convert Postscript files, ServerCnvtPS1.vbs, has more complex timing measurement to confirm whether the logging affects the timing results.
NOTE: Conversion logging was found to only have a noticeable impact on conversion length when the number of conversions was high (on the test system used, 50 or more conversions).
Code Details
The following are the code details for the ServerCnvtImg1 example file, which can be obtained by clicking the Download link above.
' Set local path to Application as varPath to subdirectories
arrayScr = Split(WScript.ScriptFullName, "\", -1, 1)
For i = 0 to UBound(arrayScr) - 1
varPath = varPath & arrayScr(i) & "\"
Next
' Define Variables
' Name of Sample file to be used in performance testing
FileName = "TestImage1.TIF"
' Number of conversions to be done for performance run
iConversions = 1
' Create File System Object and take Sample file from current directory and get file size
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set aFile = objFSO.GetFile(varPath & FileName)
iFileSize = aFile.Size
' Check for errors on submission and write to log
If varReturn <> 0 Then
LogText.WriteLine(Now & " '" & FileName & "' Conversion " & i & " PSToPDF Error Code = " & varReturn)
Else
numLoop = numLoop + 1 ' Increament the number of successful conversions
End If
10554 - Convert PostScript to PDF using ServerThe following VBScript example demonstrates the PSToPDF method, which converts a PostScript file to PDF. This ex...
10557 - Convert a Word file to PDF using ServerThe following VBScript example demonstrates how to convert a Microsoft Word document to PDF using activePDF Server.
These files are required:
The information in this article is for the use of activePDF Customers and Evaluation Users Only. No part of this document may be transmitted or reproduced without the express written consent of activePDF.