SYMPTOMSPrograms that require the use of the Schedule service (Atsvc.exe) provided with Windows NT may fail when you run them on a Windows NT system for which you have also installed Task Scheduler (a Microsoft Internet Explorer 4.0 optional component). You will see inconsistent results when attempting to start a program using the AT commands. An example of such a program is Soon.exe from the Windows NT Resource Kit. CAUSEWhen you install Task Scheduler on Windows NT, it replaces the Schedule service. The Schedule service no longer shows up in the Services utility in Control Panel. RESOLUTIONTo resolve this problem, do one of the following:
MORE INFORMATIONIf the Microsoft Task Scheduler is not automatically removed, the services portion of the registry can be manually modified as indicated below.
|
Performance Tuning CPU Usage on 16-bit and 32-bit Windows Applications
Synopsis:
Depending on how an application is written, it is possible that a 16-bit or 32-bit Windows application may use too much CPU time even when it`s idle (no keyboard or mouse events).
Details:
This technote documents the use of WinFrame`s polling detection mechanism for Windows 16-bit and 32-bit applications. Some applications constantly look for keyboard input even while they appear to be doing nothing, thereby consuming a great deal of system CPU. WinFrame has built-in logic to detect this behavior. When this type of behavior is detected, the application`s execution is suspended, allowing other applications to utilize the CPU and making multitasking much more efficient. It is necessary to instruct WinFrame to look for this behavior by adding information to the Registry that is specific to the application in question.
Modifying the Registry
1. Run REGEDT32.EXE and locate the following key:
HKEY_LOCAL_MACHINE\SOFTWARE\Citrix\Compatibility\Applications
2. Double-click the Applications subkey to reveal several application settings that are pre-defined. Select SETUP under the Applications subkey. The following values are displayed on the right side of the Registry Editor window:
FirstCountMsgQPeeksSleepBadApp:REG_DWORD:0xF
Flags:REG_DWORD:0xc
MsgQBadAppSleepTimeInMillisec:REG_DWORD:0
NthCountMsgQPeeksSleepBadApp:REG_DWORD:0x5
3. With the SETUP subkey highlighted, select Save Key from the Registry pull-down menu. The filename can be anything, such as SETUP.REG. Once the SETUP values are saved, you need to create a subkey for your application.
4. With the Applications subkey highlighted, choose Add Key on the Edit pull-down menu. Set the Key Name field to the name of the executable in question, minus the extension. For example, for the application MYAPP.EXE, type MYAPP in the Key Name field. Leave the Class field blank. Click OK.
5. To copy the values from the SETUP subkey, select your new subkey (for example, MYAPP) and choose Restore from the Registry pull-down menu. Choose the filename you created in Step 3. Click Yes when the warning dialog box is displayed. Your new application subkey now has the same values as the SETUP subkey.
6. You must now fine tune the values for your application. The values are described in the following sections.
"Bad Application" Registry Values
The default values for the bad application settings are:
FirstCountMsgQPeeksSleepBadApp = 0xF
MsgQBadAppSleepTimeInMillisec = 0x1
NthCountMsgQPeeksSleepBadApp = 0x5
Flags: 0x8
FirstCountMsgQPeeksSleepBadApp is the number of times the application must query the message queue before WinFrame decides that it is ill-behaved. Decrease this value to put the application to sleep more often so it uses less CPU time.
MsgQBadAppSleepTimeInMillisec is the number of milliseconds the application is suspended once WinFrame has decided that it is ill-behaved. Increase this value to use less CPU time. If this value is zero, polling detection is disabled.
NthCountMsgQPeeksSleepBadApp After the application is determined to be "bad," this setting is the number of times the application must query the message queue before it is suspended again. Decrease this value to use less CPU time.
Flags is set to a value corresponding to the type of Windows application. Valid values are:
0x4 for Win16 applications only
0x8 for Win32 applications only
0xC for either Win16 or Win32 applications
"Bad Application" Settings
All values are expressed in hexadecimal. When changing the values, first click
the Decimal button and input the decimal value. For instance, if you want the MsgQBadAppSleepTimeInMillisec value to be set to 200 milliseconds, perform
the following steps:
1. Double click MsgQBadAppSleepTimeInMillisec
2. Click the Decimal radio button
3. Enter 200 in the Data field
4. Click OK
The value is now converted to 0xc8, the hexadecimal equivalent of 200 decimal.
NOTES:
1. To modify polling detection for DOS applications, use the DOSKBD utility.
2. When tuning these parameters, make sure the Performance Monitor up and running. These parameters will affect the amount of CPU used by an application. These parameters usually trade off CPU usage versus application responsiveness.
There are several key enhancements to Terminal Services in Windows 2000. Terminal Services is now a configurable service and is fully integrated with the Windows 2000 Server kernel. This means they can either be installed at setup or added or removed via the "Add/Remove Programs" tool under "Add/Remove Windows Components." The need for separate Terminal Services Service Packs has also been eliminated. To ensure that the proper performance profile for the Windows 2000 Server is preserved, users can modify the server Performance Options right-clicking on "My Computer" and choosing the Advanced tab in the System Properties dialog box. Administrators can choose to prioritize either "Applications" (Terminal Server serving up applications) or "Background Services" (regular client/server applications server or file and print server) to ensure that the installation of Terminal Services does not adversely affect file and print or server background process performance. Terminal Services now includes two different install modes: Remote Administration and Application Server. Administrators can choose which mode they would like to use Terminal Services in at the time of setup. Terminal Services has also been integrated with the Network Load Balancing (formerly Windows Load Balancing) service in Windows 2000, offering customers additional built-in scalability when setting up farms of computers running Terminal Server. The 16- and 32-bit RDP clients for Windows included with Windows 2000 Server also have major enhancements: brush and persistent caching to improve performance; shadowing and remote control of one client session by another for administration and trouble-shooting; automatic loading of drivers and configuration support for local printers attached to Windows-based terminals or PC clients; improved 56-bit or 128-bit (formerly 40-bit or 128-bit) encryption between client and server; and support for cut and paste between local windows and the RDP remote session. Another important new feature is multilanguage support, which allows any RDP client to interoperate in a multilanguage fashion with any computer running Terminal Services. In the earlier version (Windows NT Server 4.0 Terminal Server Edition), localization of the Terminal Server was in individual languages and required separate servers for multiple language support. With Windows 2000 Server, any client can talk to any server. Additional changes have been made to the administrative tools for Terminal Services, the Terminal Services Connection Configuration and the Terminal Services Manager. The Terminal Services Connection Configuration tool is now a Microsoft Management Console component; therefore, its GUI is more closely integrated with the other Windows 2000 administrative tools and can be extended by third parties. Lastly, there is support in Windows 2000 Server for a small set of new Terminal Services APIs. More information is available in the white paper “Using and Understanding APIs for Terminal Server.”
One of the most annoying things about Windows NT Server is that out of the box it gives you a print popup message everytime a user prints..sometimes the message goes to everyone connected to the server. The second most annoying thing is by default all print events get logged to the Event log. Here is how to solve both problems. These solutions require editing the registry be sure and do and rdisk /s before doing any registry changes and if you dont know what you are doing in the registry dont mess with it. All disclaimers app
1.Run Regedt32.exe
2. From the Hkey_local_machine subtree go to the following key
3. System-CurrentControlSet-Control-Print-Providers
4.From the edit menu click on Add Value
5.In the value name field type the following this is case sensitive!: NetPopup
6.Select REG_DWORD for the data type
7. Click on OK
8. In the dword editor box type 0 (zero) in the data field
9. Click OK
Now print Popup notifications will be disabled to re-enable change this value back to 1.
To stop print notifications from being written to the event log perform the above up to step 3.
Click on the value that says Eventlog in the right window. It should already be there but if this value does not exist you will have to create it performing the same steps as in 4-5 above only change the word NetPopup to read Eventlog.
After clicking on Eventlog you will get a dword editor box. Change the value from a 1 to a 0 (zero).
Click on OK
Print events will no longer be written to event log.
If you are registry shy, using WTS and know how to use policies, the WTSADM policy file on thethin.net downloads page has these settings built into it. Check it out on the downloads page.
Another way to turn off these settings is to go to the printer control panel and choosing server properties from the first drop down menu and clicking on the advanced tab. Unchecking all the boxes and rebooting your server will clear the event messages.
Here is another printing suggestion:
Change The Print Spool Directory
By default, Windows NT uses the system disk for all print spooling directories. If you`re running out of space or fire off a large number of print jobs, this can soon become a performance bottleneck. You can change the spool directory by adding a new REG_SZ value named HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Printers\[Printe rName]\SpoolDirectory and setting it to a local path. You should replace [PrinterName] with the name you gave the printer when you created it. Note: You can`t use a UNC path for the printer spool. You must use a fully qualified local path that exists before you make the changes. You must stop and restart the Spooler service after making these changes to the Registry.
If you need to add Print Screen Functionality back to your Print Screen Key in NT I reccomend you try the freeware utility Print Now. You can download it from here.
Another Freeware program to add Print Screen Functionality back to your Print Screen Key in NT is called Printkey. It has many more robust features than Print now and allows editing of the screen before printing. You can download the latest version from here. You can check out the authors homepage at http://www.geocities.com/~gigaman/
Sometimes the spooler gets hung, especially on WF/MF Servers you can use the below batch file script I wrote (that I have recently heard CITRIX tech support is reccomending)that reschedules itself to automatically reset the spooler every 2 hours and clear out hung jobs. This prevents a reboot. The 7200 is seconds and is changeable. Also for Terminal Server change the word winframe to wtsrv. Don`t worry about lost print jobs...the likelyhood that a job will be running the few seconds that this script takes to run is low. Even if a job or two is lost the user can just resend it and it beats having to reboot and kick off all users because of a hung job. Just run it once or use the autostart.zip file in the tip on how to run a batch file at system startup (http://thethin.net/autoexnt.cfm)
Note: In order for this batch file to run you will need soon.exe and timeout.exe from the resource kit(put them in your path)and the schedule service must be running.. You can download soon.exe from here with a sample of the batch file.
soon 7200 "%0"
net stop spooler
Timeout.exe 5
echo y | del c:\winframe\system32\spool\printers\*.*
net start spooler
The soon 7200 command schedules the job to run in 7200 seconds(2 hours). Change your timeout as necessary. The %0 reschedules the soon command to run again. The net stop spooler stops the spooler and the next line clears out all the hung print jobs. The timeout.exe file pauses the batch for a second or two so that the spooler has time to stop. Then the net start spooler restarts the spooler.
Click here to learn how to copy printers across your servers.
Disclaimer: This information is supplied as is and is intended for information purposes only.
Use this information at your own risk. The internet can often contain false or misleading information. While this is generally not the case with my personal documents I have to put this text here for legal purposes.
Terminal Services for Windows 2000 Server will continue to support both RDP and Citrix ICA (using MetaFrame) as Terminal Server 4.0 does today. Both RDP and Citrix ICA are high-performance display protocols that pass the display output from the application running at the server, down to the client device. RDP and ICA have similar performance characteristics. With Windows 2000, RDP adds some of the most requested features ICA already had; however, Citrix will continue to add value to Terminal Services with a new version of MetaFrame.