Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

In the era of cloud games, Huawei's cloud game deployment enables the development of the game industry.

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > IT Information >

Share

Shulou(Shulou.com)11/24 Report--

Preface

With the popularity of the game market, the game industry is gradually moving towards a pattern of boutique, IP and diversification, which also puts forward higher requirements for game developers. How to ensure the stable performance of the game and provide players with a smooth gang up experience? This double 11, ready to try to use Huawei Cloud services, immersive feel the power of the game cloud deployment solution.

1. Introduction of game architecture

1.1 Server Architecture

Different companies have different game server architectures, so the details of deployment are mostly different, but the basic deployment preparation is still the same. Take a look at our game architecture first to facilitate readers to understand the follow-up preparations.

1.1.1 specific introduction to server roles

Client: game client.

Gate: gateway service, which does not carry the link of the game, but only distributes the address of the game server. Players get the ip and port of the official game server from the gate server.

Game: there is only one main game server for players.

Room: room service. Players will enter the combat suit after entering the battle. If you fight more, you can do dynamic expansion.

Gm: background management server, which can publish events or manage player data.

Redis: mainly used for caching to avoid frequent database access pressure.

Mysql: mainly used for data persistence.

1.1.2 player data flow

Players (client) access the gate server through http to obtain the ip and port of the game service.

Client connects directly to the game server through the ip and the port, so the player can log in to the server.

When the player operates the character to match the battle, after the match is successful, the required data will be passed to the room server, and all battle instructions will be passed to the room service.

When players need to query data, such as to obtain a backpack, game server will first query like redis, if the data does not exist, like mysql query, the data will be stored in the cache after query.

When the player's character data changes, such as getting a new prop, you need to manipulate the database. The game server will update the database first and then update the cache.

Use gm when posting activities and modifying player data, by issuing instructions to the game server.

1.1.3 Inter-service interaction protocol

Http protocol: mainly occurs in places with few access scenarios, between client and gate,game and Gm.

Dubbo protocol: mainly used to exchange data between internal servers, simple and direct, just like manipulating local methods.

Webscoket: mainly used between client and game, because this is a web game server, so use websocket.

1.2 deployment mode

There are several reasons for using docker here:

Standardized application release to avoid problems caused by the environment.

Save time, facilitate rapid deployment and startup.

The team students are more familiar with it and reduce the possibility of making mistakes.

2. Deployment preparation

2.1 Environmental preparation

2.1.1 Machine preparation

Make a table statistics on the configuration of the server, as long as the server is ready. The following table is based on Huawei Cloud official website.

Note: the specific price is actually based on the official website price.

2.1.2 solution composition

Elastic CVM ECS: it is a computing service that is self-available and scalable on the cloud at any time, which helps to create a secure, reliable, flexible and efficient application environment.

Elastic load balancer ELB: automatically distributes access traffic to multiple CVMs to expand the external service capability of the application system and achieve a higher level of application fault tolerance.

Cloud database RDS for MySQL: it has the characteristics of ready-to-use, stable and reliable, safe operation, flexible scalability, easy management, economy and practicality, which enables customers to pay more attention to business development.

Redis version of distributed caching service: the industry's first Redis cloud service that supports both Arm and x86 architectures, supports dual-machine hot backup HA architecture, and provides standalone, master / slave, Proxy cluster, Cluster cluster, and read-write separation instance types to meet the business needs of high read-write performance scenarios and elastic modification.

Cloud log service LTS: provides one-stop log collection, second search, mass storage, structured processing, dump, visual chart and other features to meet application scenarios such as OPS, web log visual analysis, protection compliance and operation analysis.

DDoS defense AAD: provides global services to deal with DDoS attack challenges, provides millisecond attack response, multi-dimensional behavior analysis and machine learning, automatic tuning of defense strategies, and accurate identification of complex DDoS attacks to protect your business continuity.

Elastic public network IP EIP: elastic public network IP (Elastic IP) provides independent public network IP resources, including public network IP address and public network egress bandwidth service. It can be flexibly bound and unbound with elastic cloud servers, bare metal servers, virtual IP, elastic load balancers, NAT gateways and other resources, providing access to public network and being accessed by public network. Have a variety of flexible billing methods to meet the needs of different business scenarios

Document database service DDS: document database DDS is compatible with MongoDB protocol, and provides one-click deployment, auto expansion, disaster recovery, backup, recovery, monitoring and other service capabilities on the basis of Huawei Cloud's high performance, high availability, high security and self-scalability. Currently, three deployment architectures are supported: sharded cluster (Sharding), replica set (ReplicaSet) and single node (Single).

2.2 Mirror preparation

The image is ready to be packaged and pushed to a private repository. You can use some plug-ins, Jenkins, or manual push. Either way, prepare the manual commands that may be needed.

2.2.1 install the docker service

2.2.2 package Image

Copy the jar package to the same directory as dockerfile and execute the following command to package the image.

2.2.3 package the image as a local file

The image is exported as a compressed package, which is convenient for transmission.

2.2.4 unpack the image

After logging in to the server, copy the above file to the local machine and import the image to the current machine using the following command

2.3 deployment script

Note: the above is the development environment, and some environment variables are default, which need to be adjusted dynamically when the formal environment is deployed.

2.4 pay attention.

The gate server needs to activate public network ip.

The excel configuration file should be planned in advance and mounted in the docker script.

The data directory and log directory mounted by docker need to be planned in advance.

The port mapping within each server should be planned in advance.

The environment variables need to be modified in the script, including the mysql and redis database addresses, the server ip and port that need to be linked, and the relevant server configuration.

3. Formal deployment

3.1 Environmental investigation

Game pain points:

New games start, a large number of players are online, and the expansion of high concurrent access is not timely.

The network delay is high, the game stutters and the player is offline.

The self-built cycle is long and the cost is high, so it can not stretch flexibly.

Most game servers are computationally intensive, so game server cloud vendors choose the following core points:

The capacity of resource expansion can be expanded in time, and resources can be purchased flexibly according to demand, so as to achieve dynamic expansion and cost optimization, and support business operation in scenarios such as game launch, expansion, and service.

The computing power is excellent, and the same type of ECS is 15% higher than the competitor. The container is released quickly, and the performance is 20% higher than that of open source. BMS can be released in 5 minutes.

For security defense, Huawei Cloud provides single-line T-level DDoS high-defense IP service and millions of QPS-level CC protection. Based on AI capabilities such as hacker attack machine learning and business risk control big data intelligent isolation, Huawei Cloud ensures the long-term safe operation of medium-hand games.

Simplify cloud operation and maintenance work, and the platform provides game customers with 7x24 hourly services, special guarantee and expert support to ensure the stability of major events. Not only can the rapid deployment be realized, but also the Huawei cloud game management service platform can control the game content and the duration of game use. All cloud game operator customers can quickly access the Huawei cloud game management service platform to obtain a full set of automated deployment environment. Through the integration of game development and operation, we can ensure that the game optimization and experience upgrade can be completed in the real-time online scenario, so that the overall delivery efficiency of the product can be improved.

Tariff, easy to use and cheap is the pursuit of every company, reduce cost and increase efficiency, a variety of billing models, low initial budget, use according to demand, how much to pay, effectively alleviate the pressure of start-up capital and save money.

Conclusion: Huawei cloud game cloud deployment solution provides a global cloud infrastructure, supports tens of millions of players to run stably online at the same time, helps game companies to create quality games, and ensures flexible deployment and worry-free operation and maintenance of games.

3.2 package purchase

The following is a screenshot of the package on the official website, which can be used as a reference configuration until the formal production environment is dynamically configured according to resources.

Note: click to see the big picture.

3.3 Summary of Huawei Cloud Core strengths

Database capability: high concurrency scenario, performance stability is better than competitor Mysql master / slave switching efficiency is better than competitor.

Overseas Asia-Pacific coverage: Huawei's network quality (delay and packet loss) is generally better than its competitors (except Japan and South Korea, Vietnam and Taiwan).

Computing power: the same type of ECS-- ECS is 15% higher than the competitor; container-fast distribution, 20% higher performance than open source.

Network capability: the bandwidth forwarding efficiency of private network is the highest, with hundreds of millions of concurrency of ELB.

Security protection: Huawei Cloud creates a security platform for tenant isolation, and provides comprehensive security services to ensure business and data security, so as to protect your game.

Very simple operation and maintenance: cloud operation and maintenance work, the platform provides game customers with 7x24 hourly service, special guarantee, expert support to ensure the stability of major events.

High data reliability: through reasonable commercial and technical efforts, ECS service promises that the service availability rate per service cycle of single instance dimension is not less than 99.975%, and that of single region and multiple availability zone dimension is not less than 99.995% per service cycle. The flexible and scalable virtual block storage service based on distributed architecture has high data reliability and high I / O throughput capacity, and can ensure rapid data migration and recovery in the event of any replica failure. avoid data loss caused by a single hardware failure.

3.4 Machine environment preparation

3.4.1 install docker

After logging in remotely to the machine, switch to the root user, execute the following command, and install the docker environment

3.4.2 copy files to the target machine

The list of files is as follows:

The image file is copied locally according to the relevant command in 2.2. If you use a private warehouse, you do not need to perform this step.

Copy the configuration file to the machine, copy all excel configuration files to the machine, and configure the mount in the startup script

Start the script, create and modify the startup script in the planned directory, and set the appropriate parameters.

3.4.3 script execution

After all the files are ready, change to the directory where the script is located, and you can start the script directly. Take game as an example

3.4.4 verify that the server is working

First check the logs of all servers to see if there are any errors, and then log in with a special account to verify that the server is functioning properly.

Verification points:

You can log in normally

Can match the battle.

The http interface is normal.

The server is operating normally

The main business logic is normal

After verifying the above logic, inform the test students to carry out the functional test.

3.4.5 start service

After the students pass the test, set the server status to start-up state through gm, and the deployment process ends.

4. Summary

The platform of the ninth floor rises from the foundation of the earth. Huawei Yun's efforts in the game field are not an one-day plan.

Good cloud service providers can make things easier and easier, and Huawei Cloud deserves to be the first choice.

Huawei cloud game cloud deployment solution provides a global cloud infrastructure to support millions of players to run stably online at the same time, combined with cloud operation and maintenance operations, to help game enterprises achieve rapid business launch and flexible expansion, effectively respond to the sudden needs of games and the development needs of game enterprises to go abroad.

At present, Huawei Yunshuang 11 marketing season is under way, and many cloud-optimized products and popular style solutions are full of sincerity. From now on to November 30, you can enjoy a 10000 yuan gift package when you log on to Huawei's cloud official website. there are also certification and payment raffles, service support programs and other welfare games to help small and medium-sized enterprises to enter the cloud efficiently. If you are interested in it, please go and have a look.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

IT Information

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report