Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


TCPMUX/Multiplexer for a chat server handling 100K clients, can anyone explain it to me?

Posted on 2011-04-23
Medium Priority
Last Modified: 2012-05-11
I am project managing a project that involves a high scalable chat server. It need to maximize the limitation of tcp connection/sockets to the server.

I know a single IRC server can handle a limited number of active connections. I have been told by implementing a multiplexer / tcpmux on top of the server. The limit can be increased.

Can somebody please explain it to me how this exactly works, I have been googling for more info for a few hours. But I cant find any practical showcases regarding to chat servers.

Thank you.
Question by:Octalys
1 Comment
LVL 27

Accepted Solution

Nopius earned 2000 total points
ID: 35457544

Really TCPMUX has nothing to do with raising the number of connections. Really you have 2 choices.
You are about to go behind kernel limits and there is nothing to do with using some 'service'.
So there are not many choices:
1) You may use only one server host with tuned kernel (there are better OSes then Linux for handling so many users):
FreeBSD: http://rerepi.wordpress.com/2008/04/19/tuning-freebsd-sysoev-rit/
Solaris: http://lkml.indiana.edu/hypermail/linux/kernel/9909.3/0553.html
On Linux that's possible, but there are another restrictions (say if you use iptables with stateful rules "conntrack" - it is limited to 64K entries). A must tuning:
sysctl net.ipv4.tcp_tw_recycle=1                                                                            
sysctl net.ipv4.tcp_tw_reuse=1                        
sysctl net.ipv4.tcp_orphan_retries=1
echo "104854" > /proc/sys/fs/file-max
More info (a bit outdated): http://www.kegel.com/c10k.html

2) You may setup many servers with a load balancing DNS server ( http://en.wikipedia.org/wiki/Load_balancing_%28computing%29 )
3) You may setup 1 TCP load balancer + many backend servers say http://haproxy.1wt.eu/ or http://www.linuxvirtualserver.org/whatis.html

Every configuration should be tested before putting it in production.



Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
Configuring network clients can be a chore, especially if there are a large number of them or a lot of itinerant users.  DHCP dynamically manages this process, much to the relief of users and administrators alike!
Integration Management Part 2
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Suggested Courses

581 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question