Scaling IM Server On-Premise for High Availability
Last updated
Was this helpful?
Last updated
Was this helpful?
With the PortSIP PBX HA deployment, we need to deploy the IM service on a separate server.
Before proceeding with this guide, ensure that you have already completed the deployment.
For optimal performance, it’s recommended to install the IM service on a separate server, especially when handling a large number of users for chat and file-sharing activities (including files and pictures). The following hardware specifications are suitable for supporting up to 50,000 users online, with messaging and file sharing:
CPU: 20 cores or higher
Memory: 16 GB
Disk: High I/O performance required (SSD recommended, at least 256 GB)
Network Bandwidth: 1000 Mbps or higher, particularly if handling high volumes of messages and file sharing.
Static private IP: You must configure a static private IP for this IM server. In this case, we assume it's 192.168.1.25.
Static public IP: If your PBX and IM server are located in the cloud for the internet users to access, you must have a static public IP for this IM service. In this case, we assume it's 104.18.36.110.
PortSIP PBX High Availability (HA) and all associated servers require a consistent and compatible Linux environment.
Supported OS: Ubuntu 24.04 (64-bit)
All servers in the HA cluster must run the exact same OS version as the PBX server.
To ensure consistency and seamless operation across the HA cluster, IM server must meet the following user account requirements:
IM server ust use the same username and password as the PBX server.
In this guide, the username pbx
is used as an example. The user account must have sudo
privileges to execute administrative commands.
A minimum of 128 GB of disk space is required. No additional data partition is necessary. If you have massive users to send & receive messages, and share the files in the chat, please allocate an appropriate disks size.
For this setup, we assume the PortSIP PBX High Availability is installed on a server:
PBX Server High Availability Virtual IP address: 192.168.1.130
PBX Server static public IP address: 104.18.36.119.
Tasks that MUST be completed before installing cluster servers.
Ensure the server date-time is synced correctly.
If the Linux server is on a LAN, assign a static private IP address, in this case, 192.168.1.25.
Assign/route the static public IP address to this server, in this case, 104.18.36.110.
Install all available updates and service packs before installing the cluster server.
Do not install PostgreSQL on the server.
Ensure that all power-saving options for your system and network adapters are disabled (by setting the system to High-Performance mode).
Do not install TeamViewer, VPN, or similar software on the host machine.
The server must not be installed as a DNS or DHCP server.
This step is mandatory; the service will not function without it.
To prevent the PBX from restricting the request rate to the IM servers, you must add the IM servers' IP addresses to the PBX whitelist. Follow the steps below to complete this process:
Sign in to the PBX web portal as the System Administrator
Select the menu IP Blacklist > Add.
Enter the IM server IP as shown in the screenshot below, and choose a long expiration date.
Log in as the System Administrator to the PortSIP PBX HA Web portal.
Navigate to Servers > IM Servers.
Select the default server and click the Generate Token button.
Important: All below commands for extended servers must be executed on the pbx01
node, regardless of whether it is currently the active node.
If you are prompted to choose an option (yes/no), please enter yes.
Run the following command only on the pbx01 node of the HA PBX cluster.
The setup process may take several minutes—do not interrupt, reboot, or close the terminal until it completes.
Use the following command to deploy the IM server, specifying both the static private and static public IP addresses:
If you want to define a custom path to store IM chat files, use the -f
parameter. For example:
-a
– The static private IP address of the IM server
-A
– The static public IP address of the IM server
-f
– (Optional) Custom file path to store chat messages
If everything is set up correctly, the PBX web portal will display the IM server's IP address, as shown in the screenshot below.
If you have extra firewall in your network infrastructure, you must ensure that TCP port 8887 is open in the firewall rules. The client application requires access to this port in order to send and receive messages.
The following operations are supported for managing IM servers:
start
– Start the servers
stop
– Stop the servers
restart
– Restart the servers
rm
– Remove the installed servers
The following commands apply actions to the IM server:
Start:
Stop All:
Restart All:
Remove All:
Please follow the below steps to upgrade the IM server.
Log in as the System Administrator to the PortSIP PBX HA Web portal. Navigate to Servers > IM Servers, select the default server, and click the Generate Token button to generate the new token.
Now upgrade the IM server and run the following command on the pbx01
node. The process may take some time—do not interrupt, reboot, or close the terminal during execution.
Please ensure you have upgraded the PBX HA as per this guide: .