Sons of the Forest: Performance Optimization Guide
Optimize your Sons of the Forest server for maximum performance with comprehensive resource management, FPS optimization, and advanced server tuning techniques. This guide covers hardware requirements, configuration optimization, Linux-specific tuning, and troubleshooting common performance bottlenecks.
🖥️ Hardware Tuning
Match your server resources to player count for optimal performance.
⚙️ Configuration Optimization
Fine-tune server settings for maximum FPS and minimal lag.
🐧 Linux Optimization
Apply Linux-specific performance enhancements and kernel tuning.
Server Hardware Requirements
Recommended Specifications
Proper hardware allocation is crucial for smooth Sons of the Forest multiplayer experience:
| Players | CPU | RAM | Storage | Network |
|---|---|---|---|---|
| 1-4 | 4 cores @ 3.0 GHz | 8 GB | 10 GB SSD | 10 Mbps |
| 5-8 | 6 cores @ 3.5 GHz | 16 GB | 20 GB SSD | 20 Mbps |
| 9-16 | 8 cores @ 3.8 GHz+ | 32 GB | 50 GB NVMe SSD | 50 Mbps |
Performance Bottlenecks
Understanding where performance degrades helps target optimization efforts:
- CPU Bound: High frame time, low GPU usage - upgrade CPU or reduce entity count.
- RAM Bound: Frequent disk access, high memory usage - add more RAM or reduce texture quality.
- Network Bound: Lag, desync - improve network settings or upgrade connection.
- Disk Bound: Long load times, stutters - upgrade to SSD or NVMe storage.
Performance Settings
Optimized Configuration
Here's a comprehensive server configuration optimized for performance:
# Performance Configuration for SonsOfTheForestDS.cfg
# AI and Entity Management
MaxAICount=40 # Limit enemy AI count (max 100)
EnemyAggression=0.8 # Reduce AI processing frequency
AnimalCount=30 # Limit wild animals
PlayerCount=8 # Maximum players
# Graphics and Rendering
DrawDistance=0.8 # Reduce view distance (0.5-1.0)
ShadowQuality=Medium # Medium shadows for FPS balance
TextureQuality=High # Balance between quality and VRAM usage
AntiAliasing=FXAA # Fast antialiasing
ParticleEffects=Low # Reduce particle calculations
# Network Optimization
TickRate=60 # Server tick rate (30-120)
NetworkUpdateRate=30 # Network update frequency (10-60)
NetServerMaxTickRate=120 # Max server tick rate
PacketRate=60 # Packet send rate
# Memory Management
AutoSaveInterval=300 # Auto-save every 5 minutes (300s)
MaxSaveBackups=3 # Keep 3 backup saves
EnableMemoryGarbageCollection=true # Enable memory cleanup
# World Generation
WorldComplexity=0.7 # Reduce world complexity (0.5-1.0)
TreeDensity=0.8 # Reduce tree count
GrassDensity=0.6 # Reduce grass rendering
# Audio
AudioQuality=Medium # Reduce audio processing
MaxSoundInstances=50 # Limit concurrent sounds
Advanced Settings
For further optimization, consider these advanced parameters:
| Setting | Description | Performance Impact |
|---|---|---|
| UseMultithreading | Enable multi-threaded processing | High (30-40% improvement) |
| EnableStreaming | Asset streaming optimization | Medium (15-20% improvement) |
| ReducePhysicsAccuracy | Simplified physics calculations | High (25-35% improvement) |
| DisableVSync | Disable vertical sync | Low (5-10% improvement) |
| LimitLODTransitions | Reduce level of detail switching | Medium (10-15% improvement) |
Linux Server Optimization
System-Level Tuning
Optimize Linux kernel and system parameters for Sons of the Forest:
# Increase file descriptors for better I/O performance
ulimit -n 65536
# Set CPU affinity to prevent resource contention
# Assign server to specific CPU cores (adjust based on your CPU)
taskset -c 0-3 ./SonsOfTheForestDS.exe
# Optimize memory management
echo 1 > /proc/sys/vm/overcommit_memory
echo 3 > /proc/sys/vm/drop_caches
# Increase TCP buffer sizes for better network performance
echo "262144 1048576 4194304" > /proc/sys/net/ipv4/tcp_wmem
echo "262144 1048576 4194304" > /proc/sys/net/ipv4/tcp_rmem
# Optimize network stack
echo 1 > /proc/sys/net/ipv4/tcp_low_latency
echo 0 > /proc/sys/net/ipv4/tcp_timestamps
Performance Monitoring
Monitor your server to identify performance issues in real-time:
# Install monitoring tools
apt-get install htop iotop nethogs
# Monitor CPU and RAM usage
htop
# Monitor disk I/O
iotop
# Monitor network bandwidth
nethogs
# Monitor server processes
top -p $(pidof SonsOfTheForestDS.exe)
Kernel Optimization
Advanced kernel tuning for gaming servers:
# Edit /etc/sysctl.conf for persistent changes
# Network performance
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.ipv4.tcp_rmem = 4096 87380 16777216
net.ipv4.tcp_wmem = 4096 65536 16777216
# File system performance
vm.swappiness = 10
vm.dirty_ratio = 15
vm.dirty_background_ratio = 5
# Apply changes
sysctl -p
Client-Side Optimization
Player Settings
While server optimization is crucial, players should also optimize their clients:
| Setting | Recommended Value | Reason |
|---|---|---|
| Graphics Quality | Medium or High | Balances visual quality and performance |
| Shadows | Medium or Low | Shadows are computationally expensive |
| View Distance | High (if system allows) | See players and enemies from farther |
| Anti-Aliasing | FXAA or Off | MSAA is very demanding |
| Particles | Low or Medium | Fire, blood, and weather effects |
Network Optimization
Players should optimize their network settings:
- Use Wired Connection: Ethernet provides more stable connection than Wi-Fi.
- Close Background Apps: Reduce network traffic from other applications.
- Update Drivers: Keep network drivers updated for best performance.
- Router Settings: Enable QoS (Quality of Service) for gaming traffic.
Troubleshooting Performance Issues
Issue: High Latency/Lag
Solutions for network-related performance problems:
- Check Network Bandwidth: Ensure sufficient upload/download speeds for player count.
- Reduce TickRate: Lower server tick rate from 60 to 30 or 45.
- Optimize Network Settings: Apply Linux network optimization settings.
- Check Router: Verify no other devices are consuming bandwidth.
- Server Location: Ensure server is geographically close to players.
Issue: Low FPS
Solutions for frame rate issues:
- Reduce Draw Distance: Lower `DrawDistance` to 0.6 or 0.7.
- Disable Shadows: Set `ShadowQuality` to Low or Off.
- Reduce Entity Count: Lower `MaxAICount` and `AnimalCount`.
- Upgrade Hardware: Consider CPU or RAM upgrade if consistently low.
- Check Background Processes: Close unnecessary applications on server.
Issue: High Memory Usage
Solutions for RAM-related performance issues:
- Reduce Texture Quality: Lower texture quality to Medium or Low.
- Increase Auto-Save Interval: Change `AutoSaveInterval` to 600s (10 minutes).
- Limit Save Backups: Reduce `MaxSaveBackups` to 2 or 3.
- Enable Garbage Collection: Ensure memory cleanup is enabled.
- Add More RAM: Upgrade to higher RAM plan if consistently at limit.
Issue: Disk Performance
Solutions for storage-related bottlenecks:
- Use SSD Storage: Move server files to SSD if currently on HDD.
- Defragment Disk: Run defragmentation on HDD (not necessary on SSD).
- Reduce World Complexity: Lower `WorldComplexity` to 0.6.
- Clean Old Saves: Remove old save files to reduce disk usage.
- Monitor I/O: Use `iotop` to identify disk bottlenecks.
Performance Monitoring
Key Metrics to Track
Regularly monitor these metrics to ensure optimal performance:
- CPU Usage: Should stay below 80% during normal gameplay.
- RAM Usage: Maintain at least 2GB of free RAM for spikes.
- Frame Time: Should be 16.67ms or lower (60 FPS) consistently.
- Network Latency: Ping should be under 100ms for most players.
- Disk I/O: Should not be constantly at 100% during gameplay.
Performance Tools
Recommended tools for server monitoring:
- htop: Real-time CPU and RAM monitoring.
- iotop: Disk I/O monitoring.
- nethogs: Network bandwidth usage by process.
- sar: System activity reporter (historical data).
- vmstat: Virtual memory statistics.
Pro Tip: Monitor server performance with htop and adjust settings based on actual resource usage patterns. Create a performance baseline and compare against it when making changes to identify improvements.
Important: Performance optimization is iterative. Make small changes, test, and monitor results before making additional adjustments. Drastic changes can cause instability or unexpected behavior.
Maximize your server performance with expert optimization! Host your SOTF server with Supercraft for pre-optimized high-performance configurations, automatic scaling, and 24/7 monitoring.