System
Manage system-level operations including backups, maintenance tasks, and health monitoring.
System Overview
Section titled “System Overview”Access the system dashboard at Admin > System to view:
- System health status
- Resource utilization
- Active background jobs
- Recent system events
Backup Management
Section titled “Backup Management”Backup Types
Section titled “Backup Types”| Type | Contents | Use Case |
|---|---|---|
| Full | Database + files | Disaster recovery |
| Database Only | Database without uploads | Quick snapshots |
| Incremental | Changes since last backup | Efficient storage |
Manual Backup
Section titled “Manual Backup”- Navigate to Admin > System > Backups
- Click Create Backup
- Select backup type
- Optionally add a description
- Click Start Backup
- Download when complete
Automated Backups
Section titled “Automated Backups”Configure scheduled backups:
| Setting | Description | Example |
|---|---|---|
| Schedule | Cron expression or preset | Daily at 2:00 AM |
| Retention | Number of backups to keep | 30 |
| Destination | Local or S3 storage | S3 bucket |
| Notification | Email on completion/failure | admin@company.com |
Schedule Presets:
- Hourly
- Daily (2:00 AM)
- Weekly (Sunday 2:00 AM)
- Custom cron expression
Backup Destinations
Section titled “Backup Destinations”Local Storage:
- Stored in
./pb_data/backups/ - Accessible for download via admin panel
- Limited by local disk space
S3-Compatible Storage:
- Requires S3 configuration in Services
- Automatic upload after backup
- Better for disaster recovery
Restoring from Backup
Section titled “Restoring from Backup”- Navigate to Admin > System > Backups
- Select the backup to restore
- Click Restore
- Confirm the operation
- Wait for restoration to complete
- System will restart automatically
Backup Best Practices
Section titled “Backup Best Practices”- Schedule daily backups minimum
- Keep at least 7 days of backups
- Store backups off-site (S3)
- Test restoration periodically
- Document backup procedures
Database Management
Section titled “Database Management”Database Information
Section titled “Database Information”View database statistics:
| Metric | Description |
|---|---|
| Size | Total database file size |
| Tables | Number of collections |
| Records | Total record count |
| Connections | Active database connections |
Database Optimization
Section titled “Database Optimization”Optimize database performance:
- Navigate to Admin > System > Database
- Click Optimize Database
- System runs VACUUM and ANALYZE
- Review optimization results
Run optimization:
- After large deletions
- Monthly for regular maintenance
- When performance degrades
Data Export
Section titled “Data Export”Export data for migration or analysis:
- Select collections to export
- Choose format (JSON, CSV)
- Click Export
- Download the export file
Background Jobs
Section titled “Background Jobs”Job Types
Section titled “Job Types”| Job | Purpose | Frequency |
|---|---|---|
| Backup | Automated backups | Scheduled |
| Cleanup | Temp file removal | Daily |
| Export | Async PDF generation | On-demand |
| Sync | Real-time collaboration sync | Continuous |
Job Queue
Section titled “Job Queue”View and manage background jobs:
| Status | Description |
|---|---|
| Pending | Waiting to run |
| Running | Currently executing |
| Completed | Finished successfully |
| Failed | Finished with error |
Failed Job Management
Section titled “Failed Job Management”For failed jobs:
- View error details
- Retry the job
- Or cancel and investigate
System Health
Section titled “System Health”Health Checks
Section titled “Health Checks”Monitor system components:
| Component | Checks |
|---|---|
| Database | Connection, query performance |
| Storage | Disk space, file access |
| Memory | Usage, available |
| CPU | Utilization |
| Network | Connectivity |
Health Endpoint
Section titled “Health Endpoint”Programmatic health check:
curl https://your-spear-instance/api/healthResponse:
{ "status": "healthy", "components": { "database": "healthy", "storage": "healthy", "memory": "healthy" }, "version": "1.0.0", "uptime": "5d 12h 30m"}Monitoring Integration
Section titled “Monitoring Integration”Export metrics for external monitoring:
curl https://your-spear-instance/api/metricsCompatible with Prometheus, Grafana, etc.
Log Types
Section titled “Log Types”| Log | Contents |
|---|---|
| Application | General application events |
| Access | HTTP request logs |
| Error | Error and exception details |
| Audit | Security-relevant events |
Viewing Logs
Section titled “Viewing Logs”- Navigate to Admin > System > Logs
- Select log type
- Filter by date, level, or search
- Export if needed
Log Retention
Section titled “Log Retention”Configure log retention:
| Setting | Default | Description |
|---|---|---|
| Application Logs | 30 days | General logs |
| Access Logs | 7 days | Request logs |
| Error Logs | 90 days | Error details |
| Audit Logs | 1 year | Security events |
External Logging
Section titled “External Logging”Forward logs to external services:
# Environment variable configurationLOG_OUTPUT=stdoutLOG_FORMAT=jsonLOG_LEVEL=infoCompatible with:
- ELK Stack (Elasticsearch, Logstash, Kibana)
- Splunk
- CloudWatch
- Datadog
Maintenance Mode
Section titled “Maintenance Mode”Enabling Maintenance Mode
Section titled “Enabling Maintenance Mode”During maintenance, users see a maintenance page:
- Navigate to Admin > System > Maintenance
- Set maintenance message
- Set expected duration (optional)
- Click Enable Maintenance Mode
Maintenance Tasks
Section titled “Maintenance Tasks”With maintenance mode enabled:
- Database migrations
- Large data imports
- System upgrades
- Performance optimization
Disabling Maintenance Mode
Section titled “Disabling Maintenance Mode”- Complete maintenance tasks
- Navigate to Admin > System > Maintenance
- Click Disable Maintenance Mode
- Verify system is operational
Updates
Section titled “Updates”Version Information
Section titled “Version Information”View current version:
- Navigate to Admin > System > About
- Or run
./spear --version
Update Process
Section titled “Update Process”- Download new release
- Enable maintenance mode
- Create backup
- Stop current instance
- Replace binary
- Start new instance
- Verify migrations ran
- Disable maintenance mode
- Verify functionality
Automatic Updates
Section titled “Automatic Updates”Resource Limits
Section titled “Resource Limits”Configuration
Section titled “Configuration”Set resource limits via environment variables:
# Memory limitSPEAR_MAX_MEMORY=2GB
# File upload limitSPEAR_MAX_UPLOAD_SIZE=50MB
# Concurrent requestsSPEAR_MAX_CONNECTIONS=100
# Background job workersSPEAR_JOB_WORKERS=4Monitoring Limits
Section titled “Monitoring Limits”View resource usage vs limits:
- Navigate to Admin > System > Resources
- Review current utilization
- Adjust limits as needed
Troubleshooting
Section titled “Troubleshooting”System Won’t Start
Section titled “System Won’t Start”- Check logs for errors
- Verify disk space available
- Check port availability
- Verify encryption key set
- Check file permissions
Slow Performance
Section titled “Slow Performance”- Review database size
- Run database optimization
- Check disk space
- Review background job queue
- Consider resource limits
Backup Failures
Section titled “Backup Failures”- Check disk space
- Verify S3 credentials (if applicable)
- Review backup job logs
- Test manual backup
- Check file permissions
High Memory Usage
Section titled “High Memory Usage”- Review active connections
- Check for large file uploads
- Review background job queue
- Consider memory limits
- Restart if necessary