Application Compatibility Settings - TechGenix



Application Compatibility Settings

Some applications have special requirements to enable them to work properly on Metaframe XP. These requirements may include memory size restriction, CPU usage modification, special handling of INI files and system naming modification. One method of modifying application behavior is to use application compatibility flags and values.

These are located under HKLM\Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications. There are 3 CPU utilization settings: FirstCountMsgQPeeksSleepBadApp , MsgQBadAppSleepTimeInMillisec and NthCountMsgQPeeksSleepBadApp (Table 3) and a Flags Value that is the sum of the wanted application compatibility flags (see Table 4).

To “register” an application and begin with default compatibility settings, create a new key under the Applications key using the application name, for example for Prowin32.exe, create a key named PROWIN32. A good starting point is to copy the values under the MSACCESS key. The resulting key is shown below (figure 4).

[pic]

Figure 4. Application Compatibility Settings

Tuning CPU Utilization

Copying the MSACESS key values for your application gives you a starting point for bad application tuning. The basic strategy in tuning a bad application, after creating the application key and settings is to define a time-measurable task for the application, run up performance monitor and then modify the application compatibility values. The new values take effect immediately on restarting the application so the tuning process is quite fast. Measure the task completion time versus CPU utilization for each new setting.

The idea is to get acceptable performance with the least CPU impact. The best strategy is to start by setting MsgQBadAppSleepTimeInMillisec to 0. This allows the application to run with no restrictions. If it doesn’t run any faster, your slow speed problem is due to something else. If it does run faster then the next step is to set MsgQBadAppSleepTimeInMillisec back to one, and slowly increase the FirstCountMsgQPeeksSleepBadApp value until the times are acceptable.

More detailed information on application compatibility settings is provided in the following 2 tables.

|Value Name |Description |

|FirstCountMsgQPeeksSleepBadApp |number of times the application can query the message queue |

| |before it is put to sleep. Increase to make application |

| |faster |

|MsgQBadAppSleepTimeInMillisec |number of milliseconds the application is suspended. Setting|

| |this to zero turns off bad app detection. |

|NthCountMsgQPeeksSleepBadApp |number of times the application can query the message queue |

| |before it is suspended again. Increase to make application |

| |faster |

|Flags |(See Table 4 below) |

Table 3. HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\RegistryEntries\Appname\Values

|“Flags” Value (Hex) |Action |

|0x1 |DOS application |

|0x2 |OS/2 application |

|0x4 |Windows 16-bit application |

|0x8 |Windows 32-bit application |

|0x10 |Return username instead of computername |

|0x20 |Return Citrix build number |

|0x100 |Disable registry mapping for this application |

|0x400 |not substitute user WINDOWS directory |

|0x800 |Limit physical memory reported to app to 32 MB |

|0x1000 |Log object creations to %citrix_compat_logpath% |

Table 4. HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\RegistryEntries\Appname\Flags

In the PROWIN32 example shown in Figure 4), the Flags value is 0x80C. This is the sum of 0x4 (16 bit app), 0x8 (32 bit app) and 0x800 (return memory size of 32 MB).

Note: the easiest way to modify the application Compatibility values is with the free tool CMPTMAN.EXE. There are separate NT 4.0 TSE and Windows 2000 versions of this utility available from Citrix. (See Figure 5).

[pic]

Figure 5. Screen shot of CMPTMAN window

Modifying INI File Handling

While the normal “execute” mode INI file distribution mechanism works very well, there are a number of applications that use personalized INI files that shouldn’t br want updated. A couple of examples of these are the Lotus Notes client and SAP GUI client. The normal behavior, update from %systemroot%, can be modified by registering the INI files as exceptions under the key HKLM\Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\IniFiles, with values having the name of the INI file, less extension, and data corresponding to the flags shown in table 5 below.

|Flag Value (Hex) |Action |

|0x4 |Windows 16-bit application |

|0x8 |Windows 32-bit application |

|0x40 |Synchronize user INI file to system version |

|0x80 |Do not substitute user WINDOWS directory |

Table 5. HKLM\Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\IniFiles Inifilename Values

An example is shown in Figure 6 below, with entries for WIN.INI and SYSTEM.INI. Note the data value for both INI files is 0x44, which is the sum of 0x4 (windows 16-bit app) and 0x40 (synchronize user ini file to system). For user INI files that should not be overwritten by updated system INI files, select a data value of 0x8C (0x4 + 0x8 + 0x80). Using the notes.ini file (lotus notes client) you would create a Value called NOTES, REG_DWORD, 0x8C.

[pic]

Figure 6. Inifile flags location

Other Application Tuning Tools

DOS applications can use excessive CPU time is the DOS application has uncontrolled keyboard polling. While the application compatibility settings provide a way to tune 16- and 32-bit windows applications, these will not work effectively for DOS application. While NTVDM.EXE could be registered as a “bad” application to control the CPU utilization of misbehaving DOS applications, this would adversely affect all DOS applications on the server. A far more effective way is to use DOSKBD for NT 4.0 TSE, a TSR that can control keyboard polling behavior.

Microsoft don’t provide or support any tools such as DOSKBD for controlling DOS applications on Windows 2000. However, DPAKBD () has been used with some success and version 4.0 of TAME () is excellent for managing DOS applications on Windows 2000.

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download