On this page
ThingsGateway Open Source and TGateway Compared
ThingsGateway is the open source industrial gateway on GitHub . TGateway is the commercial gateway product described in this documentation. This comparison covers the open source repository’s v12 branch and the current TGateway product.
TGateway is supplied as a complete product with the gateway Runtime, all protocol plugins, and the companion Studio and Watchdog applications. Its main advantages are lower server-side UI overhead, less repeated scheduling and temporary allocation, more efficient configuration and debugging, and stronger data reliability and site operations.
Performance and memory improvements
TGateway optimizes Web management, script compilation and continuous data processing separately to reduce their CPU and memory demands on the site Runtime.
| Area | ThingsGateway Open Source | TGateway improvement and benefit |
|---|---|---|
| Web UI | Blazor Server maintains interactive sessions and component state and handles UI events on the server. Additional management connections also add UI work to the site gateway. | Vue renders and maintains page state in the browser. Runtime supplies APIs and WebSocket data, removing the memory and interaction overhead of server-side Blazor component trees and rendering sessions. |
| Compilation | Scripts compile inside the gateway process. The compiler, source analysis and temporary compilation objects share the process with collection work. | A separate compiler process produces DLLs and exits when compilation finishes. Runtime loads the result; compiler process exit releases its temporary memory, reducing compilation memory and GC pressure within the main process. |
| Forwarding | Each business instance maintains its own selection, grouping and upload schedule. Sending the same points to multiple destinations repeats maintenance and scheduling work. | Targets in a group share selection and group production scheduling. Precomputed variable routes, batch membership snapshots and reusable interval routes reduce repeated selection work, temporary grouping and collection allocation. |
| Calculations | Subscriptions use references discovered when loading, and source-change events directly invoke downstream calculations. Subscriptions are not refreshed after each conditional branch change. | Dependencies follow the references actually read, removing obsolete branch subscriptions and unnecessary recalculations. Iterative propagation avoids growing the recursive call stack along dependency chains. |
Large-scale performance comparison
Both tests used one million variables. ThingsGateway Open Source used 100 devices and 100 TCP channels; TGateway used 1000 devices and 1000 independent TCP channels. With 10 times as many devices and connections, TGateway still used less CPU and memory, demonstrating a clear advantage in operation at scale.
| Metric | ThingsGateway Open Source | TGateway |
|---|---|---|
| Devices / TCP channels | 100 / 100 | 1000 / 1000 |
| Total variables | One million | One million |
| Variables per device | 10000 | 1000 |
| Steady-state process CPU mean / maximum | 20.3% / 30.5% | 15.36% / 20.75% |
| Working set | 1583 MB | 1264.97 MiB |
| Private memory | 1429 MB | 1076.73 MiB |
Under the respective workloads above, TGateway handles more devices and connections while using approximately 24.3% less average CPU and 32.0% less peak CPU, with a lower working set and private memory. In testing on a high-performance server, TGateway supports refreshing all one million variables every 1000 ms.
In TGateway’s capacity test, collection and a local Modbus simulator shared one host process on a machine with 24 logical processors, with a configured 1000 ms execution interval. During the 306.71-second steady-state window, every device’s success count advanced, with zero additional device failures, protocol errors or security refusals. One million variables were online at the end. CPU was normalized by 24 logical processors, with sampling beginning 30 seconds after a full GC completed. Memory was read after the window, another full GC and a further 30 seconds. Both measurements include the simulator workload. See Scale validation and capacity planning for conditions and reproduction steps.
Managed memory, allocation and GC
The memory profiles likewise compare 100 devices / 100 TCP channels in the open source version with 1000 devices / 1000 TCP channels in TGateway. Both use one million variables, with a selected window of approximately 1 minute 2 seconds each.
| Metric | ThingsGateway Open Source | TGateway |
|---|---|---|
| Total .NET memory | 789.5 MB | 617.0 MB |
| Combined LOH, POH and FOH | 304.5 MB | 51.5 MB |
| Cumulative allocation in window (approx.) | 631.19 MB | 480.82 MB |
| GC time / share of window | 849 ms / 1.37% | 597 ms / 0.96% |
In these tests with 10 times as many devices and TCP channels, TGateway still uses approximately 21.8% less total .NET memory, allocates approximately 23.8% less memory within the window, and spends approximately 29.7% less time in GC. This demonstrates lower managed memory and collection overhead while handling more concurrent devices.
ThingsGateway Open Source also delivers excellent performance and memory efficiency at one million variables. TGateway further improves efficiency across more devices and connections, maintaining lower resource use at a larger device scale.
ThingsGateway Open Source: 100 devices, 100 TCP channels, one million variables.

TGateway: 1000 devices, 1000 TCP channels, one million variables.

UI and configuration efficiency
TGateway provides dedicated workspaces for collection, calculations, forwarding and site maintenance. Debugging, diagnostics and runtime state stay with the selected object, reducing navigation and repeated configuration.
| Task | ThingsGateway Open Source | TGateway improvement and benefit |
|---|---|---|
| Navigation | Gateway monitoring centers on channel/device trees, variable tables and functional tabs, switching between collection and memory variables. | Separate collection, memory, forwarding, synchronization, script and rule workspaces make tasks and their objects clearer. |
| Device checks | Inspect objects through the monitoring tree, variable information and plugin debugging entry points. | Real-time variables, details, protocol debugging, channel logs and device logs share the selected device workspace. A bottom or right-hand debugging pane helps compare readings with communications. |
| Outputs | Output settings reside in business devices, associated variables and plugin properties. Destinations are maintained separately. | Groups share selection and triggers; targets own connections and formats. Separate group/target states, logs and debugging help locate specific delivery failures. |
| Forms | Parameter editing depends on driver-provided Razor components and forms. | Grouped forms and field editors handle complex objects, lists, addresses and method arguments, reducing handwritten configuration. |
| Scripts | Code editing and script checks reside in variable/business settings, with source maintained at its usage location. | A catalog centralizes scripts, types and parameters. Compilation logs, error locations and Studio completion, signatures and diagnostics simplify reuse and maintenance. |
| Rules | A canvas provides node categories, load/download/save actions and status views. | Draft, configuration and loaded versions are distinguished. Configuration/runtime inspectors, port values, validation locations, undo/redo and automatic layout shorten editing and troubleshooting. |
| Bulk edits | Table imports/exports, copying and bulk editing. | Workbooks cover collection, memory, forwarding and synchronization. Import previews show additions, replacements and errors, with row correction and revalidation to reduce rework. |
See Interface and workspaces, Device details and debugging, Import preview and the Rule editor for current screens.
Functional limitations and TGateway improvements
Forwarding: shared configuration with less repetition
Open source business plugins associate variables with each business instance, which owns its selection, interval, grouping and upload behavior. Sending the same variables to multiple systems requires maintaining those instances separately, allowing selections or schedules to drift apart.
TGateway groups centralize selection, triggers, online filtering and input batching, while targets own connections, formats, delivery and caching. One group with three targets can send the same temperature points to MQTT, HTTP and history storage. A group change applies to all three, with independent target output settings and diagnostics. See Forwarding configuration and runtime.
Memory calculations: dynamic subscriptions and safe propagation
Open source calculations register references when loading a formula, then respond directly to source changes. If a selector chooses A or B and loading discovers only the selector and A, switching to B does not rebuild subscriptions after each calculation. Later B changes may therefore fail to update the result. Multilevel calculations also invoke the next level directly through events.
TGateway refreshes actual dependencies after each calculation, follows B after switching, and removes the obsolete A subscription. Iterative propagation, cycle detection and a per-cycle work limit support complex dependency chains, with quality and error information for failures. These improvements address correctness, unnecessary recalculation and cycle diagnosis. See Calculation triggers.
Scripts: reusable logic with isolated compilation
Open source expressions store source with variables, business plugins or rule nodes, compiling within the gateway process and caching by source. Similar logic used in several locations ties code maintenance to those locations, while compilation consumes gateway process resources.
TGateway organizes scripts by name and type. Multiple variables or targets reference the same logic with their own parameters. A separate compiler and Studio language services handle formal compilation and editing analysis respectively, reducing repeated source maintenance and separating temporary compiler memory from continuous collection. See Code editing and Script development.
Rules: validated dataflow beyond payload passing
Open source rules execute recursively along canvas links, passing a single payload between nodes. That payload can contain several fields, but their meaning and handling depend on node conventions, without TGateway’s typed named ports or state/event distinction.
TGateway validates node arguments, connections and acyclic topology when loading, with explicit port types and trigger semantics. State outputs in a batch commit together before downstream scheduling; events follow event-consumption semantics. Port runtime values, execution results and validation locations make complex coordination easier to inspect and debug. See Rule engine and Node contracts.
Cached replay: explicit capacity and retained accepted records
Open source general business caches configure file size in MB, memory count and upload chunk size. Overflow first attempts persistence; general queues that remain over capacity clear old memory records before accepting the current record. Enabling caching alone therefore does not establish that every record is retained.
At the memory threshold, TGateway general target caches try persistence first. A persistence failure retains accepted records and rejects new ones. Persistent limits apply to rows per model queue, trimming the oldest records when exceeded. Target outbox views expose memory, in-flight records, persistent rows, failure retention and oldest timestamps, making backlog and recovery visible. History and mirroring queues have their own policies; see Offline caching and replay.
Alarms: concurrent types and finer control
Open source alarms maintain one active state per variable, selecting one matching numeric limit in HH, H, LL, L order. Severity and delay are shared variable settings. Configuring both H and HH does not create two simultaneous active states, limiting independent handling by severity.
TGateway evaluates each alarm type independently, with separate severity, delay and suppression settings, plus numeric state mappings. With H=80 and HH=100, a sustained value of 101 meeting both conditions can activate H and HH together. At 90, HH recovers while H remains active, supporting separate notification and tracking by severity. See Alarm configuration.
History: reliable writes, mirroring and repair
Open source history and historical alarm query interfaces depend on corresponding business plugins for storage, retention and replay. Reliability behavior must be handled by each plugin.
TGateway provides dedicated real-time, history and historical alarm targets, persistent queues and diagnostics. Standard relational history distinguishes duplicates from content conflicts by record key, with database mirroring, range checks and repair. Site aggregation also preserves source timestamps and supports central historical backfill, separating recovery of offline samples from current-value updates. See Storage configuration and Historical backfill.
Redundancy: work ownership beyond heartbeat takeover
Open source redundancy uses primary/standby identities, peer addresses, tokens, heartbeats and failure counts for takeover and synchronization. Basic heartbeat takeover does not provide the work-ownership constraint of a shared arbitration lease.
TGateway adds node identity validation, mutual TLS, a second communication link and shared arbitration. When arbitration is enabled, the working node must retain a valid lease, reducing split-brain risk during network partitions. Collection, forwarding, alarm and rule tasks follow the working role; journaling and peer synchronization protect pending history. Dual links address reachability, arbitration controls work ownership, and history protection handles pending writes. See Redundancy and failover.
Implementation architecture
| Area | ThingsGateway Open Source | TGateway |
|---|---|---|
| Backend | ASP.NET Core supporting .NET 8, with build conditions supporting .NET 10. | .NET 10 Worker with TouchSocket HTTP and TWebApi management endpoints. |
| Frontend | Blazor Server / interactive server Razor with BootstrapBlazor. | Vue 3, TypeScript and Element Plus, with separate frontend/backend implementations. |
| Admin/data | ThingsGateway.Admin and ThingsGateway.SqlOrm. | TAdmin and TORM, with source generation for management endpoints and some registration metadata. |
| Plugin UI | Dynamically loaded assemblies; drivers can carry Razor parameter and debugging components. | Current collection/forwarding interfaces, with parameter editors and dedicated debugging in the Web frontend. |
Integration and site operations
| Scenario | ThingsGateway Open Source | TGateway improvement and benefit |
|---|---|---|
| Simulation | Plugin debugging and development test hosts such as ScriptDebug. | A protocol simulator generates test points and data for communication and load checks before deployment. |
| Point links | Scripts, rules and variable RPC assemble read/write logic. | Dedicated synchronization mappings include source freshness, condition variables, retry backoff and confirmation from a new sample after writing, reducing custom coordination scripts. |
| Automation | APIs, business plugins and scripts. | Management APIs, reverse control, plugin method calls and MCP access and development skills cover external systems and AI-assisted development. |
| Multiple sites | Management provides remote administration and updates. | Studio centralizes sites, projects, deployment, retrieval and batch updates for ongoing delivery across projects. |
| Processes | Gateway packages, containers or source deployment with the management application. | Watchdog manages local Runtime processes, project packages, backup/recovery and updates, centralizing site application and recovery. |
Delivery and licensing
The ThingsGateway public repository uses Apache-2.0. Follow the repository license and dependency terms when using, modifying or distributing it.
TGateway source is supplied under commercial source licensing. Complete official packages allow 50 channels, 50 devices and 1,000 variables free of charge; exceeding any limit requires a commercial offline license. See Commercial licensing for source and activation-code licensing scopes and procedures.