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









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:
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 |