Brazil's biggest MU Online portal — since 2003
Tutorial Advanced Tutoriais

How to Load Balance Between Multiple MU Online Servers

Learn to distribute players across multiple GameServers using ConnectServer, configuring routing rules, capacity limits, and automatic failover.

VI ViciadosMU Team · Updated on 3 jul 2026 · ⏱ 12 min read

Multi-Server Architecture Overview

Load balancing on MU Online private servers means distributing players across multiple GameServers through a single entry point: the ConnectServer. When properly configured, this increases total simultaneous player capacity, reduces lag, and ensures no single server becomes overloaded.

The standard architecture works as follows:

MU Online Client
       |
       v
ConnectServer (port 44405)
       |
       +---> GameServer 0 (port 55901) — Channel 1 (e.g., Lorencia)
       +---> GameServer 1 (port 55902) — Channel 2 (e.g., Devias)
       +---> GameServer 2 (port 55903) — Channel 3 (e.g., Noria)
       |
       v
DataServer (port 55557) — Shared database
Nota: All GameServers share the same SQL Server database. The DataServer acts as an intermediary between GameServers and SQL Server. In Season 6 EP3 configurations, the DataServer is mandatory.

Prerequisites

Before starting, make sure you have:

  • SQL Server 2008/2012/2014 installed with a working MuOnline database
  • At least one functional GameServer as your base
  • Access to the server root folder (e.g., C:\MuServer\)
  • Available ports in your firewall: 44405 (ConnectServer), 55901-5590X (GameServers), 55557 (DataServer)

Step 1: Configure ConnectServer for Multiple GameServers

The main configuration file is located at ConnectServer\ConnectServer.cfg. Open it and find the server section:

[ServerInfo]
ServerCount = 3

[ServerInfo0]
ServerCode    = 0
ServerName    = Lorencia
ServerIp      = 127.0.0.1
ServerPort    = 55901
ServerType    = 0
MaxConnect    = 1000
CurrentConnect= 0
ShowYn        = 1

[ServerInfo1]
ServerCode    = 1
ServerName    = Devias
ServerIp      = 127.0.0.1
ServerPort    = 55902
ServerType    = 0
MaxConnect    = 1000
CurrentConnect= 0
ShowYn        = 1

[ServerInfo2]
ServerCode    = 2
ServerName    = Noria
ServerIp      = 127.0.0.1
ServerPort    = 55903
ServerType    = 0
MaxConnect    = 500
CurrentConnect= 0
ShowYn        = 1
Dica: Use ServerType = 1 to mark a server as "PVP exclusive" in the channel list. This displays differently to the player on the server selection screen.

Critical parameters:

FieldDescription
ServerCodeUnique server ID (0, 1, 2...) — must match the GameServer setting
MaxConnectMaximum player limit for this GameServer
ShowYn1 = visible in list, 0 = hidden (useful for maintenance)

Step 2: Configure Each GameServer

For each GameServer, open GameServer\GameServer.cfg (or main.cfg depending on the version) and adjust:

[GameServerInfo]
ServerCode     = 1
ServerName     = Devias
ServerPort     = 55902
MaxUserCount   = 1000
DataServerIp   = 127.0.0.1
DataServerPort = 55557
ConnectServerIp   = 127.0.0.1
ConnectServerPort = 44405
Atenção: The ServerCode field in each GameServer must be unique and identical to the ServerCode defined in ConnectServer.cfg. Servers with duplicate codes will cause authentication conflicts and random disconnections.

For each additional GameServer, copy the entire GameServer\ folder and rename it to GameServer1\, GameServer2\, etc. Only change the ServerCode, ServerName, and ServerPort in each copy.

Resulting directory structure:

C:\MuServer\
  ConnectServer\
  DataServer\
  GameServer\        (ServerCode=0, port 55901)
  GameServer1\       (ServerCode=1, port 55902)
  GameServer2\       (ServerCode=2, port 55903)
  EventServer\

Step 3: Configure DataServer to Accept Multiple Connections

The DataServer centralizes database access. Open DataServer\DataServer.cfg:

[DataServerInfo]
ServerPort     = 55557
MaxConnectCount= 15
DBServerIp     = 127.0.0.1
DBServerPort   = 1433
DBName         = MuOnline
DBUserID       = sa
DBPassword     = your_password_here

Increase MaxConnectCount to accommodate all GameServers (3 GameServers + margin = 15 connections is sufficient).


Step 4: Adjust the Database for Multi-Server Operation

With multiple GameServers, you need to ensure character data remains consistent. Run the following in SQL Server Management Studio:

-- Check for duplicate characters across servers (should not exist)
SELECT Name, COUNT(*) as Total
FROM MuOnline.dbo.Character
GROUP BY Name
HAVING COUNT(*) > 1;

-- Add index to improve performance with multiple servers
IF NOT EXISTS (
    SELECT * FROM sys.indexes 
    WHERE name = 'IX_Character_AccountID' 
    AND object_id = OBJECT_ID('dbo.Character')
)
BEGIN
    CREATE INDEX IX_Character_AccountID 
    ON MuOnline.dbo.Character (AccountID);
END

-- Check and clear stuck sessions from other servers
UPDATE MuOnline.dbo.MEMB_STAT
SET ConnectStat = 0,
    ServerName  = '',
    IP          = ''
WHERE ConnectStat = 1
AND DATEDIFF(MINUTE, LastConnect, GETDATE()) > 30;
Dica: Run the stuck session cleanup script (MEMB_STAT) every time you restart any GameServer. Stuck sessions prevent players from logging in again.

Step 5: Implement Per-Channel Capacity Limits

To distribute players evenly, set different limits per server according to available hardware:

-- Check current usage per server (monitoring)
SELECT 
    ServerName,
    COUNT(*) AS OnlinePlayers
FROM MuOnline.dbo.MEMB_STAT
WHERE ConnectStat = 1
GROUP BY ServerName
ORDER BY OnlinePlayers DESC;

In ConnectServer.cfg, adjust the MaxConnect values proportionally to each machine's capacity. A server with 4GB RAM supports approximately 500 players; 8GB RAM supports approximately 1000-1200.


Step 6: Create Startup Scripts in the Correct Order

Startup order is critical. Create a StartAll.bat file in C:\MuServer\:

@echo off
echo Starting MU Online infrastructure...

echo [1/5] Starting DataServer...
start "DataServer" /D "C:\MuServer\DataServer\" DataServer.exe
timeout /t 5 /nobreak > nul

echo [2/5] Starting ConnectServer...
start "ConnectServer" /D "C:\MuServer\ConnectServer\" ConnectServer.exe
timeout /t 3 /nobreak > nul

echo [3/5] Starting GameServer 0...
start "GameServer0" /D "C:\MuServer\GameServer\" GameServer.exe
timeout /t 8 /nobreak > nul

echo [4/5] Starting GameServer 1...
start "GameServer1" /D "C:\MuServer\GameServer1\" GameServer.exe
timeout /t 8 /nobreak > nul

echo [5/5] Starting GameServer 2...
start "GameServer2" /D "C:\MuServer\GameServer2\" GameServer.exe
timeout /t 5 /nobreak > nul

echo All servers started!
pause
Atenção: Always start in this order: DataServer → ConnectServer → GameServers. Starting GameServers before DataServer causes connection errors and may corrupt session data.

Step 7: Configure Events for Multi-Server

Events like Blood Castle and Devil Square need to be configured in each GameServer separately. Navigate to GameServer\Data\Events\ (or GameServer1\Data\Events\) and adjust schedules so they either run at the same time across all servers (parallel events) or at offset times to avoid splitting the player base:

; GameServer\Data\Events\BloodCastle.cfg
[BloodCastleInfo]
Enable     = 1
StartTime0 = 0:00
StartTime1 = 2:00
StartTime2 = 4:00
StartTime3 = 6:00
StartTime4 = 8:00
StartTime5 = 10:00
StartTime6 = 12:00
StartTime7 = 14:00
StartTime8 = 16:00
StartTime9 = 18:00
StartTime10= 20:00
StartTime11= 22:00
Nota: On high-population servers, run large-scale events like Crywolf and Castle Siege on only one GameServer (usually the highest-capacity one) to concentrate the action and avoid empty event maps.

Troubleshooting

Problem: Players get stuck on the server selection screen → Verify that ServerCode in GameServer.cfg exactly matches ConnectServer.cfg → Confirm the GameServer port is accessible (telnet 127.0.0.1 55902) → Check the log at GameServer1\Log\GameServer.log for DataServer connection errors

Problem: A character appears on two servers simultaneously → Run the UPDATE on the MEMB_STAT table to clear duplicate sessions → Check whether two GameServers share the same ServerCode

Problem: ConnectServer does not list all servers → Confirm that ServerCount in ConnectServer.cfg matches the actual number of [ServerInfoX] blocks → Restart ConnectServer after any change to the .cfg file

Problem: High lag on one specific server → Temporarily reduce MaxConnect for that GameServer (set ShowYn=0 and restart) → Check CPU/RAM usage on the machine hosting that GameServer → Analyze slow queries in SQL Server with: SELECT TOP 10 * FROM sys.dm_exec_query_stats ORDER BY total_elapsed_time DESC

Perguntas frequentes

How many GameServers can I add to the ConnectServer?

There is no hard limit in the standard ConnectServer, but Season 6 servers are stably tested with up to 10-15 GameServers. Each additional GameServer requires a separate entry in ConnectServer.cfg and a unique TCP/UDP port (e.g., 55901, 55902, 55903...).

What happens if a GameServer crashes while players are connected?

Connected players will be immediately disconnected. To mitigate this, set ShowYn=0 in the problematic GameServer entry before restarting it, redirect new logins via ConnectServer, and implement monitoring with automatic restart via batch script or Windows service.

How do I restrict certain channels to VIP players only?

In GameServer/Data/ServerInfo.cfg set the MaxConnect field to the desired limit, and use VIP access rules in the GameServer code or via the T_Account table in SQL Server, checking the AccountLevel or memb_grade field before allowing entry to that specific channel.

Can I run GameServers on separate physical machines?

Yes. The ConnectServer communicates with GameServers via IP:Port configured in ConnectServer.cfg. Each GameServer can be on a different machine as long as the IPs are reachable between them over a LAN or VPN, and ports are open in the firewall (default: 55901+, UDP 55557).

VI

ViciadosMU Team

Equipe editorial do ViciadosMU — portal de MU Online no ar desde 2003.

Keep reading

Related articles