This commit is contained in:
2021-10-27 23:45:17 +00:00
parent a900abf261
commit 53c982832d
2 changed files with 50 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
# REPORT RENDERING MAXIMUM INSTANCES SETTING
The report rendering maximum instances value controls how many report rendering processors are allowed to be running when a report is submitted before AyaNova will start forcibly shutting down excess instances.
Report rendering is a very "expensive" process in terms of memory and cpu usage on the server and in some rare cases the report rendering process can get stuck in a loop or frozen due to a bug in a report template script or simply selecting too many records to report in a practical amount of time. If too much memory or CPU cycles are tied up by these "zombie" report rendering processes it can cause the AyaNova server to stop responding completely.
When AyaNova receives a report request it checks first to ensure there are not more report rendering processes active than are specified in this setting. If there are too many already running it will return a busy code to the end user to try again later and will attempt to forcibly shut down any of the processes that should have expired. Expired here means processes that have been running longer than [AYANOVA_REPORT_RENDERING_TIMEOUT](ops-config-report-rendering-timeout.md) number of milliseconds.
## Default
If no override is specified AyaNova will use the following default value:
`3`
This means AyaNova can normally be processing 3 report requests simultaneously and is generally an adequate setting for most situations as most reports are generated in a few seconds freeing up a slot immediately after they are completed.
## When to change this setting
If users *regularly* receive error messages that the server is too busy when rendering reports it may indicate the need to increase this value. As report rendering is an intensive operation for the server consuming a great deal of memory and cpu cycles it is best to only raise this value 1 at a time and then see if that resolves the issue.
## MINIMUM / MAXIMUM
There is a limit of 10 instances maximum built into AyaNova so specifying a value greater than 10 will be ignored and 10 will be used instead.
Specifying a value less than 1 will be automatically changed to 1 as the minimum allowed value.
## Overriding
AyaNova expects this value to be provided by an environment variable or command line parameter named
`AYANOVA_REPORT_RENDERING_MAX_INSTANCES`
The value specified should be a string specifying the value as an integer, for example:
`5`
Example command line parameter
`dotnet run --AYANOVA_REPORT_RENDERING_MAX_INSTANCES="5`
Example environment variable
Windows
`set "AYANOVA_REPORT_RENDERING_MAX_INSTANCES=5"`
Linux / MAC
`export AYANOVA_REPORT_RENDERING_MAX_INSTANCES="5"`
If both a command line parameter and an environment variable are set the command line parameter takes precedence.

View File

@@ -171,6 +171,7 @@ namespace AyaNova.Util
nTemp = config.GetValue<int?>("AYANOVA_REPORT_RENDERING_MAX_INSTANCES");
AYANOVA_REPORT_RENDERING_MAX_INSTANCES = (null == nTemp) ? 3 : (int)nTemp;
if (AYANOVA_REPORT_RENDERING_MAX_INSTANCES < 1) AYANOVA_REPORT_RENDERING_MAX_INSTANCES = 1; //minimum instances
if (AYANOVA_REPORT_RENDERING_MAX_INSTANCES > 10) AYANOVA_REPORT_RENDERING_MAX_INSTANCES = 10; //Fixed maximum instances
//DB
AYANOVA_DB_CONNECTION = config.GetValue<string>("AYANOVA_DB_CONNECTION");