• No results found

Memory configuration

In document Micros a Cada (Page 44-47)

3. Configuration

3.1. Configuring system server

3.1.2. Base system (SYS)

3.1.2.2. Memory configuration

;Other Stations

;NOTE! Use the system configuration tool to create stations for the PC-NET!

;NET 1 (DCP-NET) stations

;#CREATE STA:V =

LIST(-; TT =

"EXTERNAL",-; ST =

"RTU",-; ND =

1,-; TN = 1)

;#CREATE STA1:B = %STA

The SYS:B object definition should come first in the base system configuration file SYS_BASCON.COM, otherwise the system does not start.

If there is a configuration error in the SYS_BASCON.COM file, the system might not start. Check the messages from the Notification Window or SYS_ERROR.LOG.

3.1.2.2. Memory configuration

The SYS 600 base system applies the policy of pre-allocating the virtual memory to be used during the whole session.

Pre-allocation of virtual memory is a usability issue: it ensures that the system or a monitor, once successfully started, is able to request the memory resources it needs, whatever happens in the system. Memory allocation by demand happens in the system, may cause the computer to run in "Virtual memory low" state, which severely degrades the performance and, in the worst case, makes the system totally unusable.

Memory pools

Memory pools are pre-allocated virtual memory areas to be used at run-time for dynamically created memory resident objects. In SYS 600, there are two kinds of memory pools:

* The global memory pool is accessed by all SYS 600 base system processes. It is used for process and report databases, execution queues, inter-process

communication and so on.

* Local memory pools are owned and used by one process only. They contain SCIL objects (such as variables, SCIL programs and VS objects) of the process.

The pools are configured in the configuration file SYS_CONFIG.PAR, which is read at system start-up before the execution of SYS_BASCON.COM. If the SYS_CONFIG.PAR file does not exist, the default values are used. A template,

SYS_CONFIG$PAR is copied to \sc\sys\active\sys_ during the installation of SYS 600. SYS_CONFIG.PAR can be edited with any text editor. Do not forget to remove the comment sign (;) in front of the lines.

SYS_CONFIG.PAR may contain the following parameters:

MEMORY_POOL_SIZE

This parameter specifies the size of the global memory pool in megabytes.

Recommended values are 64, 128, 192, 256 and so on. The default value is 128 (MB). The maximum possible value is slightly dependent on the operating system and the installed hardware and software. In any system, it is possible to define a 1 GB (1024 MB) pool, or a little larger.

For example, the line MEMORY_POOL_SIZE = 256 sets the size of the global memory pool to 256 MB.

PICO_MEMORY_POOL_SIZE

This parameter specifies the size of the local memory pool of each classic monitor process in the system (process names pico, picn, pica, picv and picx). The default value is 32 (MB).

REPR_MEMORY_POOL_SIZE

This parameter specifies the size of the local memory pool of each report process (executing time channels, event channels and parallel queues, process name repr).

The default value is 16 (MB).

PRIN_MEMORY_POOL_SIZE

This parameter specifies the size of the local memory pool of each printer spooler process (process name prin). The default value is 8 (MB).

MEMORY_POOL_HOLE

Setting this parameter causes the SYS 600 start-up code not to use the specified virtual memory area for the global memory pool. The parameter should be written into the parameter file only if an external program fails to initialize and displays an error message of the following format in the Notification Window (and

SYS_ERROR.LOG):

Add the following line to SYS_CONFIG.PAR and restart MicroSCADA MEMORY_POOL_HOLE = 30000000 - 301FFFFF

The line should be copied to SYS_CONFIG.PAR exactly as shown in the error message. After a restart, the program should start without errors. The configuration file can contain several MEMORY_POOL_HOLE lines, because there is a slight possibility that even the second start-up fails now suggesting another hole in the address space of the pool.

The contents of the SYS_CONFIG$PAR are:

;File: SYS_CONFIG.PAR

;Description: Configuration of static base system parameters

;Commented lines (with leading ';') show default values

;Version 9.2 SP1

;——————————————————————————

;

;MEMORY_POOL_SIZE = 128 ;Global memory pool (MB)

;PICO_MEMORY_POOL_SIZE = 32 ;Memory pool for classic monitor processes (pic*)

;REPR_MEMORY_POOL_SIZE = 16 ;Memory pool for report processes (repr)

;PRIN_MEMORY_POOL_SIZE = 8 ;Memory pool for printer processes (prin)

Tuning memory pool sizes

If a classic monitor process requires more memory than the memory pool size allows, the dialog SCIL Application Error/Memory Pool Exhausted is displayed.

The dialog displays a critical error with information about the pool, which caused the error. The information is either "Local memory pool exhausted" or "Global memory pool exhausted". If the local pool is exhausted, increase the value of PICO_MEMORY_POOL_SIZE and restart SYS 600, or optimize the picture or Visual SCIL dialog to use less local pool memory. Large SCIL data structures, such as long vectors, are most likely consumers of memory. If the global pool is exhausted, increase the value of MEMORY_POOL_SIZE.

Report and printer spool processes report their memory pool problems in the Notification Window and SYS_ERROR.LOG. Again, the remedy is to increase the local pool size (REPR_MEMORY_POOL_SIZE or

PRIN_MEMORY_POOL_SIZE) or the global pool size (MEMORY_POOL_SIZE), or optimize the SCIL application (command procedure or format picture) for smaller memory usage.

The usage of pools may be checked by evaluating the SCIL function

MEMORY_POOL_USAGE, for example, in the Test dialog. The function takes one argument, either GLOBAL or LOCAL, which specifies the pool to be investigated.

For example, MEMORY_POOL_USAGE("GLOBAL") evaluates to a list value, where attribute USED tells the number of bytes used in the global memory pool and attribute FREE the number of available free bytes. When the databases have been loaded and the system is in its normal running state, the values USED and FREE should be of the same size class. If FREE is much smaller than USED (less than half of USED), increase the MEMORY_POOL_SIZE parameter by 50 or 100 %. There should be no reason to decrease a pool size from its default value.

Oversized pools do not give any performance benefit on the system, they only increase the required size of the paging file. Increase the memory pool sizes only if the system has reported a memory pool shortage error or the MEMORY_POOL_USAGE function shows that the pool is nearly full.

The size of the physical memory (RAM) of the computer does not affect the pool sizes in any way.

Picture and report cache

For best possible performance, the base system maintains two run-time caches of most recently used disk-resident objects. The memory space required by the caches is allocated from the global memory pool.

The Picture Cache contains classic monitor pictures and representations. The size of the cache is defined by the PC (Picture Cache size) attribute of the SYS object (SYS:BPC). The recommended size in the SYS_BASCON$COM template is 8 MB.

This value is likely to be adequate for any system.

The Report Cache contains history data of data objects and SCIL programs of command procedure objects. The size of the cache is defined by the RC (Report Cache size) attribute of the SYS object (SYS:BRC). The recommended size in the SYS_BASCON$COM template is 8 MB. If the reporting functionality of the application is very intensive, some enhancement of performance may be achieved by using a larger value.

Paging file

The memory pools are allocated from the paging file ('swap file') of the computer.

The paging file usage may be calculated by the following formula:

PagingFileUsage = MEMORY_POOL_SIZE + nPICO *

PICO_MEMORY_POOL_SIZE + nREPR * REPR_MEMORY_POOL_SIZE + nPRIN * PRIN_MEMORY_POOL_SIZE

* nPICO is the estimated maximum number of concurrently open classic monitors, including the ones opened by Monitor Pro.

* nREPR is the number of repr processes in the system. Each SYS 600 application has APL:BPQ + 2 repr processes, that is, at least two repr's plus one for each parallel queue.

* nPRIN equals two times the number of concurrent SYS 600 applications.

If number of concurrently open classic monitors is estimated to 10 and there is one application with 16 parallel queues in the system, the paging file usage with default SYS_CONFIG.PAR is 128 + 10*32 + 18*16 + 2*8 = 752 MB.

With currently available disks, there is no need to optimize the size of the paging file to the smallest possible. It is recommended that paging file size is set to at least 4 gigabytes.

In document Micros a Cada (Page 44-47)