Tame Release 4.4

Trouble Shooting and Tuning Guide


Problems

CPU usage is high, even after installing Tame

The application runs too slowly when Tame is used

What if the application hangs temporarily?

Printing from the DOS program is delayed

The CPU remain pegged when using the Priority option is used

The CPU spikes briefly after each key press

The on-screen clock stops

Support Tools

Producing a DOS Trace


Problems

CPU usage is high, even after installing Tame

The following diagnostic steps should be taken.   This will take only a few minutes in most cases.  

Verify that Tame is loaded

The easiest way to verify that Tame is loaded is to open a new cmd prompt and run the following command line.  

C:\Tame\TameView /PT

This will list the status of all applications where Tame is in use.  If Tame is not loaded, examine %windir%\system32\autoexec.nt file and make sure that it contains the following as its last line. 

C:\Tame\tame-mon.com

If that line was already correct then it is possible that Tame did not load due to an error.   Run the same tame-mon command from the cmd prompt and see if any error messages are displayed.

Look at the Status

While the application is running, open a cmd prompt and run the following command.  Note that this is also available in the Tame group in the start menu, unless that option was disabled during the initial setup.

C:\Tame\TameView /M

This will begin monitoring the most recently started DOS command.  A screen similar to the following will be displayed and updated about once per second.

 

Process ID  : 3080
User ID     : Greg
DOS Command : CV

Elapsed Time: 8.984 Seconds
Total CPU   : 7.734 Seconds
Tot CPU Pct :  86.09%
Cur CPU Pct :  98%

Tame Options: /WorkPriorityTicks 20 /WatchAppQueueWork on /WatchAppQueueIdle on
Tame Status : NonWork 8 - No work or idle actions detected for the past 8 seconds
Last QTime  : n/a

───────────────────────────────────────────────────────────────────────────────────
This app is using high CPU and no work or idle actions have been detected for the past 8 seconds.

▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
If the application is currently waiting for input:

   Tame may not be detecting when the application is idle.
   Try this Tame option: /NonWorkIdle

▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
If the app is currently processing, settings may be correct.

▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

 

 

Note the two bottom sections.  Separate instructions are given “If the app is waiting” or “if it is processing…”.   Be sure to pick the correct one based on what the app is doing at the time.   

In this case, suppose the app is currently waiting on keyboard input, but it is using 100% CPU.    According to this screen, Tame specifies that the /NonWorkIdle option could be used to correct the situation.

Tame Support…

If the answer is not provided by the TameView status, a trace file may be produced in order to find out why.  See the section on Producing a DOS Trace for instructions.  Be sure to follow up with Tame Support in order to describe the problem so that they may identify the best course of action.

The application runs too slowly when Tame is used

If some portions of the application run much slower with Tame loaded, then Tame may not be differentiating idle time verses activity.  If this occurs after the default settings have been tweaked (perhaps to make Tame more aggressive), the first thing to try is to revert to the default settings and see if the problem disappears.

Let the Doctor make a recommendation

While the app is running, go to a new cmd prompt and run TameView /M to obtain a monitor screen.   Perfom the slow operations and watch the monitor screen.  If the monitor screen lists the application as waiting on input, it will provide recommendations that apply if that is not the case.  Follow the recommendations.

Disable Windows Idle Detection

Windows includes a simple idle detection option that is enabled by default.  In some cases, this idle detection may release time slices while the application is still active.  As a result, the application will run much more slowly than it would normally run.  Fortunately, the Windows idle detection is not needed when using Tame in a Windows NT based platform (including Windows 2000 and Windows XP). 

To disable Windows idle detection, right click on the icon that is used to launch the application and edit its properties.  In the MISC tab, move the idle sensitivity slider all the way to the left. 

If the PIF launches a batch file then there may not be a MISC tab.  When a batch file is being launched, the dialog does not provide options for a DOS application.  If this occurs, you may either (1) change the properties of the default DOS PIF, or (2) change the properties of this icon so that it will allow setting DOS options.

1.      To change the default pif, locate %SystemRoot%\_default.pif, and change its properties as described above.

2.      To force the icon to allow setting DOS options, you will need to run a DOS program. 

      %SystemRoot%\System32\command.exe /e:4096 /c <bat_file>

Due to the quirky nature of command.com and environment values, this can sometimes fail if the batch file creates a lot of environment values.

Use App Queue Timing

The /WatchAppQueueWork option may correct the problem.  If the application is a Clipper application, copy the C:\Tame\ClipperQ.tam file to replace the default C:\Tame\Clipper.tam file.  The replacement file uses default App Queue timing and also enables print spooler processing.

If it is not a clipper app, specify the /WatchAppQueueWork option.

If the  /WatchAppQueueWork option has little or no effect, the queue parameters may need to be adjusted.  While the app is running, go to a new cmd prompt and run TameView /M to obtain a monitor screen.   Watch the QTime value that is displayed.  If the QTime is always n/a then the /TrackQTime option may be needed in order to enable it.   While watching the “TameView /M” screen, note the number that is displayed while the app is idle, and while it is working.  If there is a big difference, set the /AppQueueWork parameter to a number that is always above the idle number.

Raise the Boost Parameters

In some cases, the key boost and/or DOS boost may need t be raised.  To do this, press Alt-Ctrl-T and change the key and DOS boost numbers to 3 and 10 respectively.  If this solves the problem, lower them to find the lowest value where the application runs well.  To make these changes permanent see the Tame FAQ   8 document.

Check CPU usage without Tame

Run the app without Tame, and if it uses low CPU during the slowed activity, specify the following option:

/CpuIdlePercent 10

Still Running NT4?

Tame has greater ability to automatically prevent this from happening with Windows 2000 and Windows XP.  If you are using a different version of windows, and are planning to upgrade to Windows 2000 or XP, you may want to test the application in that environment.

Outsource…

If the answer is not found yet, please produce a trace file and upload it to the TameDOS FTP site.  See the section on Producing a DOS Trace for instructions.  Be sure to follow up with Tame Support in order to describe the problem so that they may identify the best course of action.

What if the application hangs temporarily?

Follow instructions in the section entitled What if the application runs too slowly when Tame is used?

Printing from the DOS program is delayed

When printing from a DOS program, there may be a significant delay before the printout begins.  This is a known problem with some FoxPro applications.  See Microsoft support article number Q102203 for more details.  The delay can sometimes be increased significantly if Tame is in use.  This problem may be solved in most cases by specifying the following option. 

/SpoolPrint

With these options, Tame will initiate the printout as soon as the application becomes idle.

The CPU remain pegged when using the Priority option is used

This can be normal.  While the CPU is pegged, many of the tasks may be spinning at idle priority.  The normal operation of the system will perform as if the CPU were at a much lower number.  If you need to know how much of the CPU time is running at idle priority, enable the DOS run log.  This is done by setting the full path in the registry value HKLM\Software\Tame\RunLogFile.

The CPU spikes briefly after each key press

If the CPU spikes briefly with each key press then this can be normal.  This is because Tame provides a brief boost when a key is pressed, and if that key causes any DOS activity, the boost is further increased.   Normally, the key boost is too brief to show up in performance monitor, so if a spike is seen, it is likely due to DOS activity.

If you want to reduce the spike, do one or both of the following. 

Add a /BoostCancel parameter – set it to twice the /PollIdle value

Reduce the boost for the keypress activity (set /BoostKey to 0)

Afterwards, test the application to make sure that it does not run more slowly.  If the system appears to hang, then Tame probably began a task switch while the app was still working.  Press the right shift key and Tame will provide a key boost to continue processing, and adjust the parameters upward until the hang disappears.

The on-screen clock stops

This is normal when Tame has placed the application into a deep sleep.  If the clock needs to be continuously updated, deep sleep may be disabled using the “/SwitchRepeatTicks -1” option.  In some cases, the “/SwitchSingleTicks -1” option will also be needed.


Support Tools

Producing a DOS Trace

The DOS trace provides the ability to examine what the program is doing.

Before running a use the DOS trace, set the following registry value to point to a folder where you want the trace files placed.  Make sure that all users have permissions to write to this folder.

            HKLM\Software\Tame\LogPath

Trace a portion of a run

The trace may be enabled and disabled as needed. 

1.      Run the application. 

2.      Open a new cmd prompt, and run the following command. 

TameView /TB

3.      Use the DOS apppplication for several seconds.  If diagnosing a specific problem, make sure that the application exhibits that problem during the trace.

4.      End the trace using the following command line.  As an alternative, you may Exit the application and the trace will be stopped automatically.

TameView /TE

5.      Look in the trace path for the new file.   The default trace path is C:\Tame\LogFiles.  If the trace file is not huge (say less than 20 megabytes), compress it using WinZip or another compression tool, and send it to Tame support.

Trace an entire run

To use the DOS trace, following these steps.

1.      Set the following registry value.

HKCU\SOFTWARE\Tame\DosTraceEnable = T

Note that the HKCU registry key is normally used so that you will not inadvertently start a trace for another user.  If the intent is to trace other users, the HKLM key can be used instead.

2.      Run the application

3.      Use the application as normal

4.      Exit the application

5.      Look in the trace path for the new file.   If the trace file is not huge (say less than 20 megabytes), compress it using WinZip or another compression tool, and send it to Tame support.