Managing database connection latency in Confluence Data Center
Database connection latency measures the response time between your Confluence instance and its database server. This metric directly impacts system responsiveness, content operations, and overall user experience. More on Confluence unresponisve due to high data connection latency
Thresholds: | |
|---|---|
Optimal | Less than or equal to 1ms |
Requires attention | Between 2ms and 4ms |
Needs attention | Greater than 4ms |
How does high database latency affect Confluence?
High database connection latency can impact your Confluence instance in several ways:
Slower page creation and editing
Delayed content updates and visibility
Increased time for administrative tasks
Delayed search index updates
Overall degraded user experience
Potential timeout issues for database operations
What's the recommendation?
To optimize database connection latency, follow these recommendations:
Analyze network configuration
Network issues often cause connection latency. Follow these steps:
Run network diagnostics:
-- Check current connection timing
SELECT now() - query_start as "time_running"
FROM pg_stat_activity
WHERE state != 'idle'
ORDER BY "time_running" DESC;
2. Verify network setup:
Execute
pingtests (target response: <50ms)Run
tracerouteto identify network hopsCheck for network saturation using
iftopor similar tools
3. Review server proximity:
- Ensure database and application servers are in same datacenter
Verify network segment configuration
Check for any VPN or encryption overhead
More about database latency troubleshooting
Optimize database environment
Proper database maintenance significantly impacts connection performance:
Configure VACUUM settings:
Go to postgresql.conf
Adjust
autovacuum_vacuum_thresholdSet appropriate
maintenance_work_mem
ALTER SYSTEM SET maintenance_work_mem = '2GB';Monitor connection statistics:
SELECT * FROM pg_stat_database WHERE datname = 'confluence';
3. Implement regular maintenance:
Schedule daily VACUUM ANALYZE
Monitor bloat levels
Review and adjust shared_buffers:
ALTER SYSTEM SET shared_buffers = '4GB';
Optimize and Improve PostgreSQL Performance with VACUUM, ANALYZE, and REINDEX
Verify infrastructure setup
Review your deployment to ensure optimal database connectivity:
• Check server locations
Verify your database and application servers are in the same region and ideally in the same datacenter. Map out network paths between servers to identify potential bottlenecks.
• Evaluate network configuration
Review encryption requirements, network settings, and security measures that might impact connection speed. Pay special attention to any VPN or proxy configurations between servers.
• Monitor connection patterns
Track connection statistics and timeout frequencies across nodes. Set up alerts for unusual latency spikes or repeated timeout issues.
More about PostgreSQL database optimization
Preventive measures
Implement these practices to maintain optimal performance:
Set up a regular maintenance schedule that includes:
• Database maintenance during off-peak hours (typically 2-6 AM)
• Weekly reviews of database growth trends
• Monthly infrastructure checks including server specifications and load balancer settings