You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Current »

The Runtime Engine (TServer) is the core execution component that manages real-time data processing, module coordination, and client services in production environments.

Parent Page: Runtime (Reference)



TServer Components

The Runtime Engine coordinates all execution aspects:

ComponentFunctionKey Features
Core EngineCentral coordinatorModule management, event routing, memory management
Tag ServicesReal-time databaseIn-memory storage, microsecond updates, quality management
Module HostModule executionDynamic loading, lifecycle management, isolation
Communication LayerNetwork servicesClient connections, protocol handlers, buffering
Security ContextAccess controlAuthentication, authorization, audit logging

Memory Architecture

Runtime Memory Space

???????????????????????????????????????????
?      RUNTIME MEMORY SPACE               ?
???????????????????????????????????????????
?  Real-time Tag Database (In-Memory)     ?
?  • Current Values                       ?
?  • Quality & Timestamps                 ?
?  • Cached Metadata                      ?
???????????????????????????????????????????
?  Module Memory                          ?
?  • Device Buffers                       ?
?  • Alarm States                         ?
?  • Script Context                       ?
?  • Client Sessions                      ?
???????????????????????????????????????????
?  System Cache                           ?
?  • Configuration                        ?
?  • Security Tokens                      ?
?  • Performance Metrics                  ?
???????????????????????????????????????????

Memory Management

AreaPurposeManagement
Tag DatabaseCurrent values storageAutomatic optimization
Module MemoryProcessing buffersPer-module allocation
System CachePerformance dataLRU cache policy

Process & Thread Model

TServer Main Process

Modules - Services Thread Pool:

  • TagProvider services
  • Alarm processing
  • Historian services
  • Datasets & SQL services
  • Solution DB & cached metadata

Client Services Threads:

  • TCP Listener Thread
  • Client Handler Threads (1 per client)
  • Web Service Thread Pool

System Threads:

  • Garbage Collection
  • Performance Monitoring
  • Diagnostics Logging

Script Module Process

Script Task Execution:

ModeThreadingConfiguration
DefaultOne thread per taskStandard isolation
Multi-threadMultiple threadsParallel execution
ConfigurableMax threads settingResource control

Script Expression Execution:

  • Single thread, event-driven execution
  • Optimized for rapid response

Script Classes:

  • Client service threads
  • Instance per session

Data Flow Architecture

Real-Time Data Flow

Field Devices → Device Module → Tag Database → Processing Modules → Clients
                                 Historian
                                 Database

Data Flow Stages:

StageProcessingLatency
AcquisitionDevice polling/events1-100ms
Tag UpdateMemory write<1ms
ProcessingAlarms/Scripts1-10ms
DistributionClient notification10-50ms
StorageHistorian/Database50-500ms

Event-Driven Architecture

Event Source → Event Queue → Event Dispatcher → Event Handlers
                         Priority Management
                         Thread Assignment

Event Processing:

Event TypePriorityHandler
Tag ChangeHighDirect notification
AlarmCriticalImmediate processing
Script TriggerNormalQueued execution
Client RequestVariableThread pool
SystemLowBackground thread

Module Execution

Module Lifecycle

PhaseActionsDuration
InitializeLoad configuration100-500ms
StartBegin processing10-100ms
RunActive executionContinuous
StopGraceful shutdown100-1000ms
DisposeRelease resources10-100ms

Module Isolation

Each module runs with:

  • Dedicated memory space
  • Independent error handling
  • Configurable resource limits
  • Separate logging context

Performance Characteristics

Processing Capacity

MetricTypicalMaximum
Tag Updates/sec10,000100,000+
Concurrent Clients50500+
Script Executions/sec1,00010,000+
Alarm Processing/sec5,00050,000+

Resource Usage

ComponentCPU UsageMemory
Core Engine5-10%100-200 MB
Tag Services10-20%Varies with count
Modules20-40%50-500 MB each
Client Services5-10% per client10-50 MB per client

Optimization Settings

Thread Pool Configuration

SettingDefaultRangeImpact
Min Threads42-16Startup performance
Max Threads10010-1000Peak capacity
Queue Size1000100-10000Buffer capacity

Memory Settings

ParameterDefaultRecommended
Initial Heap256 MB512 MB for large systems
Max Heap2 GB4-8 GB for enterprise
Tag Cache100 MBScale with tag count

Diagnostics & Monitoring

Performance Counters

Monitor these metrics:

  • CPU utilization by module
  • Memory consumption trends
  • Thread pool saturation
  • Queue depths
  • Response times

Log Categories

CategoryContentVerbosity
SystemCore operationsError/Warning
ModulesModule eventsInfo
CommunicationClient trafficDebug
PerformanceMetricsTrace

High Availability

Redundancy Support

FeatureImplementationSwitchover Time
Hot StandbySynchronized backup<1 second
Data ReplicationReal-time syncContinuous
Client RedirectAutomatic failover2-5 seconds

State Synchronization

Between primary and backup:

  • Tag values and quality
  • Alarm states
  • Client sessions
  • Module status

See Also


  • No labels