Load Balancing IM server?
I''m starting a project with a friend that may end up being the next big thing (well, he thinks so at least, I just think it sounds fun). There is an IM aspect to this project and it may end up having a large number of users.
I will be using mysql for the user database and will be hosting on linux. With this in mind roughly how many users can I accomade with a single mid-range server if users average sending messages around three times a day (this will not be typical IM stuff).
Assuming this number is less than 100,000 are there any good tutorials on writing load balancing servers? Any good books that have examples and are not all theory?
"The paths of glory lead but to the grave." - Thomas GrayMy Stupid BlogMy Online Photo Gallery
> There is an IM aspect to this project
IM is a Peer-to-Peer type of application. The server is used for matchmaking 2 or more individuals and then the group gets detatched from the server and communicate with one another on their own. Therefore, I don''t understand your need for a powerful server to manage the traffic.
-cb
IM is a Peer-to-Peer type of application. The server is used for matchmaking 2 or more individuals and then the group gets detatched from the server and communicate with one another on their own. Therefore, I don''t understand your need for a powerful server to manage the traffic.
-cb
quote:
Original post by cbenoi1
> There is an IM aspect to this project
IM is a Peer-to-Peer type of application. The server is used for matchmaking 2 or more individuals and then the group gets detatched from the server and communicate with one another on their own. Therefore, I don''t understand your need for a powerful server to manage the traffic.
-cb
It doesn''t have to be peer to peer.
Looking for a serious game project?
www.xgameproject.com
quote:
Original post by cbenoi1
> There is an IM aspect to this project
IM is a Peer-to-Peer type of application. The server is used for matchmaking 2 or more individuals and then the group gets detatched from the server and communicate with one another on their own. Therefore, I don''t understand your need for a powerful server to manage the traffic.
-cb
In this case peer-to-peer would not be an option. All messages would have to go through the server.
"The paths of glory lead but to the grave." - Thomas GrayMy Stupid BlogMy Online Photo Gallery
1st part sounds like a simple numbers game to me... it all depends on how much data will be in these 3 messages, and if users messages will all be spread though the 24 hour period of 90% be between a couple of hours etc.
The way to work out the bandwidth usage is simply:
Average Message Size in characters (+small header size) x number of users sending messages at any one point in time
example.. if you on average are sending 100 character messages and you want 100,000 people to ALL be able to send a message at exactly the same second then it would use say approx 12,000,000 bytes including a 20 byte header (which actual size will depend on your protocol) per second. and of course thats just one way. that amount would be multipled by 2 (or 3 if the message was being recieved by 2 people in a chat room etc etc)
Load balancing:
Quite a simple method is to simply have all the servers interconnected almost as if they are normal clients to each other. Everytime a message is recieved from a client the server forwards it to the client if they are connected or looks up the server from a list which hosts the client.
This means that each server onyl has to recieve messages which it has a direct relation to (ie recieves a message from directly or is sending a message to one of its clients)
Of course it saves extra bandwidth if the multiple servers are located on a LAN so messages between them are not using your internet bandwidth
hope that kinda helps
The way to work out the bandwidth usage is simply:
Average Message Size in characters (+small header size) x number of users sending messages at any one point in time
example.. if you on average are sending 100 character messages and you want 100,000 people to ALL be able to send a message at exactly the same second then it would use say approx 12,000,000 bytes including a 20 byte header (which actual size will depend on your protocol) per second. and of course thats just one way. that amount would be multipled by 2 (or 3 if the message was being recieved by 2 people in a chat room etc etc)
Load balancing:
Quite a simple method is to simply have all the servers interconnected almost as if they are normal clients to each other. Everytime a message is recieved from a client the server forwards it to the client if they are connected or looks up the server from a list which hosts the client.
This means that each server onyl has to recieve messages which it has a direct relation to (ie recieves a message from directly or is sending a message to one of its clients)
Of course it saves extra bandwidth if the multiple servers are located on a LAN so messages between them are not using your internet bandwidth
hope that kinda helps
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement