FiveM Server Leistungsoptimierung
FiveM Server-Leistungsoptimierung. Resource-Verwaltung, OneSync, Datenbankoptimierung und Client-FPS-Verbesserungen.
Inhaltsverzeichnis
Introduction
FiveM is a multiplayer modification framework running on GTA V. High player counts and complex resources can significantly impact server performance. This guide covers FiveM server performance optimization, resource management, OneSync configuration, database optimization, and client FPS improvements.
System Requirements
| Resource | 32 Slots | 64 Slots | 128+ Slots |
|---|---|---|---|
| CPU | 4 Cores | 6+ Cores | 8+ Cores |
| RAM | 8 GB | 16 GB | 32+ GB |
| Disk | 50 GB SSD | 100 GB NVMe | 200+ GB NVMe |
| Network | 50 Mbps | 100 Mbps | 200+ Mbps |
OneSync Configuration
OneSync is FiveM's advanced synchronization system required for high player counts.
server.cfg
# Enable OneSync
set onesync on
set onesync_enableInfinity true
set onesync_enableBeyond true
# Player limit
sv_maxclients 128
# Network settings
set sv_enforceGameBuild 3095
set sv_pureLevel 2
set sv_scriptHookAllowed 0
# Performance settings
set sv_projectName "REXE FiveM Server"
set sv_hostname "REXE FiveM"
OneSync Modes
| Mode | Description | Player Limit |
|---|---|---|
| off | OneSync disabled | 32 |
| on | Standard OneSync | 64 |
| on + Infinity | Advanced sync | 128+ |
| on + Beyond | Long-range sync | 2048 |
Resource Management
Resource Performance Analysis
set sv_resourceMonitor true
set sv_resourceMonitorInterval 5000
From server console:
resmon 1
Resource Optimization Tips
- Remove unnecessary resources: Disable unused scripts
- Thread usage: Optimize heavy operations with Citizen.Wait instead of Citizen.Wait(0)
- Event optimization: Reduce unnecessary network events
- Native calls: Cache frequently used natives
Optimization Example
-- BAD: Runs every frame
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
local ped = PlayerPedId()
local coords = GetEntityCoords(ped)
end
end)
-- GOOD: Runs at intervals
Citizen.CreateThread(function()
while true do
Citizen.Wait(1000) -- Once per second
local ped = PlayerPedId()
local coords = GetEntityCoords(ped)
end
end)
Database Optimization
MySQL/MariaDB Settings
[mysqld]
innodb_buffer_pool_size = 2G
innodb_log_file_size = 512M
innodb_flush_log_at_trx_commit = 2
innodb_flush_method = O_DIRECT
max_connections = 200
query_cache_type = 1
query_cache_size = 128M
oxmysql Optimization
set mysql_connection_string "mysql://user:password@localhost/fivem?charset=utf8mb4&connectionLimit=50"
Query Optimization
-- BAD: Query every time
Citizen.CreateThread(function()
while true do
Citizen.Wait(5000)
local result = MySQL.query.await('SELECT * FROM users WHERE id = ?', {playerId})
end
end)
-- GOOD: Use cache
local playerCache = {}
function GetPlayerData(playerId)
if playerCache[playerId] then return playerCache[playerId] end
local result = MySQL.query.await('SELECT * FROM users WHERE id = ?', {playerId})
playerCache[playerId] = result
return result
end
Client FPS Optimization
Streaming Settings
set sv_streamingMemoryLimit 2048
Network Optimization
set net_statsFile "netstats.log"
set sv_endpointPrivacy true
set rateLimiter_stateBagFlood_rate 75
set rateLimiter_stateBagFlood_burst 150
Port Configuration
| Port | Protocol | Usage |
|---|---|---|
| 30120 | TCP + UDP | FiveM game port |
| 40120 | TCP | txAdmin web panel |
Firewall Rules
sudo ufw allow 30120/tcp comment "FiveM TCP"
sudo ufw allow 30120/udp comment "FiveM UDP"
sudo ufw allow 40120/tcp comment "txAdmin"
sudo ufw reload
txAdmin Configuration
txAdmin is the FiveM server management panel:
# txAdmin comes bundled with FiveM
# Web panel: http://SERVER_IP:40120
Performance Monitoring
resmon 1 # Resource monitor
status # Player list
netgraph 1 # Network graph
Conclusion
FiveM server performance optimization is achieved through resource management, OneSync configuration, database optimization, and network settings. Regular performance monitoring and resource profiling ensure your server runs at peak performance. REXE VDS powerful infrastructure and Path.net DDoS protection keep your FiveM server running securely.
Verwandte Artikel
FiveM-Server einrichten: Schritt-für-Schritt-Anleitung
Vollständige Anleitung zur FiveM-Server-Installation auf REXE VDS: txAdmin-Konfiguration, Port-Einstellungen und Leistungsoptimierung für GTA V Roleplay-Server.
Minecraft-Server einrichten: Paper-Installationsanleitung
Vollständige Anleitung zur Minecraft-Server-Installation auf REXE VDS: Paper/Spigot, Java-Konfiguration, Plugin-Verwaltung und Leistungsoptimierung für stabiles Gameplay.
CS2-Server einrichten: Vollständige Anleitung mit SteamCMD
Vollständige Anleitung zur CS2 Dedicated-Server-Installation auf REXE VDS: SteamCMD, GSLT-Token, Serverkonfiguration, Spielmodi und DDoS-Schutz mit Path Panel.