HelpChat Server performance tuning
How the server handles high concurrency, how to adjust the worker count, and how to enable TCP Fast Open.
1. How high concurrency works
The server installation root contains four core files:
| Process | Role | Architecture |
|---|---|---|
| hcdata | Data server (transfers large data such as files, cloud drive content and images) | Multi-process |
| hckernel | Core message server (sends and receives messages, maintains online status) | Multi-threaded |
| hclogin | Login server (login and registration) | Multi-process |
| hcadmin | Web admin console (not performance related) | — |
Multi-process architecture: runs a set number of copies of the same process, which share the high-concurrency workload. Multi-threaded architecture: runs a set number of worker threads in one process, which handle all high-concurrency tasks.
2. Checking the recommended worker count
The three performance-related processes use 8 workers by default. This may not be enough on a high-performance server. Use the -worker parameter to see the recommended value:
./hckernel -worker For example, an i9 CPU with 16 logical processors has a recommended worker count of 8 to 16.
Changing the worker count
Open config/server.ini in the server installation directory, change the following numbers and save:
[worker]
hclogin = 8
hckernel = 8
hcdata = 8 Choose values based on the number of CPU cores, memory size, number of online users and how often large files are transferred. Restart all background services after the change.
3. Enabling TCP Fast Open on Linux servers
Enabling TCP Fast Open on Linux can make network connections 10% to 25% faster, so images display and files download sooner:
echo 3 > /proc/sys/net/ipv4/tcp_fastopen To make it permanent, edit /etc/sysctl.conf and add:
net.ipv4.tcp_fastopen = 3 Tip
sysctl -p to apply it immediately without a restart.