Overview
TeamSpeak 6 Server provides several configuration options to optimize performance for your specific hardware and workload. This guide covers thread configuration, database connection pooling, buffer settings, and other performance-related parameters.Voice Processing Threads
The server uses multiple threads to process voice data. Adjusting the thread count can significantly impact performance.Voice UDP Threads
Number of threads to use for voice processing.Range: 1 - 16Environment Variable:
TSSERVER_VOICE_UDP_THREADSOptimal Thread Configuration
The optimal number of voice threads depends on your hardware:| CPU Cores | Concurrent Users | Recommended Threads |
|---|---|---|
| 2-4 | < 50 | 2-3 |
| 4-8 | 50-200 | 4-6 |
| 8-16 | 200-500 | 6-10 |
| 16+ | 500+ | 10-16 |
Thread Tuning Guidelines
Increase threads when:- CPU usage is high but cores aren’t fully utilized
- Voice quality degrades during peak usage
- Server handles many simultaneous talkers
- Running on multi-core systems (8+ cores)
- Running on limited CPU resources (VPS, containers)
- Server has few concurrent users (< 50)
- Context switching overhead is high
- Other services share the same CPU
Database Connection Pool
The database connection pool manages connections between the server and database. Proper sizing is crucial for performance.Connection Pool Size
Number of connections to establish to the database.Range: 2 - 100Environment Variable:
TSSERVER_DATABASE_CONNECTIONSSizing Database Connections
Connection pool sizing depends on your workload:| Scenario | Users | Virtual Servers | Recommended Connections |
|---|---|---|---|
| Small | < 100 | 1-2 | 5-10 |
| Medium | 100-500 | 3-10 | 10-20 |
| Large | 500-2000 | 10-50 | 20-50 |
| Enterprise | 2000+ | 50+ | 50-100 |
Connection Pool Best Practices
- Start conservative: Begin with default (10) and increase based on monitoring
- Monitor usage: Track active connections vs. available connections
- Database limits: Ensure database server supports total connections across all instances
- Multi-instance setups: Total connections = connections per instance × number of instances
For multi-instance deployments sharing a database, ensure your database server’s max_connections is higher than the sum of all instance connection pools.
Database Connection Timeout
Timeout in seconds when connecting to the database.Range: 1 - 432000 (5 days)Environment Variable:
TSSERVER_DATABASE_TIMEOUTQuery Interface Performance
Query Pool Size
Number of threads to use for Server Query command processing.Range: 2 - 32Environment Variable:
TSSERVER_QUERY_POOL_SIZEQuery Pool Sizing
| Query Load | Concurrent Connections | Recommended Pool Size |
|---|---|---|
| Light | 1-5 | 2-4 |
| Moderate | 5-20 | 4-8 |
| Heavy | 20-50 | 8-16 |
| Very Heavy | 50+ | 16-32 |
Query pool size should match your concurrent Server Query usage patterns. If you primarily use Server Query for occasional administration, keep this low. If you have automated systems constantly querying the server, increase accordingly.
Query Buffer Size
Memory (in MB) to allocate for Server Query connection buffering.Range: 20 - 100Environment Variable:
TSSERVER_QUERY_BUFFER_MBQuery Timeout
Timeout in seconds before Server Query connections are automatically closed due to inactivity.Environment Variable:
TSSERVER_QUERY_TIMEOUTPerformance Monitoring
Query Statistics Logging
Interval in seconds to log Server Query performance statistics.Range: 10 - 31556952 (1 year)Environment Variable:
TSSERVER_QUERY_LOG_TIMING- Total queries processed
- Average query execution time
- Slow queries
- Connection pool usage
Database Performance
Query Logging
Enables logging of all SQL queries.Environment Variable:
TSSERVER_DATABASE_LOG_QUERIESSQLite Integrity Check
Skips SQLite database integrity check at startup.Environment Variable:
TSSERVER_DATABASE_SKIP_INTEGRITY_CHECKIntegrity checks add startup time but ensure database health. Only skip for large databases where startup time is critical and you have other validation methods.
Database Client Cleanup
Number of days to keep inactive client records in the database.Environment Variable:
TSSERVER_DATABASE_CLIENT_KEEP_DAYS- Decreases database size
- Improves query performance
- Reduces backup size and time
System-Level Optimization
Process Priority
Increase server process priority:File Descriptor Limits
Increase file descriptor limits for high-concurrency:Memory Settings
Ensure sufficient memory is available:- Base server: 50-100 MB
- Per virtual server: 10-20 MB
- Per connected user: 0.5-2 MB
Disk I/O Optimization
For SQLite databases:- Place database on SSD storage
- Optimize database server configuration
- Use connection pooling
- Enable query caching
Network Performance
TCP Settings
Optimize TCP settings for Server Query:UDP Buffer Sizes
Increase UDP buffer sizes for voice traffic:Monitoring and Metrics
Key Metrics to Monitor
-
CPU Usage
- Per-core utilization
- Context switches
- Thread count
-
Memory Usage
- Resident memory (RSS)
- Virtual memory
- Memory growth over time
-
Database Performance
- Connection pool utilization
- Query execution time
- Slow queries
-
Network
- Bandwidth usage
- Packet loss
- Connection count
-
Voice Quality
- Codec latency
- Packet jitter
- Voice buffer underruns
Monitoring Tools
Performance Benchmarking
Load Testing
- Simulate users with automated clients
- Monitor metrics during test
- Identify bottlenecks (CPU, memory, network, database)
- Adjust configuration based on results
- Retest to verify improvements
Configuration Testing Matrix
Test different configurations:| Test | Voice Threads | DB Connections | Query Pool | Result |
|---|---|---|---|---|
| Baseline | 5 | 10 | 2 | (measure) |
| Test 1 | 8 | 10 | 2 | (compare) |
| Test 2 | 5 | 20 | 2 | (compare) |
| Test 3 | 8 | 20 | 4 | (compare) |
Optimization Checklist
Initial Setup
- Configure voice threads based on CPU cores
- Size database connection pool appropriately
- Set query pool size for expected Server Query load
- Configure client retention period
- Enable query timing logs
Regular Maintenance
- Monitor resource usage weekly
- Review slow queries monthly
- Analyze query timing logs
- Check database size and growth rate
- Verify backup and restore performance
Performance Issues
- Review recent configuration changes
- Check system resource availability
- Analyze database query performance
- Monitor network latency and packet loss
- Review server logs for errors or warnings
Troubleshooting Performance Issues
High CPU Usage
-
Check thread configuration:
- Reduce voice threads if context switching is high
- Verify thread count matches CPU cores
-
Disable expensive features:
-
Review permission complexity:
- Simplify permission hierarchies
- Reduce client-specific permissions
High Memory Usage
-
Reduce buffer sizes:
-
Limit connection pools:
-
Check for memory leaks:
- Monitor memory growth over time
- Restart server regularly if leak suspected
- Update to latest version
Database Performance Issues
-
Optimize connection pool:
-
Database maintenance:
-
Consider migration:
- SQLite → MariaDB for better concurrency
- Local DB → Remote DB with faster hardware
Network Performance Issues
-
Check network configuration:
-
Optimize UDP settings:
- Increase UDP buffer sizes (see Network Performance section)
- Check for packet loss
- Verify QoS settings
-
Review voice thread configuration:
Related Topics
- Database Configuration - Configure database connections
- Virtual Servers - Multi-instance deployments
- Server Query - Monitor server via Server Query
- Logging - Configure logging for performance analysis