ActivePDF
Shopping Cart My Account Help Contact Us
Request a Call
Search
Products Solutions Support Downloads Corporate
Submit an Issue
Knowledge Base
Server Product Support
Examples & How-Tos
Support Options
Support Policies
Annual Subscription
Extensions
Documentation
Resource Links
   
 
 
 
 

HomeSupportKnowledge Base
 
activePDF KB #12050 - activePDF Server Performance Testing
activePDF KB #12050 - activePDF Server Performance Testing
Information: Example Printer Version | Return to Search
activePDF Server Performance Testing
 
Product Version Operating System Code Samples  
Server
3.8
Windows 2000
Windows 2003
VBS
 
Description
 
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:

  1. 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.
  2. Once the download is complete, unzip the folder to extract the contents.
  3. 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.
  4. 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.
  5. Double-click to run the VBS file.
  6. 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

10:36:56 PM 'MedFile.ps' Conversion time: 2.328125

Number of Successful Conversions: 1

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

    ' Input file
        varInput = varPath & FileName

    ' Output file
        varOutput = varPath & "TestImage.pdf"
    
    ' Basic log file
        varLog = varPath & "SVCnvtImg.log"

' 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

MsgBox "Begin " & iConversions & " of " & FileName

' Create Log file and add header information
    Set LogText = objFSO.CreateTextFile(varLog, True)
    LogText.WriteLine("Return Code KB Article:")
    LogText.WriteLine("http://www.activepdf.com/support/kb/?id=10549&tk=ts")
    LogText.WriteLine(" ")
    LogText.WriteLine("File to convert: " & aFile.Name & " - File Size: " & iFileSize)
    LogText.WriteLine(" ")

' Set counter and timer values
    numLoop = 0
    iTime = Now
    iStartTime = Timer()

' Loop through each file in the folder

For i = 1 to iConversions

    ' Start of "Code Under Test"
    ' Instantiate Object
        Set objSVR = CreateObject("APServer.Object")

    ' ImageToPDF
        varReturn = objSVR.ImageToPDF(varInput, varOutput, 0, 0, True, False, 72, "LETTER", 0, 0)

    ' 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

        Set objSVR = Nothing
    ' End of "Code Under Test"
    
Next

' Capture completion time
    iEndTime = Timer()
    iDuration = iEndTime - iStartTime
    
If numLoop <> 0 Then
    ' Add conversion summary statistics to log file
    iByteRate = (iFileSize*numLoop)/iDuration
    LogText.WriteLine("Successful Conversions: " & numLoop & " out of " & iConversions & " attempts.")
    LogText.WriteLine("Test Start Time:      " & iTime)
    LogText.WriteLine("Test Completion Time: " & Time & " - Duration: " & iDuration & " sec")
    LogText.WriteLine("Time per Conversion: " & iDuration/numLoop)
    LogText.WriteLine("  Conversions per Minute (Calculated): " & 60/(iDuration/numloop))
    LogText.WriteLine("  Conversions per Hour (Calculated):   " & 3600/(iDuration/numloop))
    LogText.WriteLine("  Bytes per second: " & iByteRate & " bytes/sec")
Else
    ' No conversions were successful
    LogText.WriteLine("All conversions failed!")

End If

' Close log file and Release File System Object
    LogText.Close
    Set objFSO = Nothing
    
Msgbox numLoop & " Loops finished in: " & iDuration & " seconds. Logged in: " & varLog, 064, "SV Image to PDF Conversions Completed!"
 
Related Articles

 
Keywords
 
Server, performance, analysis, baseline, 3.8, tuning, measurement, measurements
 
Last Updated 2008-12-03 Printer Version | Return to Search
 
Knowledge Base Article Feedback*
*KB article feedback ONLY (submit support issues here)
Quality of this article?
  Poor Excellent 
1 2 3 4 5 6 7 8 9 10
Is this article helpful? Yes       No       Maybe
Comments (Optional)
Email Address (Optional)
Please enter the word "PDF"
(without quotes)
 
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.

Copyright © 2005, activePDF, Inc. All Rights Reserved
2003 activePDF Site Map Feedback Privacy Policy Legal