[x]

Site Alert(s):

  • Server maintenance Saturday Nov 22, 2008, 12:00 PM - 3:00 PM. The Knowledge Center will be unavailable during this time.
Rate this Article:
You must be signed in to rate again
Article Feedback Print View
Alternate Languages:

StressPrinters 1.3.1 for 32-bit and 64-bit Platforms

Document ID: CTX109374   /   Created On: Apr 4, 2006   /   Updated On: Jan 15, 2008
Average Rating: 3

StressPrinters version 1.3.1

Created date: 03/30/2006
Modified date: 07/06/2007

Description

Many driver problems in the Terminal Services environment revolve around poor multi-threaded performance, which in turn can cause Print Spooler instability. Problematic multi-threaded performance is usually exposed when multiple users connect to a Terminal Server simultaneously using the same print driver. Symptoms include the failure to autocreate client printers, increased thread count of the Printer Spooler and/or Citrix Print Manager services, and possibly the unresponsiveness and/or unexpected termination of these services (crashes).

This tool can be used to simulate multiple sessions autocreating printers using the same print driver.

It can also be used to compare the following among various drivers:

• CPU load incurred while creating a printer using a particular driver

• Time required to successfully create a printer using a particular driver

Note: The current version of the tool does not test concurrent printer capabilities, settings, or actual printing calls, which are also possible causes of printing crashes. Therefore, good stress results don’t mean that printers are actually working or certified.

Prerequisites

• The print driver you want to test must be installed on the server. You can check for installed drivers by performing the following procedure:

    a. Open the Printers and Faxes folder of the server.

    b. Go to File > Server Properties.

    c. Click the Drivers tab.

• There must be a valid port to connect the printer to (for example, LPT1:). It is acceptable to connect multiple printers to the same port for testing purposes. You can check for available ports by performing the following procedure:

    a. Open the Printers and Faxes folder of the server.

    b. Click File > Server Properties.

    c. Click the Ports tab.

Installing StressPrinters

Copy and extract the StressPrinters.zip file to a directory on a test server.

How to Use StressPrinters

  1. On 32-bit Windows platforms, use StressPrinters.exe. Use StressPrinters64.exe on 64-bit Windows platforms.
  2. When you run StressPrinters.exe or StressPrinters64.exe, the dialog box shown below appears. It allows you to specify various parameters for each printer driver installed. Refer to the following screen shot:

    The parameters are defined below:
  • Base printer name: specifies the base name of the printers to create (defaults to printer driver name).
  • Printer port name: (default is to LPT1:) specifies the port to connect the printers to.
  • Print processor: (default is Winprint) specifies the name of the print processor you want to use for the printer.
  • The number of concurrent add events: (default is 1) the number of concurrent add and delete (if Keep printers created during last iteration option is not specified) events to run during an iteration.
  • Maximum delay between add and delete: (default is 0) specifies the maximum delay (in milliseconds) between printer additions and deletions for a particular thread. This delay is randomized (up to the maximum delay specified) to expose problems across a wider range of timing variations.
  • The number of times to repeat the test: (default is 1) the number of times to repeat the test with the parameters specified.
  • Keep printers created during last iteration: (default is not keep) does not delete the printers created during the last iteration of the test.
  • Verbose mode: print verbose messages (default is not to print verbose status, but only error/warning conditions).
  • Apply these settings to all printers: make the settings default for all other printer drivers and overwrites what you have specified for them.
  1. You can save your choices of parameters and selected printer drivers into a text file (Save) and load thm latere or on another server (Load).
  2. You can specify the timeout in minutes (Options) to mark potential problem printer drivers that take too much time to autocreate or stuck in a spooler. By default, the timeout is 10 minutes. Post processing command is any command line that will be executed once the stress test is finished.

  1. When the parameters are set, select the appropriate printer drivers to test and click the Run button to start testing. The following dialog box (which includes a progress bar) appears:

  1. If printer autocreation takes a long time (the Print Spooler service may hang), you can abort the current test by clicking the Close button. The log file can be saved at any time by clicking the Save log button.
  2. If you choose to abort the current test, click Yes when prompted to close instances of addprinter.exe. Refer to the following screen shot:

  1. When timeout expires, you have the choice to continue the stress test for the same amount of time or abort it:

  1. If you don’t choose to continue, the following message box appears:

  1. If all tests finish before the specified timeout, the following message appears:
    “Stress test has finished!”

  1. The tool also detects when the Print Spooler crashes due to bad printer driver and displays a warning. If this occurs, save the log and check the crash dump saved by your default postmortem debugger (for example, Dr. Watson or NT Symbolic Debugger (NTSD)).

  1. Refer to CTX105888 – How to Set the NT Symbolic Debugger as a Default Windows Postmortem Debugger for information on how to set NTSD as a default postmortem debugger.
  2. If all tests have finished (indicated if the progress bar is full), you can examine the log file. Save it (click Save log) and click Close to close the dialog box.

Annotated Log File

Here is the annotated log file example corresponded to the stress test depicted above (comments are in bold):

Launching cmd.exe /C addprinter.exe -name "HP LaserJet 4000 Series PCL" -port "LPT1:" -driver "HP LaserJet 4000 Series PCL" -proc "Winprint" -conc 1 -iter 1 -delay 0
CMD process has been created. PID: 118c (4492)
Launching cmd.exe /C addprinter.exe -name "HP LaserJet 4050 Series PCL" -port "LPT1:" -driver "HP LaserJet 4050 Series PCL" -proc "Winprint" -conc 1 -iter 1 -delay 0
CMD process has been created. PID: 1184 (4484)

--- Begin Log for "HP LaserJet 4000 Series PCL" ---

AddPrinter Ver 2.01 (c) Citrix 2006-2007 (pid: 4108)
WARNING: thread id 0x468 may be stuck on AddPrinter for printer HP LaserJet 4000 Series PCL1!
Time elapsed: 6 seconds. Done with 0 errors.

>>> The warning can be ignored because the log for HP LaserJet 4000 Series PCL stress test reports elapsed time less than 1 minute timeout and 0 errors.

--- End Log for "HP LaserJet 4000 Series PCL" ---

--- Begin Log for "HP LaserJet 4050 Series PCL" ---

Logging is in progress...

>>> This is an indication of the ongoing stress test for HP LaserJet 4050 Series PCL driver. Had not been finished by the time the log was saved.

--- End Log for "HP LaserJet 4050 Series PCL" ---

Stress tests have not finished for the following drivers after 1 minutes(s):

HP LaserJet 4050 Series PCL

>>> The list of printer drivers whose tests had not been finished when the timeout of 1 minute expired.

Using Command Line

The package contains command line versions addprinter.exe and addprinter64.exe that you can use to test individual printer drivers manually.

1. The syntax for the program is as follows:

addprinter.exe –name “PrinterName” –port “PortName” –driver “DriverName” –proc “Processor” –conc NumConThreads –iter numIter –delay msecDelay –keep –verbose


The values are defined below:

  • “PrinterName” specifies the base name of the printers to create.
  • “PortName” (optional, defaults to LPT1:) specifies the port to connect the printers to.
  • “DriverName” specifies the driver to test.
  • “Processor” (optional, defaults to Winprint) specifies the name of the print processor you want to use for the printer.
  • NumConThreads (optional, defaults to 1) is the number of concurrent add and delete (if –keep is not specified) events to run during an iteration.
  • numIter (optional, defaults to 1) is the number of times to repeat the test with the parameters specified.
  • msecDelay (optional, defaults to 0) specifies the maximum delay (in milliseconds) between printer additions and deletions for a particular thread. This delay is randomized (up to the maximum delay specified) to expose problems across a wider range of timing variations.
  • -keep (optional, defaults to not keep) does not delete the printers created during the last iteration of the test.
  • -quiet (optional) does not print verbose status, but only error/warning conditions and the program banner.
    For example, the following command:

    addprinter.exe -name "test" -driver "HP LaserJet 4" -conc 3 -iter 3 -delay 500 -keep –quiet


    Adds three printers with the base name test (test1,test2,test3) using the HP LaserJet 4 print driver with a delay of 500 milliseconds between the printer being added and deleted for a particular thread. It also only prints status if any of the AddPrinter() or DeletePrinter() calls fail and keeps the three printers that are created during the final (third) iteration of the test.

2. If there is an error adding the driver, an error message is returned. For example:

“AddPrinter (test1) failed with error 1797: The printer driver is unknown.”

Where test1 specifies the unique AddPrinter() call that failed. If multiple iterations have been specified with the –iter argument and there is a failure during a particular iteration of a test, subsequent iterations are not run.

3. If no error occurs a confirmation message similar to the one below is printed:

“Time elapsed: 17 seconds. Done with 0 errors.”

Uninstalling StressPrinters

To uninstall StressPrinters, delete StressPrinters.exe, addprinter.exe, StressPrinters64.exe, and addprinter64.exe.

More Information

By default, if an AddPrinter() call fails while autocreating printers on a Presentation Server, the following event is created in the Event Log:

"Source: MetaFrameEvents
Category: Printer Management
Event ID: 1116
Description: Printer auto creation failure. Reason: AddPrinter() failed with status 0x709. Client name: ClientName Printer name: PrinterName Port name: PortName Driver name: DriverName Print processor: (WINPRINT)"

Where:

Reason is the ntstatus code of failure. You can leverage the NET HELPMSG facility as shown above to translate the code into a readable error message.

Client name is the client name of the client that attempted to autocreate the printer.

Printer name is the name used when attempting to autocreate.

Port name is the name of the port used when attempting to autocreate.

Driver name is the name of the driver used when attempting to autocreate.

Print processor is the name of the print processor used when attempting to autocreate.
Note
: Autocreated printers always use the WINPRINT print processor.

Disclaimer

This software application is provided to you "as is" with no representations, warranties or conditions of any kind. You may use and distribute it at your own risk. CITRIX DISCLAIMS ALL WARRANTIES WHATSOEVER, EXPRESS, IMPLIED, WRITTEN, ORAL OR STATUTORY, INCLUDING WITHOUT LIMITATION WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NONINFRINGEMENT. Without limiting the generality of the foregoing, you acknowledge and agree that (a) the software application may exhibit errors, design flaws or other problems, possibly resulting in loss of data or damage to property; (b) it may not be possible to make the software application fully functional; and (c) Citrix may, without notice or liability to you, cease to make available the current version and/or any future versions of the software application. In no event should the code be used to support of ultra-hazardous activities, including but not limited to life support or blasting activities. NEITHER CITRIX NOR ITS AFFILIATES OR AGENTS WILL BE LIABLE, UNDER BREACH OF CONTRACT OR ANY OTHER THEORY OF LIABILITY, FOR ANY DAMAGES WHATSOEVER ARISING FROM USE OF THE SOFTWARE APPLICATION, INCLUDING WITHOUT LIMITATION DIRECT, SPECIAL, INCIDENTAL, PUNITIVE, CONSEQUENTIAL OR OTHER DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. You agree to indemnify and defend Citrix against any and all claims arising from your use, modification or distribution of the code.


Comment Posted
Please add a change history (what's new) to the site and the download package. Thomas Jul 12, 2007 by citrix4ge
The new version of addprinter can be run on non-CPS environments, for example, on MPS 3.0 server. The functionality is the same. Using GUI is much simpler if you have to test multiple drivers on several servers. There is a new StressPrinters version 1.3 coming soon. Jun 28, 2007 by dvostok925
Hi, we previously used the addprinter.exe version 2.0 to test the printer autocreation. With this tool is included the addprinter.exe version 2.1; is there something different in those two versions? What is the difference launching addprinter from a CMD line insteaad of using StressTool? I didn't find any difference? Thanks, Bye Jun 21, 2007 by giulitn
Hi, we previously used the addprinter.exe version 2.0 to test the printer autocreation. With this tool is included the addprinter.exe version 2.1; is there something different in those two versions? What is the difference launching addprinter from a CMD line insteaad of using StressTool? I didn't find any difference? Thanks, Bye Jun 21, 2007 by giulitn
There seem to be 2 possible (bad) results: a crash and bad performance. A crash will always be a schlemassl and we will need to find a better driver. Slow performance is no real problem: you will not have to worry if that driver is fast enough. What is a good performance metric? A good performance metric is a try to find out what users will feel; but in fact it is nothing but a good metric, in other words, a number just like 3.14159265358979323846 (shortened: PI). The only real metric that counts is a short: "Hey Jeromy, printing slow at your ****ing Terminal servers" on your way to lunch, or much better: no words about printing. I like that tool as it is a nice to have at the design phase. Thanks for it! Jun 10, 2007 by jnorz783
I think that if your spooler don't crash, results is ok Jun 8, 2007 by GESTINMAN1
I think if your spooler don't crash, results is ok Jun 8, 2007 by GESTINMAN1
This article doesnt say anything about what results are good / fair / poor so I dont really know how to judge the results. My main print driver that I use (hp laserjet 4000 pcl5e) has a 3 second delay, should I worry about that? Jun 7, 2007 by jcbeldin1
This article doesnt say anything about what results are good / fair / poor so I dont really know how to judge the results. My main print driver that I use (hp laserjet 4000 pcl5e) has a 3 second delay, should I worry about that? Jun 7, 2007 by jcbeldin1
Search
Knowledge Center
XenApp
XenApp Plugins (Clients)
XenServer
XenDesktop
NetScaler Application Delivery
Access Gateway
EdgeSight
Provisioning Server
WANScaler
Password Manager
Does it work with Citrix? Verify it - introducing the new Citrix Ready Community Verified