Skip to main content

Work Items

The Work Items page (Administration > System Status > Work Items) provides detailed insight into the current status of running tasks and their rejections. This page is essential for diagnosing performance problems related to task scheduling, thread pool exhaustion, and queue overflows.

Mango runs every task at one of three priority levels: High, Medium, or Low. Some tasks have configurable priorities; others are fixed. The Work Items view allows you to monitor rejections and understand why certain tasks may not be executing as expected.

Task Queues and Ordering

Task queues for the High and Medium pools ensure that a given task type runs in the order it was scheduled. Ordering is based on a unique identifier (such as a data source XID or data point ID). Limited queues have a hard limit defined in code or derived from the mango.properties property:

runtime.realTimeTimer.defaultTaskQueueSize=<value>

Only the High and Medium pools can run ordered tasks, but they also accept unordered tasks. Unordered tasks are not guaranteed to run before other tasks of the same type.

Understanding Runtime Performance

Running Stats

This section shows tasks that are currently executing. Since most tasks execute quickly, a healthy system typically shows very few entries here. When tasks start backing up and taking longer to run, this view reveals which specific tasks are long-running and potentially degrading performance.

The Running Stats section showing currently executing tasks with their names and durations

Rejected Stats

A task is rejected for one of two reasons:

  1. Queue Full -- The ordered queue for a specific task type is full. The system cannot process tasks fast enough, and new tasks are being dropped. This usually indicates that polling timeouts are set incorrectly or the task is scheduled too frequently.
  2. Pool Full -- The thread pool for that priority level has no free threads. New tasks cannot be scheduled until existing tasks complete.

The Rejected Stats section showing task rejection counts and reasons

High Priority Tasks

High-priority tasks run at the operating system's highest thread priority and are ordered by task type. When an ordered task's queue is full, the new task is rejected with a Queue Full rejection.

The high-priority thread pool size is configurable in System Settings with two parameters:

  • Core pool size -- The number of threads that always exist, ready to process tasks.
  • Maximum pool size -- The upper limit to prevent resource exhaustion. When the pool is full, tasks are rejected with a Pool Full rejection.
TaskQueue SizeOrdered OnDescription
Point Value Batch Write0Only 1Writes point values to the database asynchronously
Process Event HandlerdefaultInstanceExecutes system process event handlers
Set Point ValueUnlimitedPoint IDSets a point value asynchronously
Http Image Data Source10Data Point XIDRetrieves images asynchronously
BACnet iAm RequestN/AUnorderedSends iAm messages to BACnet devices
BACnet Object List RequestN/AUnorderedRequests object lists from BACnet devices
BACnet Point CreatorN/AUnorderedCreates data points from device discovery
BACnet COV MaintenanceN/AUnorderedManages COV subscriptions
Interval LoggingdefaultData Point XIDLogs point values at configured intervals
Polling Data SourcesdefaultData Source XIDPolls each data source on schedule
User Event Cache CleanerdefaultOnly 1Purges cached user events for inactive sessions
Timeout Event DetectorsdefaultEvent Detector XIDEvent detectors that use timeout logic
Email Event Handler EscalationdefaultHandler XIDSends escalation emails triggered by events
Nightly Purge0Only 1Purges old data on a nightly schedule
Upgrade Check0Only 1Checks for available upgrades every 24 hours
Work Item Monitor0Only 1Samples work item counts every 10 seconds
Schedule Configuration Backup0Only 1Triggers scheduled configuration backups
Schedule Database BackupN/AUnorderedTriggers scheduled database backups
Publisher Send SnapshotdefaultPublisher XIDSends publisher snapshot data
Publisher Send Realtime DatadefaultPublisher XIDSends realtime data from the publisher queue
License CheckN/AUnorderedValidates the system license
JSON File ImporterN/AUnorderedImports JSON configuration files
Maintenance Events0Maintenance Event XIDActivates or deactivates maintenance events
Schedule NoSQL Backup0Only 1Triggers NoSQL database backups
NoSQL Data Map Cleaner0Only 1Manages memory for point value writing
NoSQL Data Mover0Only 1Collates point values for batch writing
NoSQL Status Provider0Only 1Reports write performance metrics
Data Source InitializerN/AUnorderedInitializes data sources during startup
Data Source TerminatorN/AUnorderedTerminates data sources during shutdown
Upgrade Downloader0Only 1Downloads and installs upgrades

Medium Priority Tasks

Medium-priority tasks run just below the highest thread priority. Unlike the high-priority pool, the medium-priority pool can queue tasks when no threads are free, meaning the queue can grow unbounded in an overburdened system.

TaskQueue SizeOrdered OnDescription
REST Temporary Resource TimeoutdefaultResource IDCleans up expired temporary resources
Data Point EventUnlimitedData Point XID + Listener IDNotifies about point state and value changes
Configuration Backup0Only 1Creates JSON configuration backup
Database BackupdefaultOnly 1Creates SQL database backup
System Setting Changed Notification100System SettingNotifies listeners of setting changes
Audit Event0UnorderedRecords configuration changes

Low Priority Tasks

Low-priority tasks run at normal OS thread priority and are unordered. Tasks are processed as threads become available, with no guaranteed execution order.

TaskDescription
Alarm notificationsNotifies about alarm state changes
Send EmailSends email notifications
NoSQL BackupBacks up the NoSQL database
NoSQL RestoreRestores the NoSQL database

Configurable Priority Tasks

Some tasks allow priority configuration via System Settings. When run in the Medium or High pools they are ordered; in the Low pool they run unordered.

TaskQueue SizeOrdered OnDescription
Excel Report10Report XIDRuns an Excel Report
Report5Report XIDRuns a report from the Reports module