Similar to the server architecture of QQ games at the same time

xiaoxiao2021-03-06  41

Transfer from: 9CBS

The QQ game finally broke through millions of people at the same time, moving towards a more much goal, which made other many traditional chess leisure game platforms, compared with the group, the association seems to be qq. For the opponent, because QQ has more than 300 million registrations (of course, many are repeated registration) and QQ chat software 9 million online rate, we have been able to build a future by QQ build Powerful chess and casual game empire. Then, how is the QQ game realize millions of people at the same time and keep the game high efficiency? In fact, for any single network server program, the number of connections that can withstand is a theoretical peak, and the TSOCKET is defined by C : Word, we can determine that the peak of this connection is 65535, that is, said, Your single server program can withstand up to 60,000 users simultaneously. However, in practical applications, it is very difficult to connect to 10,000 people and ensure that normal data exchange is very difficult. Usually, this value is between 2000 and 5000, and it is said that QQ's single server is also connected at the same time. It is this value. It is not difficult to realize the single server of 2000 to 5000 users. Under Windows, more mature technology is to use IOCP - complete the port. There are a lot of information related to completing ports and 9CBS forum, and interested friends can search themselves. As long as it is applied, a completed port server can be used in the line at the same time of 2K to 5K. However, 5K's numerical value is too much different from the value of millions, so it is unable to implement a single server while millions of people. To achieve millions of people simultaneously online, you must first achieve a relatively complete completion of the port server model. This model requires at least 2K to 5K, at the same line rate (of course, if you Money, you can only develop up to 100 People online server). After constructing the basic completion port server, it is designed for the architecture of the server group. The reason is that this is a server group because it is not only a server, it is more than just a type of server. Simply put, the server model that realizes millions of people at the same time: Login Server Hall Server Room Server. Of course, it can be other models, but its basic idea is the same. Below, I will introduce each of these three types of servers one by one. Login Server: Under normal circumstances, we will open a number of public landing servers to players, just when QQ login, let you choose from the QQ game server to log in, QQ login, let the players choose six server entrances actually Login server. The login server mainly completes the load balance. In detail, behind the login server, there is a servers, the login server is just to select which hall server should be connected to the current client connection, when the landing server is selected for the current client connection After a suitable lobby server, the client starts to connect to the corresponding hall based on the information provided by the login server, and the client is interrupted to connect to the login server, and the other player client is connected to the login server to make a socket resource. When designing the login server, at least there should be the following features: Each hall server of the N lobby servers should be connected to all login servers, and in real time notify each of the login servers in the same number of online people. These include: When the number of online people increases information and the number of online number when the user exits is increased.

转载请注明原文地址:https://www.9cbs.com/read-77490.html

New Post(0)