Home > Products > 123 Flash Chat > server tunning
Tutorials

Server Tunning

123 Flash Chat Server Performance tuning

If your chat server needs to handle over 500 or even thousands of connections, it may be necessary for you to configure the parameters properly to improve the performance of the chat server.

General Tuning Tips

  1. Two parameters in "fcserver.xml" needs to be taken care of:
    • message-handle-workers
    • listen-workers

    If your concurrent active users exceeds 1000, you can slightly adjust these two values, for example, tune "message-handle-workers" to "100", and "listen-workers" to "50".
    Of course such modifications will use more memory accordingly.

  2. If your operating system is Linux/Unix, you may need to tune file descriptor limits, in this way:

Linux limits the number of file descriptors that any one process may open; the default limits are 1024 per process.
The open file limit is one of the limits that can be tuned with the ulimit command. The command ulimit -aS displays the current limit, and ulimit -aH displays the hard limit (above which the limit cannot be increased without tuning kernel parameters in /proc).
The following is an example of the output of ulimit -aH. You can see that the current shell (and its children) is restricted to 1024 open file descriptors.
core file size (blocks) unlimited
data seg size (kbytes) unlimited
file size (blocks) unlimited
max locked memory (kbytes) unlimited
max memory size (kbytes) unlimited
open files 1024
pipe size (512 bytes) 8
stack size (kbytes) unlimited
cpu time (seconds) unlimited
max user processes 4094
virtual memory (kbytes) unlimited

Increasing the file descriptor limit

The file descriptor limit can be increased using the following procedure:

1. Edit /etc/security/limits.conf and add the lines:
2. * soft nofile 1024
3. * hard nofile 65535
4. Edit /etc/pam.d/login, adding the line:
5. session required /lib/security/pam_limits.so
6. The system file descriptor limit is set in /proc/sys/fs/file-max. The following command will increase the limit to 65535:
7. echo 65535 > /proc/sys/fs/file-max
8. You should then be able to increase the file descriptor limits using:
9. ulimit -n unlimited
The above command will set the limits to the hard limit specified in /etc/security/limits.conf.
Note that you may need to log out and back in again before the changes take effect.
3. Distribute memory more properly when starting chat server.

If your 123flashchat server is installed on Linux/Unix server,


open your "fcserver.sh" file
find:
$JRE_HOME/bin/java -classpath $jre_lib:$ fcserver_lib com.topcmm.jchat.FCServer &
replace with:
$JRE_HOME/bin/java -Xms64m -Xmx512m -classpath $jre_lib:$ fcserver_lib com.topcmm.jchat.FCServer &

in fact, the added part is:
-Xms64m -Xmx512m between "java" and "-classpath".
You added 64M initial memory in that way, the maximum memory available reaches 512M. (If you need to configure like this, please make sure your server hardware is adequate for it.)
Note that you're required to restart chat server before the changes take effect.

If you're windows server user,

try this way:

1. Uninstall

Find: "uninstall_service.bat" in this directory:
<123FlashChatServer4.5 installed directory>server.
Double click it to uninstall the windows nt service of the chat software at first.

2. Edit

Then open "install_service.bat" with notepad or other text editor, find:

After "%my_pwd%jrebinclientjvm.dll", add:
"-DXms64m -DXmx512m"

The full script becomes:

Save it.

3. Install

Double click "install_service.bat" to install 123flashchat server nt service again, and restart chat server to make it effective.

Above tuning is as important as the server hardware itself. After the proper configuration, your 123 flash chat server running on an ordinary PC can support over ten thousand active connections.
And the good news is, 123 flash chat server will support load balance in the near future to support one hundred thousand to one million users at the same time.

If you have further questions about performance of 123 Flash Chat, don't hesitate to contact us: support@123flashchat.com.

TOPCMM News
24 Hours Support
+86-21-51785636 (China)
+1-858-866-9362 (USA)
Mailing List

For news, update and promotion of TOPCMM.


Home | About | Products | Download | FAQ | Order | Support | Features | Reviews | Demo | Links | Sitemap | Forum | Blog

Flash Chat | Java Chat Server| Chat Server Software| Instant Messaging Software| Live Help Chat
Webcam Chat | Web Chat Room| Enterprise Messaging| Enterprise Chat Software| Flash Chat in China
Legal Disclaimer| Privacy Statement | Terms of Use    Copyright © 2001-2008 TopCMM Software Corp. All Rights Reserved.