2.10 Changing PowerShell Configuration Settings

AppManager for Windows includes the following components:

  • A client object, MCPSHostClient.dll, which runs within the AppManager agent. This client object starts the server program and asks it to run jobs.

  • A server program, MCPSHostServer.exe, which provides the PowerShell environment in which the PowerShell Knowledge Scripts are executed.

Both components have associated configuration files that define certain operational parameters. You can modify some of these settings to fine-tune performance or to specify resource usage limits.

The configuration files are in .XML format. After making changes, ensure that the files retain their well-formed .XML format. Also do not remove or change settings other than those documented here. NetIQ Corporation strongly recommends that you create backup copies of these files before modifying them.

NOTE:This topic does not discuss all configuration settings. As a rule, if a configuration setting is not discussed in this topic, do not change the value of that setting.

2.10.1 Client Configuration Settings

The client configuration file, MCPSHostClient.dll.config, resides in the AppManager\bin\PowerShell directory. You can change the following settings.

In the <appSettings> section:

maxActiveServers

Use this setting to specify the maximum number of servers that can be active at any time. Use this setting in conjunction with maxMemoryUsage to specify a lower memory threshold with an increased number of servers that can be used. This combination is beneficial for situations in which a server exceeds the memory limitation and has to shut down. If only one server can be active at a time, job requests are blocked until the server restarts. If you allow more than one server to be active, job requests can be executed in other server processes or on new servers if the current number of active servers is less than maxActiveServers.

serverStartupTimeout

If MCPSHostServer.exe is not already running when a job is scheduled for execution, the client starts the server automatically. After starting the server, the client attempts to contact it. Use this configuration setting to specify the number of seconds that the client should attempt to contact the server. An error event is raised if the client cannot contact the server within the specified period.

In the <log4net> section:

file

Use this setting to specify the pathname of the log file. If the pathname is a relative path, it is considered to be relative to the \AppManager\bin\PowerShell directory.

appendToFile

Use this setting to indicate whether the client overwrites the existing log file or appends to it, at the time the client is loaded into the AppManager agent.

maxSizeRollBackups

Use this setting to specify the number of old log files you want to retain.

maximumFileSize

Use this setting to specify the maximum size of a log file. After a log file reaches this size, it is deleted, or renamed if the maxSizeRollBackups value is greater than 0.

2.10.2 Server Configuration Settings

The server configuration file, MCPSHostServer.exe.config, resides in the AppManager\bin\PowerShell directory. You can change the following settings.

In the <appSettings> section:

serverShutdownTimeout

Use this setting to specify the number of seconds that the server will remain running when no jobs are executing. If no jobs are submitted to the server during this period, the server shuts down and will restart the next time a client needs to run a job.

upperMaxRunspaceHosts

The PowerShell runspace pool allocates runspaces as needed. Each execution of a job requires one runspace. Runspaces return to the pool after use and are then available for other jobs. Use this setting to set the absolute limit on the number of runspaces allocated for a pool. If a client requests a runspace when none is available and the pool has reached this limit, the client is blocked from running until a runspace becomes available.

If you do not specify the runspace setting, the pool always allocates a new runspace, even if all others are in use, thereby ensuring that clients never have to wait for a runspace to be available.

maxActiveServers

Use this setting to specify the maximum number of servers that can be active at any time. Use this setting in conjunction with maxMemoryUsage to specify a lower memory threshold with an increased number of servers that can be used. This combination is beneficial for situations in which a server exceeds the memory limitation and has to shut down. If only one server can be active at a time, job requests are blocked until the server restarts. If you allow more than one server to be active, job requests can be executed in other server processes or on new servers if the current number of active servers is less than maxActiveServers.

maxMemoryUsage

Use this setting to specify the maximum amount of memory, in megabytes, that the server process should consume. If memory usage exceeds the maximum size, the server blocks additional requests from clients and restarts automatically after the last client has finished job execution.

In the <log4net> section:

file

Use this setting to specify the pathname of the log file. If the pathname is a relative path, it is considered to be relative to the \AppManager\bin\PowerShell directory.

appendToFile

Use this setting to indicate whether the client overwrites the existing log file or appends to it, at the time the client is loaded into the AppManager agent.

maxSizeRollBackups

Use this setting to specify the number of old log files you want to retain.

maximumFileSize

Use this setting to specify the maximum size of a log file. After a log file reaches this size, it is deleted, or renamed if the maxSizeRollBackups value is greater than 0.