Niagara Station Database and History Optimization
Unbounded history collection is the most common cause of Niagara station slowdowns and disk space exhaustion. This guide covers how to right-size your history configuration, archive data externally, and keep stations performing well.
Understanding Niagara History Storage
How History Works
Niagara stores historical data locally on the controller:
History Storage Path:
/opt/niagara/stations/{station}/history/
Storage Format:
- Binary history files (.hdb)
- One file per history point per time period
- Indexed for fast retrieval
Storage Impact
| Controller | Available Storage | Typical Usage |
|---|
| JACE-8000 | 2-4 GB | 500-2000 history points |
| JACE-9000 | 4-8 GB | 1000-5000 history points |
| Supervisor (PC) | Varies | Unlimited (disk-dependent) |
| Edge 10 | 2 GB | 200-500 history points |
History Collection Strategies
Collection Types
| Strategy | How It Works | Best For |
|---|
| Interval | Record every N seconds/minutes | Energy, temperature trending |
| COV (Change of Value) | Record when value changes by tolerance | Setpoints, status changes |
| Change of State | Record on boolean state change | Equipment start/stop |
| COV + Interval | COV with maximum interval guarantee | Critical monitoring points |
Recommended Collection Intervals
| Point Type | Interval | Rationale |
|---|
| Zone temperature | 15 minutes | Sufficient for comfort analysis |
| Supply air temperature | 5 minutes | Process monitoring |
| Energy meter | 15 minutes | Aligns with utility intervals |
| Equipment status | COV | Capture every state change |
| Damper/valve position | 5 minutes | Control loop analysis |
| Outdoor air temperature | 15 minutes | Weather correlation |
| Setpoints | COV | Only record when changed |
| Alarms | On event | Every occurrence |
Avoid These Common Mistakes
| Mistake | Impact | Fix |
|---|
| 1-second intervals on all points | Fills disk in days | Use 5-15 minute intervals |
| History on every point | Unnecessary storage | Only trend points that need analysis |
| No capacity limits | Disk fills up | Set record count or time limits |
| COV with 0 tolerance | Records every tiny change | Set appropriate deadband |
| Never reviewing history config | Accumulates cruft | Audit quarterly |
Capacity Configuration
Setting History Limits
Configure per history extension:
History Extension Configuration:
Capacity Policy: "Ring Buffer" (overwrites oldest)
Record Count Limit: 50,000 records
-- OR --
Time Limit: 90 days
Recommended Limits by Platform:
JACE-8000: 30-90 days or 25,000 records
JACE-9000: 90-180 days or 50,000 records
Supervisor: 365 days or 100,000 records
Estimating Storage Requirements
Estimation Formula:
Storage = Points x Records_Per_Day x Record_Size x Retention_Days
Example:
500 points x 96 records/day (15-min interval)
x 40 bytes/record x 90 days
= 500 x 96 x 40 x 90
= 172,800,000 bytes
= ~165 MB
With COV points (variable):
Add 20-50% buffer for COV-based histories
Archiving to External Databases
Why Archive Externally?
- Preserve historical data beyond controller capacity
- Enable long-term analytics and reporting
- Reduce controller disk usage
- Centralize data from multiple controllers
Archive Architecture
Controllers → Niagara Supervisor → External Database
(Local history) (Collect + Forward) (Long-term storage)
↓
Analytics Platform
Reporting Tools
Supported External Databases
| Database | Configuration |
|---|
| SQL Server | HistorySqlServerService |
| PostgreSQL | HistoryPostgresService |
| MySQL | HistoryMysqlService |
| ODBC | HistoryOdbcService |
Archive Configuration
External Archive Setup:
1. Install database driver module
2. Add HistoryArchiveService to station
3. Configure database connection string
4. Select histories to archive
5. Set archive schedule (e.g., nightly)
6. Configure local retention after archive
Connection Example:
Driver: PostgreSQL
Host: dbserver.building.local
Port: 5432
Database: niagara_history
Username: niagara_writer
SSL: Required
Performance Tuning
Signs of History-Related Performance Issues
Symptoms:
- Station startup takes >5 minutes
- Web interface responds slowly
- History queries timeout
- Disk usage >80% on JACE
- Station watchdog warnings
Performance Optimization Steps
- Audit history point count: Remove histories on unused points
- Reduce collection frequency: Does every point need 1-minute intervals?
- Set capacity limits: Prevent unbounded growth
- Archive and purge: Move old data to external storage
- Compact history files: Use the history maintenance tool
- Monitor disk space: Set up alerts at 70% and 85% usage
Monitoring Disk Usage
Disk Monitoring Setup:
1. Add a NumericWritable for disk usage percentage
2. Create a program that checks disk space
3. Add alarm extension: Warning at 70%, Critical at 85%
4. Route alarm to operator console and email
Alternative: Use platform health monitoring
Platform > Monitor > Disk Space
Set thresholds for alerts
History Maintenance Tasks
| Task | Frequency | Method |
|---|
| Review history point list | Quarterly | Remove unused histories |
| Check disk space usage | Monthly | Platform monitor or script |
| Verify archive jobs | Monthly | Check archive service logs |
| Compact history files | Semi-annually | History maintenance tool |
| Clean orphaned histories | Annually | Remove histories for deleted points |
| Validate archived data | Quarterly | Query external database |
Cleaning Up Orphaned Histories
When points are deleted, their history files may remain:
Orphan Cleanup:
1. Open History Space in Workbench
2. Sort by "Source" column
3. Look for histories with missing/invalid sources
4. Select orphaned histories
5. Right-click > Delete History
6. Verify disk space recovered
Note: Always back up before deleting histories
References
- Tridium Niagara History Configuration Guide
- Tridium JACE-8000 Hardware Specifications
- Niagara Community Performance Best Practices
A well-tuned history configuration collects exactly the data you need for analysis without choking the controller that is supposed to be running your building.