With the rapid progress of our times, Huawei's virtual machine is no longer unfamiliar to us. We all know the powerful performance of Huawei's virtual machine, but few people know how to optimize Huawei's virtual machine, so their use experience is limited. They could have a better experience. How to optimize the performance of Huawei's virtual machine to make it better? So today, Micronet will take you to learn about it. Micronet believes that it can be optimized from the following aspects:
1. Use of Huawei VM memory database
Optimizing the memory database of Huawei virtual machine is actually a database that puts the data of Huawei virtual machine on the storage for direct operation. Compared with disk, the data read and write speed of memory is several orders of magnitude faster. Saving data in memory can greatly improve the performance of applications. The storage database abandons the traditional disk data management mode, redesigns the system structure based on the storage of all data in the storage, and makes corresponding improvements in data caching, fast algorithms, parallel operations, etc., making the data processing speed of Huawei virtual machine much faster than that of traditional databases.
But the security problem can be said to be the biggest hard injury to the memory database. Because the memory itself has the natural defect of current loss, Micronet believes that when we use the memory database, we usually need to take some protection mechanisms for the data in the memory in advance, such as backup, log recording, hot backup or cluster, synchronization with the disk database, and so on. Although some data is not very important, if you want to respond quickly to users' requests, you can consider using an in memory database for storage, and regularly store the data on disk.
2. Use of RDD on Huawei VM
Spark can be used to accelerate data processing in applications related to big data cloud computing. The core of Spark is RDD, which is the original source of a paper "Resilient Distributed Datasets: Foundation of AFault Tarrant Analysis Framework" published by Berkeley Lab. Existing data stream systems cannot effectively deal with two applications: one is the iterative algorithm that is prevalent in the field of graphic applications and machine learning, and the other is interactive data mining tools. In either case, saving the data of Huawei virtual machine in memory can greatly improve the performance.
3. System cache of Huawei virtual machine
Many web applications contain a large amount of static content, most of which are small files. Apache and nginx are used as the web servers of Huawei virtual machines and are often read. When the amount of web access is small, these two http servers can be said to be very fast and efficient. If the load is large, we can build a cache server on the front end of the Huawei virtual machine to cache the static resource files on the Huawei virtual machine to the operating system memory for direct reading, because reading directly from memory is faster than reading from hard disk. This actually increases the cost of memory to reduce the time required to access the disk.
4. SSD usage
In addition to optimizing memory, you can also optimize the disks of Huawei virtual machines. Compared with the traditional mechanical hard disk, the solid state disk has the advantages of fast reading and writing speed, light weight, low energy consumption, small size and so on. However, the price of SSDs is higher than that of traditional mechanical hard disks. If possible, SSDs can be used to replace mechanical hard disks.
5. Database optimization
Most of the requests of Huawei virtual machines will end up in the database, and the speed of accessing the database will become slower as the amount of data increases. In order to improve the request processing speed, the original single table must be cut. The current mainstream Linux system virtual machine uses MySQL as the database. If we use MySQL to store a separate data table, the query speed will be very slow. Partitioning the database based on appropriate business rules can effectively improve the access speed of the database and the overall performance of Huawei virtual machine. In addition, for business query requests, indexes can be set according to relevant requirements when creating tables to improve query speed.
6. Select the appropriate IO mode
Input and output models are divided into:
(1) Blocking I/O model: I/O is always blocked before the data arrives, and returns when it arrives. Usually recvfrom, which is blocked by default.
(2) Non blocking I/O model: In contrast to blocking, I/O returns immediately as long as it does not return. The current thread is not blocked.
IO reuse mode: part of self learning. Multiplexing refers to combining multiple signals into one line for processing, just like multiple pipes are combined into one, while multiple signals are the opposite.
IO reuse models are mainly select, poll, epoll; For an IO port, it is called twice and returned twice, which has no advantage over blocking IO; The key is to monitor multiple IO ports at the same time; This function also blocks processes, but unlike blocking I/O, it can block multiple I/O operations at the same time. The I/O function of multiple read operations and multiple write operations is detected at the same time. The I/O operation function will not be called until there is readable or writable data.
Signal lamp drive: first turn on the signal lamp drive function of the kit interface, and then call the signal lamp control function through the system. When preparing to read the datagram, a SIGIO signal will be generated for this process. Then, recvfrom can be called in the signal processing program to read the datagram and notify the main loop that the data is ready for processing. You can also notify the main loop to read the datagram.
An asynchronous IO model: tell the kernel to start an operation, and notify the kernel after the entire operation is completed (including copying the kernel data to the user's own buffer). This does not mean that a certain model must be used. In all cases, epoll will not perform better than select. It is still combined with business requirements when making choices.

The above points are about how to optimize the performance of Huawei VM introduced by Micronet to make it even better. I believe that friends who have read this article can also have a deeper understanding of the performance of Huawei VM. Huawei Cloud, a micro network agent, is an excellent cloud computing service provider. It can provide the best service for friends who want to rent Huawei virtual machines to set up private game servers. It has perfect industry solutions and excellent cloud computing technology. The self-developed pure SSD architecture virtual machine breaks the industry record with 50000 IOPS random read/write speed and 800 Mb/s throughput as performance indicators. The ECS elastic virtual machine uses pure SSD architecture hardware devices. It can easily acquire and enable the cloud in just a few minutes to meet your computing needs. Expanding the flexibility of resource use also saves you computing costs, simplifies IT operations, and enables you to pay more attention to core business innovation.