Sunday 15 May 2011

c# - How to create a Real time chat server like skype/facebook/gtalk/paltalk/yahoo-messenger? -


I want to create a real-time chat server, currently I have created a server in that server. I client, when a client If I connect to my server then I will create a new thread for that client, for now it is working fine because I only have 100 clients connected, but I want my server to at least 20000 at a time Manage the client So I care a lot about the performance of my server, I think there is no good practice to make 20000 threads, so I have to say to some experts what steps should I take to create a scalable chat server Who can easily handle at least 20000 customers and I want you to provide some links to follow me.

You are right that creating a new thread for every customer is not a good idea. You can consider NIO based TCP servers. These have a fixed size thread pool and these threads request equally. 20000 TCP connections are not created by threads, but instead of one of the available threads available, some action should be taken. I have used the Jova-based NIO TCP server to develop a similar service and found that it is very well scales.

If you want to create a chat server as you mentioned, then you also worry about how and where you are going to save chat history, user management etc.

No comments:

Post a Comment