Memory Management on Shared Servers

Memory Management on Shared Servers

Introduction

This guide is intended for users who deploy the FastClose Scheduler (Worker Service) or the FastClose WebReader to a shared server that is also running other applications, such as SQL Server or an ERP Application Server.

The main FastClose Server application is generally safe to deploy in this way alongside other applications, as it has low memory requirements that do not change over time.

The Worker Service and the WebReader are different, because their memory usage is variable:

By default both have a percentage-based limit of 75%. So if installing more than one of the two services on the same box, some config is necessary.

Applying a memory limit to the WebReader and Worker Service stops them causing problems for the other applications on the server. The limit should be configured in relation to everything else running on the machine, allowing for the memory needs of say, SQL Server, the ERP Application Server (eg: Epicor) and any other applications that share it.

Allocate Memory in the Round

Plan how you want to apportion memory in the round, holistically. So assuming everything is on one box for a moment (which hopefully it isn't). You might assign:

Generally the database server and ERP application servers are the more mission critical, so they would be given more resource and defended at the expense of the FastClose applications.

FastClose Version

If configuring this for,

Configure the GC Memory Limit

Details on finding and editing your Customer App Settings file can be found here.

This setting can be applied to the following FastClose WebApps:

The default limit FastClose applies to all it's apps is a percentage-based heap limit of 75%.

The apps supports two application settings for configuring the .NET garbage collector (GC) heap limit:

Add either setting to your appsettings.customer.json file for the relevant app you wish to limit the memory usage of.

If both keys are configured, GCHeapHardLimit takes precedence and GCHeapHardLimitPercent is ignored.

If neither key is specified, FastClose defaults to setting a percentage-based heap limit of 75%.

If any heap limit is set you should see an output in the logs during startup. E.g.

16:37:46 INF WorkerService: Setting GC Heap Hard Limit Percent to 50%.

For more detailed information please see Garbage collector config settings - .NET

Set a fixed memory limit

Use GCHeapHardLimit to set an explicit maximum GC heap size in bytes.

"GCHeapHardLimit": 1073741824

The example above sets the heap limit to 1 GB.

GCHeapHardLimit must be a positive, whole number.

Set a percentage-based heap limit

Use GCHeapHardLimitPercent to set the maximum GC heap size as a percentage of the memory available to the process.

"GCHeapHardLimitPercent": 10

The example above limits the GC heap to 10% of available memory.

GCHeapHardLimitPercent must be a whole number from 1 through 100, inclusive.

Deployment

Once the config files are in place, it is necessary to restart the relevant Windows service.

Subsequently it's a good idea to monitor memory usage and system performance - and adjust as required.

Powered By