Diagnostic Tools
System Resource Information
Get comprehensive system status:Thread Dumps
Capture thread dumps to diagnose deadlocks and performance issues (src/main/java/io/antmedia/statistic/StatsCollector.java:577):Heap Dumps
Capture heap dump for memory analysis:Log Files
Key log locations:Performance Issues
High CPU Usage
Symptoms:- CPU usage consistently above 75%
- Server rejecting new streams
- Viewers experiencing buffering
-
Enable GPU encoding:
-
Reduce transcoding:
-
Increase CPU limit:
- Scale horizontally: Add more origin servers
-
Optimize encoder settings:
High Memory Usage
Symptoms:- Memory usage above 75%
- OutOfMemoryError in logs
- Server becoming unresponsive
-
Increase JVM heap:
-
Increase memory limit:
-
Restart server periodically (temporary fix):
-
Capture and analyze heap dump:
Database Performance Issues
Symptoms:- Slow API responses
- High database query times
- Cluster synchronization delays
-
Add database indexes:
- Use faster storage: SSD instead of HDD
-
Increase MongoDB resources:
-
Use MongoDB replica set with read preference:
Streaming Issues
Streams Not Publishing
Symptoms:- Publishers can’t start streams
- “Encoder not opened” errors
- Publish timeout errors
- Check resource limits: CPU/memory may be at capacity
-
Verify codec support:
-
Check GPU availability:
-
Review application settings:
- Check codec settings
- Verify resolution limits
- Check bitrate constraints
- Check network connectivity: Firewall rules, port availability
Streams Not Playing
Symptoms:- Players can’t start playback
- 404 errors on HLS manifests
- WebRTC connection failures
-
Verify stream is live:
-
Check CORS settings (for web players):
-
Verify WebRTC settings:
- STUN/TURN configuration
- Port availability (UDP 50000-60000)
- ICE candidates
- Test with different players: VLC, ffplay, browser
Poor Stream Quality
Symptoms:- Pixelation, artifacts
- Buffering
- Audio sync issues
-
Increase bitrate:
-
Adjust encoder preset:
-
Check network bandwidth:
-
Enable adaptive bitrate:
Cluster Issues
Nodes Not Joining Cluster
Symptoms:- Node shows as DEAD
- Node not visible in cluster
- Database connection errors
-
Verify database configuration:
-
Check network connectivity:
-
Verify node group settings:
-
Check MongoDB replica set status:
-
Restart node:
Stream Not Found in Cluster
Symptoms:- Stream published on origin, not available on edge
- 404 errors when playing from edge
- Cluster routing failures
- Verify cluster mode enabled on all nodes
-
Check node groups match:
-
Check database synchronization:
- Ensure all nodes use same database
- Verify replica set is healthy
-
Restart edge nodes:
WebRTC Issues
ICE Connection Failures
Symptoms:- WebRTC connections timeout
- No video/audio in player
- ICE connection state: failed
-
Configure STUN server:
-
Configure TURN server (for restrictive networks):
-
Open UDP ports:
-
Set server public IP:
High Latency
Symptoms:- Delay between publisher and viewer
- Lag in interactive applications
- Growing buffer
-
Reduce GOP size:
- Use WebRTC for playback: Lower latency than HLS
-
Optimize encoder settings:
- Check network path: Use traceroute, check for packet loss
- Deploy closer to users: Use edge servers in multiple regions
System Health Checks
Automated Health Check Script
Getting Help
Collect Diagnostic Information
Before requesting support, collect:Support Resources
- Documentation: https://antmedia.io/docs
- Community Forum: https://github.com/ant-media/Ant-Media-Server/discussions
- Issue Tracker: https://github.com/ant-media/Ant-Media-Server/issues
- Enterprise Support: [email protected]
Common Error Messages
”Encoder blocked”
- Cause: Encoder initialization taking too long
- Solution: Check GPU availability, reduce resolution/bitrate
”Publish timeout”
- Cause: Stream initialization exceeded timeout
- Solution: Check network, reduce encoder load, increase timeout
”Not enough resource”
- Cause: CPU or memory limits exceeded
- Solution: Increase limits or add more servers
”Database connection failed”
- Cause: Cannot connect to MongoDB
- Solution: Check MongoDB status, network, credentials
”Port already in use”
- Cause: Another process using same port
- Solution: Check with
netstat, kill process or change port
