Microservice operation optimization method, microservice operation system and server system

By establishing a connection between the local resource space and the memory pool in the microservice architecture, and migrating out and back to the memory page of the microservice process, the problem of performance degradation in frequent online and offline is solved, and the survival cycle is extended. Avoid performance losses caused by repeated initialization.

CN113296935BActive Publication Date: 2025-02-14ALIBABA GROUP HOLDING LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202011354599.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-27
Publication Date
2025-02-14
Estimated Expiration
2040-11-27

AI Technical Summary

Technical Problem

In the microservice architecture, frequent service launch and offline lead to a decline in the performance of the microservice process, especially in scenarios where the service cycle is short and dynamic, the survival cycle of the microservice process is difficult to span multiple service cycles, resulting in duplication Performance degradation caused by initialization.

Method used

By establishing a connection between the local resource space and the memory pool, migrate the memory page of the microservice process to the memory pool without terminating the microservice process. Response to the memory page when it is inaccessible, avoiding repeated initialization.

Benefits of technology

It realizes reducing resource usage in microservice application scenarios and extending the survival cycle of microservice processes, avoiding performance degradation caused by repeated initialization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113296935B_ABST
    Figure CN113296935B_ABST
Patent Text Reader

Abstract

The disclosed embodiments provide a microservice operation optimization method, a microservice operation system, and a server system. The microservice operation optimization method includes: establishing a connection between a local resource space in which a microservice process is running and a memory pool; migrating the memory page of a designated microservice process running in the local resource space from the local memory in the local resource space to the memory pool, wherein the designated microservice process remains in operation when the memory page is migrated to the memory pool; in response to the designated microservice process whose memory page is migrated to the memory pool being unable to access the memory page in the local resource space, migrating the memory page from the memory pool back to the local memory in the local resource space, and by utilizing the memory pool, minimizing the local resource occupation of the microservice process, thereby making the microservice process life cycle span multiple service cycles, thereby avoiding performance degradation caused by repeated initialization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the field of computer technology, and in particular to a microservice operation optimization method, a microservice operation system, and a server system. Background Art

[0002] Microservices is an architectural and organizational approach to developing software, where the software consists of small, independent services that communicate through well-defined APIs (application programming interfaces). Microservices architecture is different from the more traditional monolithic approach, which splits the application into multiple core functions. Each function is called a service and can be built and deployed separately, which means that the services will not affect each other when working (and failing).

[0003] In real-world scenarios, microservices are often deployed through resource scheduling and management mechanisms, usually taking into account the CPU (central processing unit) / memory / storage resources of the server required by the microservice instance. Similar to common scheduling methods, before the microservice instance starts, logical resources will be allocated, and the microservice process will be started on the corresponding physical machine, consuming local CPU / memory resources. After the service cycle ends, the corresponding microservice process will be required by the system to exit actively, thereby completely releasing the corresponding CPU / memory resources.

[0004] In the microservice architecture, due to the loose coupling between services, microservice processes can be scheduled relatively independently. In addition, microservice processes often provide stateless services, so any microservice process can be online / offline at any time according to demand. These designs allow the entire system to be dynamically scaled at any time to adapt to changes in service requirements.

[0005] From the perspective of server resources, dynamic management of microservices mainly considers CPU and memory resources. For common resource scheduling algorithms, after the current service window ends, the corresponding microservice process will be terminated by the system, thereby releasing the corresponding memory resources (the amount of CPU resources occupied by idle processes can be ignored). When the next periodic service demand arrives, the scheduling algorithm allocates resources in the system and restarts the corresponding microservice process. This solution makes full use of the local resources of the server.

[0006] However, from the perspective of microservice processes, frequent service launches and de-launches are not conducive to ensuring microservice performance. Each time a microservice process is launched, the resources used by the microservice process need to be initialized, and certain runtime technologies can cause specific performance issues. For example, the Java Virtual Machine (JMV) undergoes class loading and JIT (Just-In-Time) compilation during startup, which greatly affects the performance of microservices. Therefore, in microservice application scenarios with short service cycles and high dynamics, the life cycle of a microservice process is difficult to span multiple service cycles, and it faces the problem of performance degradation caused by repeated initialization. Summary of the invention

[0007] In view of this, the embodiments of the present disclosure provide a microservice operation optimization method, a device, a readable storage medium, a microservice operation system and a server system to solve the problems existing in the related art.

[0008] The first aspect of the present disclosure provides a microservice operation optimization method, comprising:

[0009] Establish a connection between the local resource space where the microservice process runs and the memory pool;

[0010] Migrating the memory page of the specified microservice process running in the local resource space from the local memory in the local resource space to the memory pool, wherein the specified microservice process remains in a running state when the memory page is migrated to the memory pool;

[0011] In response to the designated microservice process to which the memory page is migrated out of the memory pool being unable to access the memory page in the local resource space, the memory page is migrated from the memory pool back to the local memory in the local resource space.

[0012] In combination with the first aspect, in a first implementation of the first aspect of the present disclosure, the step of migrating the memory page of the specified microservice process running in the local resource space from the local memory in the local resource space to the memory pool includes:

[0013] Intercepting offline instructions for the specified microservice process;

[0014] According to the intercepted offline instruction for the designated microservice process, the memory page of the designated microservice process running in the local resource space is migrated from the local memory in the local resource space to the memory pool.

[0015] In combination with the first implementation of the first aspect, in a second implementation of the first aspect of the present disclosure, in response to the designated microservice process being migrated out of the memory page to the memory pool being unable to access the memory page in the local resource space, migrating the memory page from the memory pool back to the local memory in the local resource space includes:

[0016] Intercepting an online instruction of the designated microservice process whose memory page is migrated out to the memory pool;

[0017] According to the intercepted online instruction of the designated microservice process whose memory page is migrated out to the memory pool, in response to monitoring that the designated microservice process cannot access the memory page in the local resource space, the memory page is migrated from the memory pool back to the local memory in the local resource space.

[0018] In combination with the first aspect, the first implementation manner of the first aspect, and any one of the second implementation manners, in a third implementation manner of the first aspect of the present disclosure, establishing a connection between a local resource space in which a microservice process is running and a memory pool includes:

[0019] A connection between a local resource space running a microservice process and a memory pool is established through a memory expansion device.

[0020] In combination with the third implementation of the first aspect, in a fourth implementation of the first aspect of the present disclosure, migrating the memory page of the specified microservice process running in the local resource space from the local memory in the local resource space to the memory pool includes:

[0021] The memory expansion device migrates the memory pages of the specified microservice process running in the local resource space from the local memory in the local resource space to the memory pool.

[0022] In combination with the fourth implementation of the first aspect, the present disclosure, in a fifth implementation of the first aspect, further includes:

[0023] Monitoring, by the memory expansion device, memory resources used by the process of the designated microservice whose memory pages are migrated out to the memory pool;

[0024] Wherein, in response to the designated microservice process that is unable to access the memory page in the local resource space after the memory page is migrated out to the memory pool, migrating the memory page from the memory pool back to the local memory in the local resource space includes:

[0025] In response to the memory expansion device detecting that the designated microservice process whose memory page is migrated out to the memory pool cannot access the memory page in the local resource space, the memory expansion device pre-migrates the memory page from the memory pool back to the cache memory in the memory expansion device through the memory expansion device;

[0026] The memory page is migrated from the cache memory in the memory expansion device back to the local memory in the local resource space.

[0027] In combination with the first aspect, the first implementation manner of the first aspect, and any one of the second implementation manners, in a sixth implementation manner of the first aspect of the present disclosure, before migrating the memory page of the specified microservice process running in the local resource space from the local memory in the local resource space to the memory pool, the method further includes:

[0028] The mapping relationship between the virtual address in the local resource space and the memory page is released.

[0029] In combination with the sixth implementation manner of the first aspect, in a seventh implementation manner of the first aspect of the present disclosure, in response to the designated microservice process being migrated out of the memory page to the memory pool being unable to access the memory page in the local resource space, migrating the memory page from the memory pool back to the local memory in the local resource space includes:

[0030] In response to the memory page being migrated out to the memory pool, the virtual address of the designated microservice process in the local resource space that has a mapping relationship with the memory page cannot access the memory page, triggering a page fault exception;

[0031] In response to detecting the page fault exception, migrating the memory page from the memory pool back to the local memory in the local resource space;

[0032] A mapping relationship between the virtual address in the local resource space and the memory page is established to resolve the page missing exception.

[0033] A second aspect of the present disclosure provides a microservice operation system, including a local server and a memory pool connected to each other,

[0034] The local server has a local resource space running a microservice process.

[0035] wherein the local server migrates the memory page of the specified microservice process running in the local resource space from the local memory in the local resource space to the memory pool, wherein the specified microservice process remains in a running state when the memory page is migrated to the memory pool,

[0036] In which, in response to the designated microservice process whose memory page is migrated out to the memory pool being unable to access the memory page in the local resource space, the local server migrates the memory page from the memory pool back to the local memory in the local resource space.

[0037] In combination with the second aspect, in a first implementation of the second aspect of the present disclosure, the local server intercepts an offline instruction to the designated microservice process,

[0038] According to the intercepted offline instruction for the designated microservice process, the local server migrates the memory pages of the designated microservice process running in the local resource space from the local memory in the local resource space to the memory pool.

[0039] In combination with the first implementation of the second aspect, in a second implementation of the second aspect of the present disclosure, the local server intercepts an online instruction for the designated microservice process whose memory page is migrated out to the memory pool,

[0040] Among them, according to the intercepted online instruction of the designated microservice process whose memory page is migrated out to the memory pool, the local server responds to monitoring that the designated microservice process cannot access the memory page in the local resource space, and migrates the memory page from the memory pool back to the local memory in the local resource space.

[0041] In combination with the second aspect, the first implementation manner of the first aspect, and any one of the second implementation manners, the third implementation manner of the second aspect of the present disclosure further includes:

[0042] A memory expansion device is arranged between the local server and the memory pool, and the memory expansion device includes a buffer memory for caching data transmitted between the local resource space running the microservice process and the memory pool.

[0043] In combination with the third implementation method of the second aspect, in the fourth implementation method of the second aspect of the present disclosure, the memory page of the specified microservice process running in the local resource space is migrated from the local memory in the local resource space to the memory pool through the memory expansion device.

[0044] In combination with the fourth implementation of the second aspect, in a fifth implementation of the second aspect of the present disclosure, the memory expansion device further includes a buffer storage management module, which is used to monitor the memory resources used by the process of the specified microservice whose memory pages are migrated out to the memory pool,

[0045] In response to the buffer storage management module detecting that the designated microservice process whose memory page is migrated out of the memory pool cannot access the memory page in the local resource space, the buffer storage management module migrates the memory page from the memory pool back to the buffer memory in advance,

[0046] The local server migrates the memory page from the buffer memory back to the local memory in the local resource space.

[0047] In combination with the second aspect, the first implementation method of the first aspect, and any one of the second implementation methods, in a sixth implementation method of the second aspect of the present disclosure, before migrating the memory page of the specified microservice process running in the local resource space from the local memory in the local resource space to the memory pool, the local server releases the mapping relationship between the virtual address in the local resource space and the memory page.

[0048] In combination with the sixth implementation manner of the second aspect, in a seventh implementation manner of the second aspect of the present disclosure, in response to a memory page being migrated out to the memory pool, a virtual address of the designated microservice process in the local resource space that has a mapping relationship with the memory page cannot access the memory page, and a page fault exception is triggered in the local server.

[0049] In response to detecting the page fault exception, the local server migrates the memory page from the memory pool back to the local memory in the local resource space, and establishes a mapping relationship from the virtual address in the local resource space to the memory page to resolve the page fault exception.

[0050] In combination with the third implementation manner of the second aspect, in an eighth implementation manner of the second aspect of the present disclosure, the memory expansion device is implemented by a field programmable gate array, and the memory expansion device has a high-speed cache memory as the buffer memory.

[0051] A third aspect of the present disclosure provides a server system, including a local server, a memory expansion device, and a memory pool.

[0052] Wherein, the local server is connected to the memory pool via the memory expansion device.

[0053] The local server has a local resource space running a microservice process, and the memory expansion device includes a buffer memory, and the buffer memory is used to cache data transmitted between the local resource space running the microservice process and the memory pool.

[0054] wherein the local server migrates the memory page of the specified microservice process running in the local resource space from the local memory in the local resource space to the memory pool via the memory expansion device, wherein the specified microservice process remains in a running state when the memory page is migrated to the memory pool,

[0055] In which, in response to the designated microservice process whose memory page is migrated out to the memory pool being unable to access the memory page in the local resource space, the local server migrates the memory page from the memory pool back to the local memory in the local resource space via the memory expansion device.

[0056] In combination with the third aspect, in a first implementation of the third aspect of the present disclosure, the local server includes an active page recovery module, which is used to intercept an offline instruction for the specified microservice process.

[0057] Among them, according to the intercepted offline instruction for the designated microservice process, the active page recovery module migrates the memory pages of the designated microservice process running in the local resource space from the local memory in the local resource space to the memory pool via the memory expansion device.

[0058] In combination with the first implementation of the third aspect, in the second implementation of the third aspect of the present disclosure, the active page recovery module intercepts an online instruction of the designated microservice process whose memory page is migrated out to the memory pool,

[0059] According to the intercepted online instruction of the designated microservice process whose memory page is migrated out to the memory pool, the active page recovery module monitors whether the designated microservice process accesses the memory page in the local resource space.

[0060] In response to monitoring that the designated microservice process cannot access the memory page in the local resource space, the active page recovery module migrates the memory page from the memory pool back to the local memory in the local resource space via the memory expansion device.

[0061] In combination with the first implementation or the second implementation of the third aspect, in a third implementation of the third aspect of the present disclosure, the memory expansion device further includes a buffer storage management module, which is used to monitor the memory resources used by the process of the specified microservice whose memory page is migrated out to the memory pool,

[0062] In response to the buffer storage management module detecting that the designated microservice process whose memory page is migrated out of the memory pool cannot access the memory page in the local resource space, the buffer storage management module migrates the memory page from the memory pool back to the buffer memory in advance,

[0063] The active page recycling module migrates the memory page from the buffer memory back to the local memory in the local resource space.

[0064] In combination with the first implementation method or the second implementation method of the third aspect, in a fourth implementation method of the third aspect of the present disclosure, the active page recovery module releases the mapping relationship between the virtual address in the local resource space and the memory page before migrating the memory page of the specified microservice process running in the local resource space from the local memory in the local resource space to the memory pool.

[0065] In combination with the fourth implementation of the third aspect, in a fifth implementation of the third aspect of the present disclosure, in response to a memory page being migrated out of the memory pool, a virtual address of the designated microservice process in the local resource space that has a mapping relationship with the memory page cannot access the memory page, and a page fault exception is triggered in the local server.

[0066] The active page recovery module monitors whether the page missing exception occurs.

[0067] In response to detecting the page fault exception, the active page recovery module migrates the memory page from the memory pool back to the local memory in the local resource space, and establishes a mapping relationship from the virtual address in the local resource space to the memory page to resolve the page fault exception.

[0068] In combination with the third aspect, the first implementation method of the first aspect, and any one of the second implementation methods, in the sixth implementation method of the third aspect of the present disclosure, the memory expansion device is implemented by a field programmable gate array, and the memory expansion device has a high-speed cache memory as the buffer memory.

[0069] A fourth aspect of the present disclosure provides an electronic device, characterized in that it includes a memory and a processor; wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement a method as described in the first aspect of the present disclosure and any one of the first to seventh implementations of the first aspect.

[0070] A fifth aspect of the present disclosure is a readable storage medium having computer instructions stored thereon, characterized in that when the computer instructions are executed by a processor, the method described in any one of the first aspect of the present disclosure and the first to seventh implementations of the first aspect is implemented.

[0071] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:

[0072] According to the technical solution provided by the embodiment of the present disclosure, a connection is established between a local resource space in which a microservice process is running and a memory pool; the memory page of a specified microservice process running in the local resource space is migrated from the local memory in the local resource space to the memory pool, wherein the specified microservice process remains in a running state when the memory page is migrated to the memory pool; in response to the specified microservice process whose memory page is migrated to the memory pool being unable to access the memory page in the local resource space, the memory page is migrated from the memory pool back to the local memory in the local resource space. For microservices with short service cycles / high dynamics, the memory pool is utilized to minimize the local resource occupation of the microservice process, thereby making the life cycle of the microservice process span multiple service cycles, thereby avoiding performance degradation caused by repeated initialization.

[0073] According to the technical solution provided by the embodiment of the present disclosure, the memory page of the specified microservice process running in the local resource space is migrated from the local memory in the local resource space to the memory pool, including: intercepting the offline instruction of the specified microservice process; according to the intercepted offline instruction of the specified microservice process, the memory page of the specified microservice process running in the local resource space is migrated from the local memory in the local resource space to the memory pool, so that the microservice process does not need to completely exit locally according to the offline instruction, but can minimize the local resource occupation of the microservice process by utilizing the memory pool, thereby making the microservice process life cycle span multiple service cycles, thereby avoiding performance degradation caused by repeated initialization.

[0074] According to the technical solution provided by the embodiment of the present disclosure, in response to the designated microservice process whose memory page is migrated out to the memory pool being unable to access the memory page in the local resource space, the memory page is migrated from the memory pool back to the local memory in the local resource space, including: intercepting an online instruction of the designated microservice process whose memory page is migrated out to the memory pool; according to the intercepted online instruction of the designated microservice process whose memory page is migrated out to the memory pool, in response to monitoring that the designated microservice process is unable to access the memory page in the local resource space, migrating the memory page from the memory pool back to the local memory in the local resource space, so that the microservice does not need to perform a more complicated initialization process locally according to the online instruction, but can migrate the memory data back to the local by using the memory pool, thereby making the life cycle of the microservice process span multiple service cycles, thereby avoiding performance degradation caused by repeated initialization.

[0075] According to the technical solution provided by the embodiment of the present disclosure, the connection between the local resource space running the microservice process and the memory pool is established, including: establishing a connection between the local resource space running the microservice process and the memory pool through a memory expansion device, and using the memory expansion device to help the microservice process migrate memory data between the local resource space and the memory pool, so that the local resource occupation of the microservice process is minimized, and then the life cycle of the microservice process spans multiple service cycles, thereby avoiding performance degradation caused by repeated initialization.

[0076] According to the technical solution provided by the embodiment of the present disclosure, the memory page of the specified microservice process running in the local resource space is migrated from the local memory in the local resource space to the memory pool, including: migrating the memory page of the specified microservice process running in the local resource space from the local memory in the local resource space to the memory pool through the memory expansion device, and using the memory expansion device to help the microservice process migrate memory data between the local resource space and the memory pool, so that the local resource occupation of the microservice process is minimized, and then the life cycle of the microservice process spans multiple service cycles, thereby avoiding performance degradation caused by repeated initialization.

[0077] According to the technical solution provided by the embodiment of the present disclosure, the memory resources used by the process of the designated microservice whose memory page is migrated out to the memory pool are monitored by the memory expansion device; wherein, in response to the designated microservice process whose memory page is migrated out to the memory pool being unable to access the memory page in the local resource space, the memory page is migrated from the memory pool back to the local memory in the local resource space, including: in response to the memory expansion device monitoring that the designated microservice process whose memory page is migrated out to the memory pool is unable to access the memory page in the local resource space, the memory expansion device is used to pre-migrate the memory page from the memory pool back to the cache memory in the memory expansion device; the memory page is migrated from the cache memory in the memory expansion device back to the local memory in the local resource space, and the cache memory of the memory expansion device is used to help the microservice process migrate memory data between the local resource space and the memory pool, so that the local resource occupation of the microservice process is minimized, and the life cycle of the microservice process spans multiple service cycles, thereby avoiding performance degradation caused by repeated initialization.

[0078] According to the technical solution provided by the embodiment of the present disclosure, before migrating the memory page of the specified microservice process running in the local resource space from the local memory in the local resource space to the memory pool, it also includes: releasing the mapping relationship between the virtual address in the local resource space and the memory page, so that the memory occupied by the microservice in the local resource space can be released, so that the local resource occupation of the microservice process is minimized, and the life cycle of the microservice process spans multiple service cycles, thereby avoiding performance degradation caused by repeated initialization.

[0079] According to the technical solution provided by the embodiment of the present disclosure, in response to the designated microservice process being migrated out of the memory pool to the memory page being unable to access the memory page in the local resource space, the memory page is migrated from the memory pool back to the local memory in the local resource space, including: in response to the designated microservice process being migrated out of the memory pool to the memory page being unable to access the memory page in the local resource space at a virtual address that has a mapping relationship with the memory page, triggering a page fault exception; in response to detecting the page fault exception, migrating the memory page from the memory pool back to the local memory in the local resource space; establishing a mapping relationship from the virtual address in the local resource space to the memory page to resolve the page fault exception, and there is no need to reinitialize the microservice, but directly migrate the data of the microservice process back to the memory in the local resource space, so that the life cycle of the microservice process spans multiple service cycles, thereby avoiding performance degradation caused by repeated initialization.

[0080] According to the technical solution provided by the embodiment of the present disclosure, through a local server and a memory pool connected to each other, wherein the local server has a local resource space in which a microservice process is running, wherein the local server migrates the memory page of a specified microservice process running in the local resource space from the local memory in the local resource space to the memory pool, wherein the specified microservice process remains in a running state when the memory page is migrated to the memory pool, wherein in response to the specified microservice process being unable to access the memory page in the local resource space after the memory page is migrated to the memory pool, the local server migrates the memory page from the memory pool back to the local memory in the local resource space, and for microservices with short service cycles / high dynamics, by utilizing the memory pool, the local resource occupation of the microservice process is minimized, thereby making the life cycle of the microservice process span multiple service cycles, thereby avoiding performance degradation caused by repeated initialization.

[0081] According to the technical solution provided by the embodiment of the present disclosure, the local server intercepts the offline instruction of the designated microservice process, wherein, according to the intercepted offline instruction of the designated microservice process, the local server migrates the memory page of the designated microservice process running in the local resource space from the local memory in the local resource space to the memory pool, so that the microservice process does not need to completely exit locally according to the offline instruction, but can minimize the local resource occupation of the microservice process by utilizing the memory pool, thereby making the life cycle of the microservice process span multiple service cycles, thereby avoiding performance degradation caused by repeated initialization.

[0082] According to the technical solution provided by the embodiment of the present disclosure, the local server intercepts the online instruction of the designated microservice process whose memory page is migrated out to the memory pool, wherein, according to the intercepted online instruction of the designated microservice process whose memory page is migrated out to the memory pool, the local server responds to monitoring that the designated microservice process cannot access the memory page in the local resource space, and migrates the memory page from the memory pool back to the local memory in the local resource space, so that the microservice does not need to perform a more complicated initialization process locally according to the online instruction, but can migrate the memory data back to the local by using the memory pool, thereby making the life cycle of the microservice process span multiple service cycles, thereby avoiding performance degradation caused by repeated initialization.

[0083] According to the technical solution provided by the embodiment of the present disclosure, a memory expansion device is provided between the local server and the memory pool. The memory expansion device includes a buffer memory for caching data transmitted between the local resource space where the microservice process is running and the memory pool. The memory expansion device is used to help the microservice process migrate memory data between the local resource space and the memory pool, thereby minimizing the local resource occupancy of the microservice process, thereby making the life cycle of the microservice process span multiple service cycles, thereby avoiding performance degradation caused by repeated initialization.

[0084] According to the technical solution provided by the embodiment of the present disclosure, the memory page of the specified microservice process running in the local resource space is migrated from the local memory in the local resource space to the memory pool through the memory expansion device, and the memory expansion device is used to help the microservice process migrate memory data between the local resource space and the memory pool, so that the local resource occupation of the microservice process is minimized, and the life cycle of the microservice process spans multiple service cycles, thereby avoiding performance degradation caused by repeated initialization.

[0085] According to the technical solution provided by the embodiment of the present disclosure, the memory expansion device also includes a buffer storage management module, which is used to monitor the memory resources used by the process of the designated microservice whose memory page is migrated out to the memory pool, wherein, in response to the buffer storage management module monitoring that the designated microservice process whose memory page is migrated out to the memory pool cannot access the memory page in the local resource space, the buffer storage management module pre-migrates the memory page from the memory pool back to the buffer memory, wherein the local server migrates the memory page from the buffer memory back to the local memory in the local resource space, and helps the microservice process migrate memory data between the local resource space and the memory pool by utilizing the high-speed cache memory of the memory expansion device, so that the local resource occupation of the microservice process is minimized, and then the life cycle of the microservice process spans multiple service cycles, thereby avoiding performance degradation caused by repeated initialization.

[0086] According to the technical solution provided by the embodiment of the present disclosure, before the local server migrates the memory page of the specified microservice process running in the local resource space from the local memory in the local resource space to the memory pool, the mapping relationship between the virtual address in the local resource space and the memory page is released, so that the memory occupied by the microservice in the local resource space can be released, so that the local resource occupation of the microservice process is minimized, and the life cycle of the microservice process spans multiple service cycles, thereby avoiding performance degradation caused by repeated initialization.

[0087] According to the technical solution provided by the embodiment of the present disclosure, in response to the designated microservice process of the memory page being migrated out to the memory pool, the virtual address in the local resource space that has a mapping relationship with the memory page cannot access the memory page, triggering a page fault exception in the local server, wherein, in response to detecting the page fault exception, the local server migrates the memory page from the memory pool back to the local memory in the local resource space, and establishes a mapping relationship from the virtual address in the local resource space to the memory page, so as to resolve the page fault exception. It is not necessary to reinitialize the microservice, but the data of the microservice process is directly migrated back to the memory in the local resource space, so that the life cycle of the microservice process spans multiple service cycles, thereby avoiding performance degradation caused by repeated initialization.

[0088] According to the technical solution provided by the embodiment of the present disclosure, the memory expansion device is implemented by a field programmable gate array, and the memory expansion device has a high-speed cache memory as the buffer memory, so that the memory expansion device is easy to implement, and the high-speed cache memory of the memory expansion device is used to help the microservice process migrate memory data between the local resource space and the memory pool, so that the local resource occupation of the microservice process is minimized, and the life cycle of the microservice process spans multiple service cycles, thereby avoiding performance degradation caused by repeated initialization.

[0089] According to the technical solution provided by the embodiment of the present disclosure, through a local server, a memory expansion device and a memory pool, wherein the local server and the memory pool are connected through the memory expansion device, wherein the local server has a local resource space running a microservice process, and the memory expansion device includes a buffer memory, wherein the buffer memory is used to cache data transmitted between the local resource space running a microservice process and the memory pool, wherein the local server migrates the memory page of the specified microservice process running in the local resource space from the local memory in the local resource space to the memory pool through the memory expansion device, wherein the specified microservice process The service process remains in a running state when the memory page is migrated out to the memory pool, wherein, in response to the specified microservice process being unable to access the memory page in the local resource space after the memory page is migrated out to the memory pool, the local server migrates the memory page from the memory pool back to the local memory in the local resource space via the memory expansion device, and the memory expansion device is used to help the microservice process migrate memory data between the local resource space and the memory pool, so that the local resource occupation of the microservice process is minimized, thereby making the life cycle of the microservice process span multiple service cycles, thereby avoiding performance degradation caused by repeated initialization.

[0090] According to the technical solution provided by the embodiment of the present disclosure, the local server includes an active page recovery module for intercepting the offline instruction of the designated microservice process, wherein, according to the intercepted offline instruction of the designated microservice process, the active page recovery module migrates the memory page of the designated microservice process running in the local resource space from the local memory in the local resource space to the memory pool via the memory expansion device, so that the microservice process does not need to completely exit locally according to the offline instruction, but can minimize the local resource occupation of the microservice process by utilizing the memory pool, thereby making the life cycle of the microservice process span multiple service cycles, thereby avoiding performance degradation caused by repeated initialization.

[0091] According to the technical solution provided by the embodiment of the present disclosure, the online instruction of the designated microservice process whose memory page is migrated out to the memory pool is intercepted by the active page recovery module, wherein, according to the intercepted online instruction of the designated microservice process whose memory page is migrated out to the memory pool, the active page recovery module monitors whether the designated microservice process accesses the memory page in the local resource space, wherein, in response to monitoring that the designated microservice process cannot access the memory page in the local resource space, the active page recovery module migrates the memory page from the memory pool back to the local memory in the local resource space via the memory expansion device, so that the microservice does not need to perform a more complicated initialization process locally according to the online instruction, but can migrate the memory data back to the local by using the memory pool, thereby making the microservice process life cycle span multiple service cycles, thereby avoiding performance degradation caused by repeated initialization.

[0092] According to the technical solution provided by the embodiment of the present disclosure, the memory expansion device also includes a buffer storage management module, which is used to monitor the memory resources used by the process of the designated microservice whose memory page is migrated out to the memory pool, wherein, in response to the buffer storage management module monitoring that the designated microservice process whose memory page is migrated out to the memory pool cannot access the memory page in the local resource space, the buffer storage management module pre-migrates the memory page from the memory pool back to the buffer memory, wherein the active page recycling module migrates the memory page from the buffer memory back to the local memory in the local resource space, and helps the microservice process migrate memory data between the local resource space and the memory pool by utilizing the buffer memory of the memory expansion device, so that the local resource occupation of the microservice process is minimized, thereby making the life cycle of the microservice process span multiple service cycles, thereby avoiding performance degradation caused by repeated initialization.

[0093] According to the technical solution provided by the embodiment of the present disclosure, before the memory page of the specified microservice process running in the local resource space is migrated from the local memory in the local resource space to the memory pool, the mapping relationship between the virtual address in the local resource space and the memory page is released, so that the memory occupied by the microservice in the local resource space can be released, so that the local resource occupation of the microservice process is minimized, and the life cycle of the microservice process spans multiple service cycles, thereby avoiding performance degradation caused by repeated initialization.

[0094] According to the technical solution provided by the embodiment of the present disclosure, in response to the memory page being migrated out to the memory pool, the virtual address in the local resource space that has a mapping relationship with the memory page cannot access the memory page, triggering a page fault exception in the local server, wherein the active page recovery module monitors whether the page fault exception occurs, wherein, in response to detecting the page fault exception, the active page recovery module migrates the memory page from the memory pool back to the local memory in the local resource space, and establishes a mapping relationship from the virtual address in the local resource space to the memory page, so as to solve the page fault exception. There is no need to reinitialize the microservice, but the data of the microservice process is directly migrated back to the memory in the local resource space, so that the life cycle of the microservice process spans multiple service cycles, thereby avoiding performance degradation caused by repeated initialization.

[0095] According to the technical solution provided by the embodiment of the present disclosure, the memory expansion device is implemented by a field programmable gate array, and the memory expansion device has a high-speed cache memory as the buffer memory, so that the memory expansion device is easy to implement, and the high-speed cache memory of the memory expansion device is used to help the microservice process migrate memory data between the local resource space and the memory pool, so that the local resource occupation of the microservice process is minimized, and the life cycle of the microservice process spans multiple service cycles, thereby avoiding performance degradation caused by repeated initialization.

[0096] These and other aspects of the present disclosure will become more apparent from the following description of the embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0097] Other features, objectives and advantages of the present disclosure will become more apparent through the following detailed description of non-limiting embodiments in conjunction with the accompanying drawings. In the accompanying drawings:

[0098] Figure 1 A flowchart showing a method for optimizing microservice operation according to an embodiment of the present disclosure is shown;

[0099] Figure 2A schematic diagram showing a memory page migration process in a scenario example in an application scenario of a microservice operation optimization method according to an embodiment of the present disclosure;

[0100] Figure 3 A schematic diagram showing a comparison of system resource usage in a microservice operation scenario of the related art and system resource usage in an application scenario of the microservice operation optimization method according to an embodiment of the present disclosure;

[0101] Figure 4 A structural block diagram of a microservice operation system according to an embodiment of the present disclosure is shown;

[0102] Figure 5 A structural block diagram of a server system according to an embodiment of the present disclosure is shown;

[0103] Figure 6 Show according to Figure 5 An exemplary structural diagram of an implementation scenario of the server system shown;

[0104] Figure 7 A structural block diagram of an electronic device according to an embodiment of the present disclosure is shown;

[0105] Figure 8 It is a structural diagram of a computer system suitable for implementing the microservice operation optimization method according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0106] In order to enable those skilled in the art to better understand the solutions of the present disclosure, the technical solutions in the exemplary embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings in the exemplary embodiments of the present disclosure.

[0107] In some of the processes described in the specification and claims of the present disclosure and the above-mentioned figures, multiple operations that appear in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in this article or executed in parallel. The serial numbers of the operations, such as 101, 102, etc., are only used to distinguish between different operations, and the serial numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this article are used to distinguish different messages, devices, modules, etc., do not represent the order of precedence, and do not limit the "first" and "second" to be different types.

[0108] The following will be combined with the drawings in the exemplary embodiments of the present disclosure to clearly and completely describe the technical solutions in the exemplary embodiments of the present disclosure. Obviously, the exemplary embodiments described are only part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.

[0109] In order to solve the problems in the related technology, the inventors have envisioned various solutions. Taking JVM-based microservices as an example, one solution is to avoid the overhead of initializing the JVM through the JVM reuse mechanism. The disadvantage of this solution is that the internal mechanism of the JVM needs to be modified, which has a greater risk of being unfavorable for production line deployment, and the idle JVM occupies local memory resources. Another solution is to serialize and export the machine instructions generated by the JVM just-in-time compilation, and the subsequent JVM can directly load the machine instructions to avoid the overhead of just-in-time compilation. The disadvantage of this solution is that the Java code logic may have dependencies related to the execution environment, such as random numbers and instruction addresses related to the execution context. These dependencies will introduce security issues and are difficult to parse completely correctly.

[0110] In order to overcome the shortcomings of the above solutions, the present disclosure proposes a microservice operation optimization (scheduling) solution based on a memory pool. The solution connects the memory pool resources to the microservice scheduling system and adopts a flexible memory resource management mechanism to further optimize the performance of microservices without affecting the use of local memory resources. The solution is suitable for any server architecture that can run microservices, and is also suitable for various fields such as cloud services, IOT (Internet of Things), and edge devices.

[0111] In the cloud service field of related technologies, for example, the public cloud service field based on virtualization technology, the key resources are CPU (central processing unit) resources and memory resources. Different users have different requirements for the ratio of these two resources. The traditional server architecture limits the sharing dimension of resources to a single physical machine, which leads to the waste of CPU / memory resources in cloud services based on traditional architecture.

[0112] Memory resource pooling technology can effectively improve resource utilization and provide users with a wider range of CPU / memory resource configuration options by centrally managing and allocating part of the memory resources of each physical machine within a certain range of the service rack. Memory resource pooling may have various forms. In an embodiment of the present disclosure, one specific way to use the memory pool is that each physical machine in the rack is connected to the memory box in the rack through a low-latency network, and another specific way to use the memory pool is that the physical machine is directly connected to the expansion memory card through a physical interface.

[0113] Figure 1 A flowchart of executing a microservice operation optimization method according to an embodiment of the present disclosure is shown.

[0114] like Figure 1 As shown, the microservice operation optimization method according to an embodiment of the present disclosure includes steps S110, S120 and S130.

[0115] In step S110, a connection is established between the local resource space where the microservice process is running and the memory pool.

[0116] In step S120, the memory page of the designated microservice process running in the local resource space is migrated from the local memory in the local resource space to the memory pool, wherein the designated microservice process remains running when the memory page is migrated to the memory pool.

[0117] In step S130, in response to the designated microservice process whose memory page is migrated out to the memory pool being unable to access the memory page in the local resource space, the memory page is migrated from the memory pool back to the local memory in the local resource space.

[0118] In one embodiment of the present disclosure, the local resource space is the CPU / memory / storage and other resources allocated to the microservice process by the service architecture (e.g., local server) running the microservice process (instance). In one embodiment of the present disclosure, the service architecture running the microservice process (instance) may refer to a JVM.

[0119] In one embodiment of the present disclosure, the memory pool can centrally manage and allocate the use of part of the memory resources of each physical machine within a certain range of the local service rack where the local resource space is located. In one embodiment of the present disclosure, a specific way of using the memory pool is that each physical machine in the rack is connected to the memory box in the rack through a low-latency network. In one embodiment of the present disclosure, another specific way of using the memory pool can be that the physical machine is directly connected to the expansion memory card through a physical interface.

[0120] In one embodiment of the present disclosure, when the current service cycle of a microservice process ends, the system will not terminate the operation and release local memory resources, but the memory page can be moved out (or swapped out) to the memory pool. At this time, the microservice process is still running, but the amount of CPU resources occupied by the idle microservice process in the local resource space is negligible, and the memory resources are completely released, thus significantly saving local resource space.

[0121] In one embodiment of the present disclosure, when a microservice process is started from a current idle state (occupying very few CPU resources and memory pages are migrated out to a memory pool), there is no need to perform a complex initialization process in the local resource space. In response to the microservice process being unable to access its memory pages in the local resource space, the memory pages are migrated from the memory pool back to the local memory in the local resource space.

[0122] According to the technical solution provided by the embodiment of the present disclosure, a connection is established between a local resource space in which a microservice process is running and a memory pool; the memory page of a specified microservice process running in the local resource space is migrated from the local memory in the local resource space to the memory pool, wherein the specified microservice process remains in a running state when the memory page is migrated to the memory pool; in response to the specified microservice process whose memory page is migrated to the memory pool being unable to access the memory page in the local resource space, the memory page is migrated from the memory pool back to the local memory in the local resource space. For microservices with short service cycles / high dynamics, the memory pool is utilized to minimize the local resource occupation of the microservice process, thereby making the life cycle of the microservice process span multiple service cycles, thereby avoiding performance degradation caused by repeated initialization.

[0123] In one embodiment of the present disclosure, step S120 includes: intercepting an offline instruction to the designated microservice process; and according to the intercepted offline instruction to the designated microservice process, migrating the memory pages of the designated microservice process running in the local resource space from the local memory in the local resource space to the memory pool.

[0124] In one embodiment of the present disclosure, an offline instruction refers to an instruction for the server to remove the related work of the microservice process, which can be understood as a termination instruction issued by the system for the microservice. If an offline instruction is received, the microservice process needs to release the CPU / memory / storage resources in the local resource space occupied and terminate the operation. However, according to the scheme of the embodiment of the present disclosure, the offline instruction can be intercepted, and in response to intercepting the offline instruction, the memory migration of the specified microservice to the memory pool is initiated. In the case where the memory page is migrated from the local memory of the local resource space to the memory pool, the system can consider that the specified microservice process has been offline.

[0125] According to the technical solution provided by the embodiment of the present disclosure, the memory page of the specified microservice process running in the local resource space is migrated from the local memory in the local resource space to the memory pool, including: intercepting the offline instruction of the specified microservice process; according to the intercepted offline instruction of the specified microservice process, the memory page of the specified microservice process running in the local resource space is migrated from the local memory in the local resource space to the memory pool, so that the microservice process does not need to completely exit locally according to the offline instruction, but can minimize the local resource occupation of the microservice process by utilizing the memory pool, thereby making the microservice process life cycle span multiple service cycles, thereby avoiding performance degradation caused by repeated initialization.

[0126] In one embodiment of the present disclosure, step S130 includes: intercepting an online instruction for the designated microservice process whose memory page is migrated out to the memory pool; based on the intercepted online instruction for the designated microservice process whose memory page is migrated out to the memory pool, in response to monitoring that the designated microservice process cannot access the memory page in the local resource space, migrating the memory page from the memory pool back to the local memory in the local resource space.

[0127] In one embodiment of the present disclosure, an online instruction refers to an instruction for the server to prepare for the deployment of related work of the microservice process, which can be understood as a start-up and running instruction issued by the system for the microservice. If an online instruction is received, the microservice needs to use the CPU / memory / storage resources in the local resource space to initialize and start running. However, according to the scheme of the embodiment of the present disclosure, since the specified microservice has been in a running state, it is only currently in an idle state (occupying very few CPU resources, and the memory pages are migrated out to the memory pool). Therefore, the online instruction can be intercepted, and in response to intercepting the online instruction, the memory of the specified microservice is initiated to be migrated back to the memory in the local resource space. When the memory page is migrated from the memory pool back to the local memory of the local resource space, the system can consider that the specified microservice process has been online.

[0128] According to the technical solution provided by the embodiment of the present disclosure, in response to the designated microservice process whose memory page is migrated out to the memory pool being unable to access the memory page in the local resource space, the memory page is migrated from the memory pool back to the local memory in the local resource space, including: intercepting an online instruction of the designated microservice process whose memory page is migrated out to the memory pool; according to the intercepted online instruction of the designated microservice process whose memory page is migrated out to the memory pool, in response to monitoring that the designated microservice process is unable to access the memory page in the local resource space, migrating the memory page from the memory pool back to the local memory in the local resource space, so that the microservice does not need to perform a more complicated initialization process locally according to the online instruction, but can migrate the memory data back to the local by using the memory pool, thereby making the life cycle of the microservice process span multiple service cycles, thereby avoiding performance degradation caused by repeated initialization.

[0129] In one embodiment of the present disclosure, step S110 includes: establishing a connection between a local resource space in which a microservice process is running and a memory pool through a memory expansion device.

[0130] In one embodiment of the present disclosure, the memory expansion device may refer to the aforementioned extended memory card. The memory expansion device may help connect the local resource space (local memory) of the local server with the memory pool.

[0131] According to the technical solution provided by the embodiment of the present disclosure, the connection between the local resource space running the microservice process and the memory pool is established, including: establishing a connection between the local resource space running the microservice process and the memory pool through a memory expansion device, and using the memory expansion device to help the microservice process migrate memory data between the local resource space and the memory pool, so that the local resource occupation of the microservice process is minimized, and then the life cycle of the microservice process spans multiple service cycles, thereby avoiding performance degradation caused by repeated initialization.

[0132] In one embodiment of the present disclosure, step S120 includes: migrating the memory page of the specified microservice process running in the local resource space from the local memory in the local resource space to the memory pool through the memory expansion device.

[0133] In one embodiment of the present disclosure, the local server may migrate memory pages to the memory pool through a memory expansion device.

[0134] According to the technical solution provided by the embodiment of the present disclosure, the memory page of the specified microservice process running in the local resource space is migrated from the local memory in the local resource space to the memory pool, including: migrating the memory page of the specified microservice process running in the local resource space from the local memory in the local resource space to the memory pool through the memory expansion device, and using the memory expansion device to help the microservice process migrate memory data between the local resource space and the memory pool, so that the local resource occupation of the microservice process is minimized, and then the life cycle of the microservice process spans multiple service cycles, thereby avoiding performance degradation caused by repeated initialization.

[0135] In one embodiment of the present disclosure, the microservice operation optimization method further includes: monitoring the memory resources used by the process of the specified microservice whose memory page is migrated out to the memory pool through the memory expansion device. Wherein, step S130 includes: in response to the memory expansion device monitoring that the specified microservice process whose memory page is migrated out to the memory pool cannot access the memory page in the local resource space, pre-migrating the memory page from the memory pool back to the high-speed cache memory in the memory expansion device through the memory expansion device; migrating the memory page from the high-speed cache memory in the memory expansion device back to the local memory in the local resource space.

[0136] In one embodiment of the present disclosure, the memory expansion device includes a cache, such as a DRAM cache. Through the cache, the memory expansion device can increase the data transmission speed between the local memory and the memory pool in the local resource space. In one embodiment of the present disclosure, when a memory page is migrated from the local memory to the memory pool via the memory expansion device, the memory expansion device can monitor the memory resource status of the memory page to the microservice process migrated to the memory pool, and when it is detected that the microservice process cannot access the memory page, the memory page is copied from the memory pool to the cache of the memory expansion device in advance.

[0137] According to the technical solution provided by the embodiment of the present disclosure, the memory resources used by the process of the designated microservice whose memory page is migrated out to the memory pool are monitored by the memory expansion device; wherein, in response to the designated microservice process whose memory page is migrated out to the memory pool being unable to access the memory page in the local resource space, the memory page is migrated from the memory pool back to the local memory in the local resource space, including: in response to the memory expansion device monitoring that the designated microservice process whose memory page is migrated out to the memory pool is unable to access the memory page in the local resource space, the memory expansion device is used to pre-migrate the memory page from the memory pool back to the cache memory in the memory expansion device; the memory page is migrated from the cache memory in the memory expansion device back to the local memory in the local resource space, and the cache memory of the memory expansion device is used to help the microservice process migrate memory data between the local resource space and the memory pool, so that the local resource occupation of the microservice process is minimized, and the life cycle of the microservice process spans multiple service cycles, thereby avoiding performance degradation caused by repeated initialization.

[0138] In one embodiment of the present disclosure, before migrating the memory page of the specified microservice process running in the local resource space from the local memory in the local resource space to the memory pool, it also includes: releasing the mapping relationship between the virtual address in the local resource space and the memory page.

[0139] In one embodiment of the present disclosure, a virtual address refers to adding an intermediate layer between the user process and the actual physical memory, so that the user process can only access the virtual address, and the implementation of the virtual address and physical address conversion is handed over to the operating system. In other words, when the microservice process is running, a mapping relationship needs to be established between the virtual address and the memory page in order to access the memory page through the virtual address.

[0140] According to the technical solution provided by the embodiment of the present disclosure, before migrating the memory page of the specified microservice process running in the local resource space from the local memory in the local resource space to the memory pool, it also includes: releasing the mapping relationship between the virtual address in the local resource space and the memory page, so that the memory occupied by the microservice in the local resource space can be released, so that the local resource occupation of the microservice process is minimized, and the life cycle of the microservice process spans multiple service cycles, thereby avoiding performance degradation caused by repeated initialization.

[0141] In one embodiment of the present disclosure, step S130 includes: in response to a memory page being migrated out to the memory pool, the virtual address of the designated microservice process in the local resource space that has a mapping relationship with the memory page cannot access the memory page, triggering a page fault exception; in response to detecting the page fault exception, migrating the memory page from the memory pool back to the local memory in the local resource space; establishing a mapping relationship from the virtual address in the local resource space to the memory page to resolve the page fault exception.

[0142] In one embodiment of the present disclosure, a page fault may also be referred to as a page fault interrupt, which means that according to the original mapping relationship between the virtual address and the memory page, the microservice cannot access the memory page at the corresponding virtual address, thereby triggering a page fault exception. In response to the page fault exception, a migration of the memory page from the resource pool back to the local memory may be initiated, and the mapping relationship between the virtual address and the memory page may be re-established in the local memory, thereby resolving the page fault exception.

[0143] According to the technical solution provided by the embodiment of the present disclosure, in response to the designated microservice process being migrated out of the memory pool to the memory page being unable to access the memory page in the local resource space, the memory page is migrated from the memory pool back to the local memory in the local resource space, including: in response to the designated microservice process being migrated out of the memory pool to the memory page being unable to access the memory page in the local resource space at a virtual address that has a mapping relationship with the memory page, triggering a page fault exception; in response to detecting the page fault exception, migrating the memory page from the memory pool back to the local memory in the local resource space; establishing a mapping relationship from the virtual address in the local resource space to the memory page to resolve the page fault exception, and there is no need to reinitialize the microservice, but directly migrate the data of the microservice process back to the memory in the local resource space, so that the life cycle of the microservice process spans multiple service cycles, thereby avoiding performance degradation caused by repeated initialization.

[0144] The following reference Figure 2 Examples are further described above with reference to Figure 1 Describes the microservice operation optimization method.

[0145] Figure 2 A schematic diagram of a memory page migration process in an example of an application scenario of a microservice operation optimization method according to an embodiment of the present disclosure is shown. Figure 2 As shown, the local resources and the memory pool resources are connected via the expansion card resources to help migrate (swap in or swap out) the memory data of the local resources.

[0146] like Figure 2As shown, local resources are represented by user space and kernel space. Microservice instances (processes) and active page recovery processes run in the user space, where the active page recovery process controls the migration (swap in) and migration (swap out) of pages.

[0147] The following reference Figure 2 Describe the memory page migration operation. In operation 211, the active page recovery process initiates page migration. In operation 212, the migration of the hot page in the kernel space (i.e., the free page is still in the cache) is performed in the kernel space. In operation 213, the hot page is migrated to the memory in the memory pool resource via the DRAM cache memory in the FPGA memory expansion device representing the expansion card resource, and stored as cold page data (i.e., the free page is no longer in the cache).

[0148] The following reference Figure 2 Describe the memory page migration operation. In operation 221, the microservice instance in the user space accesses the hot page in the kernel space according to the mapping relationship between the virtual address and the memory page, triggering a page fault exception. In operation 222, the active page recovery process intercepts the page fault exception. In operation 223, the active page recovery process initiates a migration operation for the missing page. In operation 224, the cold page data in the memory used as a memory pool resource is migrated back to the local kernel space through the DRAM cache memory in the FPGA memory expansion device. In operation 225, a mapping relationship between the virtual address and the migrated memory page is established.

[0149] In the FPGA memory expansion device, the cache memory management module is used to monitor the memory resources of the microservice process where all memory pages that have been migrated to the memory pool originally reside. When the memory pages need to be migrated back to the local memory, the corresponding memory pages in the memory pool are pre-fetched and copied from the memory pool to the DRAM cache memory in the FPGA memory expansion device in advance.

[0150] According to reference Figure 2 The above description of Figure 1 From the description, it can be understood that compared with the solutions in the related art, the microservice operation optimization solution of this example has the following changes:

[0151] (1) Use a memory pool that is connected to the local resources of the local server through an FPGA memory expansion device.

[0152] (2) The active page recovery process located in the local user space is a resident daemon process that can migrate the memory pages of a specified microservice process to a remote memory pool and can also handle page fault exceptions of the corresponding microservice process.

[0153] (3) The microservice instance online / offline instructions initiated by the scheduling mechanism to the local machine are intercepted and redirected to the active page recovery process, which initiates relevant memory migration based on the intercepted instructions.

[0154] (4) The cache memory management module (including the FPGA cache memory management algorithm) in the FPGA memory expansion device tracks the memory resources of each microservice process whose memory page is migrated in real time. When the memory page needs to be migrated back to the local memory, the corresponding page data is pre-fetched and copied from the memory pool to the DRAM cache memory in the FPGA memory expansion device in advance.

[0155] Reference Figure 2 , the scheme of the embodiment of the present disclosure enables the microservice instance that originally needs to be offline to maintain normal operation on the local server (local resources), and at the same time, the memory page is migrated to the memory pool through the active page recovery process. Since the microservice instance is still in operation, when the program accesses the address of the page that has been migrated out, it will trigger the kernel's page fault exception. The page recovery process learns the page fault exception and related virtual address information through monitoring, and promptly retrieves the corresponding page data from the memory pool through the FPGA memory expansion device, establishes a mapping relationship from the virtual address to the page data, and thus solves the page fault exception. Memory migration and page fault exception processing are both performed in real time. In one embodiment, the microservice instance that is idle in a stable state only occupies a small amount of memory resources locally, and most of the memory page data is migrated to the remote memory pool. At the same time, since all internal states of the microservice process are retained, the microservice process can be quickly restored to the previous service state by migrating the memory page back to the local memory at the beginning of the next service cycle. With the help of the cache memory management module, the operation of migrating the memory page back to the local memory can be accelerated.

[0156] The following reference Figure 3 Describes the system resource usage of the microservice operation scenario of the related technology and the system resource usage of the application scenario of the microservice operation optimization method according to the embodiment of the present disclosure.

[0157] Figure 3 A schematic diagram is shown by comparing the system resource usage of a microservice operation scenario in the related art with the system resource usage of an application scenario of the microservice operation optimization method according to an embodiment of the present disclosure.

[0158] like Figure 3As shown, in the common microservice scenario of the related technology, when the microservice is online, the CPU resources, local memory resources and microservice performance are fully utilized. When the microservice is offline, the CPU resources, local memory resources and microservice performance are completely released. When the microservice is online again, the microservice performance is greatly affected because the microservice needs to be reinitialized when it is online.

[0159] In the scenario of utilizing the microservice operation optimization solution according to the embodiment of the present disclosure, the service efficiency can be improved through the memory pool. When the microservice is online, CPU resources, local memory resources and microservice performance are fully utilized. When the microservice is offline, since the offline instruction is intercepted by the active page recovery process, the microservice runs in an idle state. Among them, CPU resources occupy a very small part, local memory resources only occupy a small part, and most of them are migrated to memory pool resources. However, the performance of the microservice is completely released. In the case where the microservice is online again later, since the memory pages can be directly migrated from the memory pool back to the local memory when the microservice is online, it does not need to be re-initialized. Therefore, the performance of the microservice is not affected and can be restored immediately.

[0160] Therefore, the technical effects that can be achieved by the microservice operation optimization solution according to the embodiment of the present disclosure are as follows: Figure 3 As shown: by using a small amount of CPU / memory resources during the offline period of the microservice instance, the performance can be improved after it is online again. If the microservice instance is frequently switched online / offline, the solution of the embodiment of the present disclosure will bring greater benefits.

[0161] Therefore, in the microservice operation optimization solution according to the embodiment of the present disclosure, by introducing a dynamic memory page management method, it is possible to achieve simultaneous optimization of local resources and microservice performance.

[0162] Reference above Figures 1 to 3 The microservice operation optimization scheme of the embodiment of the present disclosure has been roughly described as a whole. The following will describe how to implement the aforementioned scheme in a hardware environment.

[0163] Figure 4 A structural block diagram of a microservice operation system according to an embodiment of the present disclosure is shown.

[0164] like Figure 4As shown, the microservice operation system 400 includes a local server 410 and a memory pool 420. The local server 10 has a local resource space in which a microservice process is running, the local server 410 migrates the memory page of a specified microservice process running in the local resource space from the local memory in the local resource space to the memory pool 420, the specified microservice process remains in operation when the memory page is migrated to the memory pool 420, and in response to the specified microservice process having a memory page migrated to the memory pool 420 being unable to access the memory page in the local resource space, the local server 410 migrates the memory page from the memory pool 420 back to the local memory in the local resource space.

[0165] According to the technical solution provided by the embodiment of the present disclosure, through a local server and a memory pool connected to each other, wherein the local server has a local resource space in which a microservice process is running, wherein the local server migrates the memory page of a specified microservice process running in the local resource space from the local memory in the local resource space to the memory pool, wherein the specified microservice process remains in a running state when the memory page is migrated to the memory pool, wherein, in response to the specified microservice process whose memory page is migrated to the memory pool being unable to access the memory page in the local resource space, the local server 410 migrates the memory page from the memory pool back to the local memory in the local resource space, and for microservices with short service cycles / high dynamics, by utilizing the memory pool, the local resource occupation of the microservice process is minimized, thereby making the life cycle of the microservice process span multiple service cycles, thereby avoiding performance degradation caused by repeated initialization.

[0166] In one embodiment of the present disclosure, the local server 410 intercepts an offline instruction to the designated microservice process, wherein, based on the intercepted offline instruction to the designated microservice process, the local server 410 migrates the memory pages of the designated microservice process running in the local resource space from the local memory in the local resource space to the memory pool 420.

[0167] According to the technical solution provided by the embodiment of the present disclosure, the local server intercepts the offline instruction of the designated microservice process, wherein, according to the intercepted offline instruction of the designated microservice process, the local server migrates the memory page of the designated microservice process running in the local resource space from the local memory in the local resource space to the memory pool, so that the microservice process does not need to completely exit locally according to the offline instruction, but can minimize the local resource occupation of the microservice process by utilizing the memory pool, thereby making the life cycle of the microservice process span multiple service cycles, thereby avoiding performance degradation caused by repeated initialization.

[0168] In one embodiment of the present disclosure, the local server 410 intercepts an online instruction for the designated microservice process whose memory page is migrated out to the memory pool 420, wherein, based on the intercepted online instruction for the designated microservice process whose memory page is migrated out to the memory pool 420, the local server 410 migrates the memory page from the memory pool 420 back to the local memory in the local resource space in response to monitoring that the designated microservice process cannot access the memory page in the local resource space.

[0169] According to the technical solution provided by the embodiment of the present disclosure, the local server intercepts the online instruction of the designated microservice process whose memory page is migrated out to the memory pool, wherein, according to the intercepted online instruction of the designated microservice process whose memory page is migrated out to the memory pool, the local server responds to monitoring that the designated microservice process cannot access the memory page in the local resource space, and migrates the memory page from the memory pool back to the local memory in the local resource space, so that the microservice does not need to perform a more complicated initialization process locally according to the online instruction, but can migrate the memory data back to the local by using the memory pool, thereby making the life cycle of the microservice process span multiple service cycles, thereby avoiding performance degradation caused by repeated initialization.

[0170] In one embodiment of the present disclosure, the microservice operation system also includes: a memory expansion device, which is arranged between the local server 410 and the memory pool 420, and the memory expansion device includes a buffer memory for caching data transmitted between the local resource space running the microservice process and the memory pool 420.

[0171] According to the technical solution provided by the embodiment of the present disclosure, a memory expansion device is provided between the local server and the memory pool. The memory expansion device includes a buffer memory for caching data transmitted between the local resource space where the microservice process is running and the memory pool. The memory expansion device is used to help the microservice process migrate memory data between the local resource space and the memory pool, thereby minimizing the local resource occupancy of the microservice process, thereby making the life cycle of the microservice process span multiple service cycles, thereby avoiding performance degradation caused by repeated initialization.

[0172] In one embodiment of the present disclosure, the memory page of the specified microservice process running in the local resource space is migrated from the local memory in the local resource space to the memory pool 420 through the memory expansion device.

[0173] According to the technical solution provided by the embodiment of the present disclosure, the memory page of the specified microservice process running in the local resource space is migrated from the local memory in the local resource space to the memory pool through the memory expansion device, and the memory expansion device is used to help the microservice process migrate memory data between the local resource space and the memory pool, so that the local resource occupation of the microservice process is minimized, and the life cycle of the microservice process spans multiple service cycles, thereby avoiding performance degradation caused by repeated initialization.

[0174] In one embodiment of the present disclosure, the memory expansion device also includes a buffer storage management module, which is used to monitor the memory resources used by the process of the specified microservice whose memory page is migrated out to the memory pool 420, wherein, in response to the buffer storage management module monitoring that the specified microservice process whose memory page is migrated out to the memory pool 420 cannot access the memory page in the local resource space, the buffer storage management module pre-migrates the memory page from the memory pool 420 back to the buffer memory, wherein the local server 410 migrates the memory page from the buffer memory back to the local memory in the local resource space.

[0175] According to the technical solution provided by the embodiment of the present disclosure, the memory expansion device also includes a buffer storage management module, which is used to monitor the memory resources used by the process of the designated microservice whose memory page is migrated out to the memory pool, wherein, in response to the buffer storage management module monitoring that the designated microservice process whose memory page is migrated out to the memory pool cannot access the memory page in the local resource space, the buffer storage management module pre-migrates the memory page from the memory pool back to the buffer memory, wherein the local server migrates the memory page from the buffer memory back to the local memory in the local resource space, and helps the microservice process migrate memory data between the local resource space and the memory pool by utilizing the high-speed cache memory of the memory expansion device, so that the local resource occupation of the microservice process is minimized, and then the life cycle of the microservice process spans multiple service cycles, thereby avoiding performance degradation caused by repeated initialization.

[0176] In one embodiment of the present disclosure, before migrating the memory page of the specified microservice process running in the local resource space from the local memory in the local resource space to the memory pool 420, the local server 410 releases the mapping relationship between the virtual address in the local resource space and the memory page.

[0177] According to the technical solution provided by the embodiment of the present disclosure, before the local server migrates the memory page of the specified microservice process running in the local resource space from the local memory in the local resource space to the memory pool, the mapping relationship between the virtual address in the local resource space and the memory page is released, so that the memory occupied by the microservice in the local resource space can be released, so that the local resource occupation of the microservice process is minimized, and the life cycle of the microservice process spans multiple service cycles, thereby avoiding performance degradation caused by repeated initialization.

[0178] In one embodiment of the present disclosure, in response to a memory page being migrated out to the memory pool 420, the virtual address in the local resource space that has a mapping relationship with the memory page cannot access the memory page, and a page fault exception is triggered in the local server 410, wherein, in response to monitoring the page fault exception, the local server 410 migrates the memory page from the memory pool 420 back to the local memory in the local resource space, and establishes a mapping relationship from the virtual address in the local resource space to the memory page, thereby resolving the page fault exception.

[0179] According to the technical solution provided by the embodiment of the present disclosure, in response to the designated microservice process of the memory page being migrated out to the memory pool, the virtual address in the local resource space that has a mapping relationship with the memory page cannot access the memory page, triggering a page fault exception in the local server, wherein, in response to detecting the page fault exception, the local server migrates the memory page from the memory pool back to the local memory in the local resource space, and establishes a mapping relationship from the virtual address in the local resource space to the memory page, so as to resolve the page fault exception. It is not necessary to reinitialize the microservice, but the data of the microservice process is directly migrated back to the memory in the local resource space, so that the life cycle of the microservice process spans multiple service cycles, thereby avoiding performance degradation caused by repeated initialization.

[0180] In one embodiment of the present disclosure, the memory expansion device is implemented by a field programmable gate array, and the memory expansion device has a high-speed cache memory as the buffer memory.

[0181] According to the technical solution provided by the embodiment of the present disclosure, the memory expansion device is implemented by a field programmable gate array, and the memory expansion device has a high-speed cache memory as the buffer memory, so that the memory expansion device is easy to implement, and the high-speed cache memory of the memory expansion device is used to help the microservice process migrate memory data between the local resource space and the memory pool, so that the local resource occupation of the microservice process is minimized, and the life cycle of the microservice process spans multiple service cycles, thereby avoiding performance degradation caused by repeated initialization.

[0182] Those skilled in the art will understand that referring to Figure 4 The technical solutions described can be compared with Figures 1 to 3 The described embodiments are combined to provide a reference Figures 1 to 3 The technical effects achieved by the described embodiments. Figures 1 to 3 The specific content of the description will not be repeated here.

[0183] The following will refer to Figure 5 A server system is described. Figure 5 A structural block diagram of a server system 500 according to an embodiment of the present disclosure is shown.

[0184] like Figure 5As shown, the server system 500 includes a local server 510 , a memory expansion device 520 , and a memory pool 530 . The local server 510 is connected to the memory pool 530 through the memory expansion device 520, wherein the local server 510 has a local resource space running a microservice process, and the memory expansion device 520 includes a buffer memory, and the buffer memory is used to cache data transmitted between the local resource space running a microservice process and the memory pool 530, wherein the local server 510 migrates the memory page of the specified microservice process running in the local resource space from the local memory in the local resource space to the memory pool 530 via the memory expansion device 520, wherein the specified microservice process remains in a running state when the memory page is migrated to the memory pool 530, wherein in response to the specified microservice process whose memory page is migrated to the memory pool 530 cannot access the memory page in the local resource space, the local server 510 migrates the memory page from the memory pool 530 back to the local memory in the local resource space via the memory expansion device 520.

[0185] According to the technical solution provided by the embodiment of the present disclosure, through a local server, a memory expansion device and a memory pool, wherein the local server and the memory pool are connected through the memory expansion device, wherein the local server has a local resource space running a microservice process, and the memory expansion device includes a buffer memory, wherein the buffer memory is used to cache data transmitted between the local resource space running a microservice process and the memory pool, wherein the local server migrates the memory page of the specified microservice process running in the local resource space from the local memory in the local resource space to the memory pool through the memory expansion device, wherein the specified microservice process The service process remains in a running state when the memory page is migrated out to the memory pool, wherein, in response to the specified microservice process being unable to access the memory page in the local resource space after the memory page is migrated out to the memory pool, the local server migrates the memory page from the memory pool back to the local memory in the local resource space via the memory expansion device, and the memory expansion device is used to help the microservice process migrate memory data between the local resource space and the memory pool, so that the local resource occupation of the microservice process is minimized, thereby making the life cycle of the microservice process span multiple service cycles, thereby avoiding performance degradation caused by repeated initialization.

[0186] In one embodiment of the present disclosure, the local server 510 includes an active page recycling module for intercepting an offline instruction to the designated microservice process, wherein, based on the intercepted offline instruction to the designated microservice process, the active page recycling module migrates the memory pages of the designated microservice process running in the local resource space from the local memory in the local resource space to the memory pool 530 via the memory expansion device 520.

[0187] According to the technical solution provided by the embodiment of the present disclosure, the local server includes an active page recovery module for intercepting the offline instruction of the designated microservice process, wherein, according to the intercepted offline instruction of the designated microservice process, the active page recovery module migrates the memory page of the designated microservice process running in the local resource space from the local memory in the local resource space to the memory pool via the memory expansion device, so that the microservice process does not need to completely exit locally according to the offline instruction, but can minimize the local resource occupation of the microservice process by utilizing the memory pool, thereby making the life cycle of the microservice process span multiple service cycles, thereby avoiding performance degradation caused by repeated initialization.

[0188] In one embodiment of the present disclosure, the active page recovery module intercepts an online instruction for the designated microservice process whose memory page is migrated out to the memory pool 530, wherein, based on the intercepted online instruction for the designated microservice process whose memory page is migrated out to the memory pool 530, the active page recovery module monitors whether the designated microservice process accesses the memory page in the local resource space, wherein, in response to monitoring that the designated microservice process cannot access the memory page in the local resource space, the active page recovery module migrates the memory page from the memory pool 530 back to the local memory in the local resource space via the memory expansion device 520.

[0189] According to the technical solution provided by the embodiment of the present disclosure, the online instruction of the designated microservice process whose memory page is migrated out to the memory pool is intercepted by the active page recovery module, wherein, according to the intercepted online instruction of the designated microservice process whose memory page is migrated out to the memory pool, the active page recovery module monitors whether the designated microservice process accesses the memory page in the local resource space, wherein, in response to monitoring that the designated microservice process cannot access the memory page in the local resource space, the active page recovery module migrates the memory page from the memory pool back to the local memory in the local resource space via the memory expansion device, so that the microservice does not need to perform a more complicated initialization process locally according to the online instruction, but can migrate the memory data back to the local by using the memory pool, thereby making the microservice process life cycle span multiple service cycles, thereby avoiding performance degradation caused by repeated initialization.

[0190] In one embodiment of the present disclosure, the memory expansion device 520 also includes a buffer storage management module, which is used to monitor the memory resources used by the process of the specified microservice whose memory page is migrated out to the memory pool 530, wherein, in response to the buffer storage management module monitoring that the specified microservice process whose memory page is migrated out to the memory pool 530 cannot access the memory page in the local resource space, the buffer storage management module pre-migrates the memory page from the memory pool 530 back to the buffer memory, wherein the active page recovery module migrates the memory page from the buffer memory back to the local memory in the local resource space.

[0191] According to the technical solution provided by the embodiment of the present disclosure, the memory expansion device also includes a buffer storage management module, which is used to monitor the memory resources used by the process of the designated microservice whose memory page is migrated out to the memory pool, wherein, in response to the buffer storage management module monitoring that the designated microservice process whose memory page is migrated out to the memory pool cannot access the memory page in the local resource space, the buffer storage management module pre-migrates the memory page from the memory pool back to the buffer memory, wherein the active page recycling module migrates the memory page from the buffer memory back to the local memory in the local resource space, and helps the microservice process migrate memory data between the local resource space and the memory pool by utilizing the buffer memory of the memory expansion device, so that the local resource occupation of the microservice process is minimized, thereby making the life cycle of the microservice process span multiple service cycles, thereby avoiding performance degradation caused by repeated initialization.

[0192] In one embodiment of the present disclosure, the active page recovery module releases the mapping relationship between the virtual address in the local resource space and the memory page before migrating the memory page of the specified microservice process running in the local resource space from the local memory in the local resource space to the memory pool 530.

[0193] According to the technical solution provided by the embodiment of the present disclosure, before the memory page of the specified microservice process running in the local resource space is migrated from the local memory in the local resource space to the memory pool, the mapping relationship between the virtual address in the local resource space and the memory page is released, so that the memory occupied by the microservice in the local resource space can be released, so that the local resource occupation of the microservice process is minimized, and the life cycle of the microservice process spans multiple service cycles, thereby avoiding performance degradation caused by repeated initialization.

[0194] In one embodiment of the present disclosure, in response to a memory page being migrated out to the memory pool 530, the virtual address in the local resource space that is mapped to the memory page cannot access the memory page, and a page fault exception is triggered in the local server 510, wherein the active page recovery module monitors whether the page fault exception occurs, wherein in response to detecting the page fault exception, the active page recovery module migrates the memory page from the memory pool 530 back to the local memory in the local resource space, and establishes a mapping relationship from the virtual address in the local resource space to the memory page, thereby resolving the page fault exception.

[0195] According to the technical solution provided by the embodiment of the present disclosure, in response to the memory page being migrated out to the memory pool, the virtual address in the local resource space that has a mapping relationship with the memory page cannot access the memory page, triggering a page fault exception in the local server, wherein the active page recovery module monitors whether the page fault exception occurs, wherein, in response to detecting the page fault exception, the active page recovery module migrates the memory page from the memory pool back to the local memory in the local resource space, and establishes a mapping relationship from the virtual address in the local resource space to the memory page, so as to solve the page fault exception. There is no need to reinitialize the microservice, but the data of the microservice process is directly migrated back to the memory in the local resource space, so that the life cycle of the microservice process spans multiple service cycles, thereby avoiding performance degradation caused by repeated initialization.

[0196] In one embodiment of the present disclosure, the memory expansion device 520 is implemented by a field programmable gate array, and the memory expansion device 520 has a high-speed cache memory as the buffer memory.

[0197] According to the technical solution provided by the embodiment of the present disclosure, the memory expansion device is implemented by a field programmable gate array, and the memory expansion device has a high-speed cache memory as the buffer memory, so that the memory expansion device is easy to implement, and the high-speed cache memory of the memory expansion device is used to help the microservice process migrate memory data between the local resource space and the memory pool, so that the local resource occupation of the microservice process is minimized, and the life cycle of the microservice process spans multiple service cycles, thereby avoiding performance degradation caused by repeated initialization.

[0198] Figure 6 Show according to Figure 5 An exemplary structural diagram of an implementation scenario of a server system is shown.

[0199] like Figure 6 As shown, the server system 600 includes a local server 610 , a memory expansion device 620 , and a memory pool 630 including a plurality of memories 631 . Figure 6 The server system shown is only an example, and the server system of the present disclosure may not be limited to the above structure. The number of the server 610, the memory expansion device 620 and the memory pool 630 may be multiple.

[0200] Those skilled in the art will understand that referring to Figure 5 and 6 The technical solutions described can be compared with Figures 1 to 4 The described embodiments are combined to provide a reference Figures 1 to 4 The technical effects achieved by the described embodiments. Figures 1 to 4 The specific content of the description will not be repeated here.

[0201] The aforementioned microservice operation optimization method can be implemented as an electronic device, such as Figure 7 As shown in , the electronic device 700 may include a processor 701 and a memory 702 .

[0202] The memory 702 is used to store a program that supports an electronic device to execute the microservice operation optimization method in any of the above embodiments, and the processor 701 is configured to execute the program stored in the memory 702.

[0203] In one embodiment of the present disclosure, the memory 702 is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor 701 to implement the following steps:

[0204] Establish a connection between the local resource space where the microservice process runs and the memory pool;

[0205] Migrating the memory page of the specified microservice process running in the local resource space from the local memory in the local resource space to the memory pool, wherein the specified microservice process remains in a running state when the memory page is migrated to the memory pool;

[0206] In response to the designated microservice process to which the memory page is migrated out of the memory pool being unable to access the memory page in the local resource space, the memory page is migrated from the memory pool back to the local memory in the local resource space.

[0207] In one embodiment of the present disclosure, the step of migrating the memory page of the specified microservice process running in the local resource space from the local memory in the local resource space to the memory pool includes:

[0208] Intercepting offline instructions for the specified microservice process;

[0209] According to the intercepted offline instruction for the designated microservice process, the memory page of the designated microservice process running in the local resource space is migrated from the local memory in the local resource space to the memory pool.

[0210] In one embodiment of the present disclosure, in response to the designated microservice process that is unable to access the memory page in the local resource space after the memory page is migrated out to the memory pool, migrating the memory page from the memory pool back to the local memory in the local resource space includes:

[0211] Intercepting an online instruction of the designated microservice process whose memory page is migrated out to the memory pool;

[0212] According to the intercepted online instruction of the designated microservice process whose memory page is migrated out to the memory pool, in response to monitoring that the designated microservice process cannot access the memory page in the local resource space, the memory page is migrated from the memory pool back to the local memory in the local resource space.

[0213] In one embodiment of the present disclosure, establishing a connection between a local resource space running a microservice process and a memory pool includes:

[0214] A connection between a local resource space running a microservice process and a memory pool is established through a memory expansion device.

[0215] In one embodiment of the present disclosure, the step of migrating the memory page of the specified microservice process running in the local resource space from the local memory in the local resource space to the memory pool includes:

[0216] The memory expansion device migrates the memory pages of the specified microservice process running in the local resource space from the local memory in the local resource space to the memory pool.

[0217] In one embodiment of the present disclosure, the memory 702 is used to store one or more computer instructions, wherein the one or more computer instructions are also executed by the processor 701 to implement the following steps:

[0218] Monitoring, by the memory expansion device, memory resources used by the process of the designated microservice whose memory pages are migrated out to the memory pool;

[0219] Wherein, in response to the designated microservice process that is unable to access the memory page in the local resource space after the memory page is migrated out to the memory pool, migrating the memory page from the memory pool back to the local memory in the local resource space includes:

[0220] In response to the memory expansion device detecting that the designated microservice process whose memory page is migrated out to the memory pool cannot access the memory page in the local resource space, the memory expansion device pre-migrates the memory page from the memory pool back to the cache memory in the memory expansion device through the memory expansion device;

[0221] The memory page is migrated from the cache memory in the memory expansion device back to the local memory in the local resource space.

[0222] In one embodiment of the present disclosure, before migrating the memory page of the specified microservice process running in the local resource space from the local memory in the local resource space to the memory pool, the method further includes:

[0223] The mapping relationship between the virtual address in the local resource space and the memory page is released.

[0224] In one embodiment of the present disclosure, in response to the designated microservice process that is unable to access the memory page in the local resource space after the memory page is migrated out to the memory pool, migrating the memory page from the memory pool back to the local memory in the local resource space includes:

[0225] In response to the memory page being migrated out to the memory pool, the virtual address of the designated microservice process in the local resource space that has a mapping relationship with the memory page cannot access the memory page, triggering a page fault exception;

[0226] In response to detecting the page fault exception, migrating the memory page from the memory pool back to the local memory in the local resource space;

[0227] A mapping relationship between the virtual address in the local resource space and the memory page is established to resolve the page missing exception.

[0228] The exemplary embodiments of the present disclosure also provide a computer storage medium for storing computer software instructions used by the microservice operation optimization device, which includes a program for executing any of the above embodiments, thereby achieving the technical effects brought by the method.

[0229] Figure 8 It is a structural diagram of a computer system suitable for implementing a data processing method and a resource providing method according to an embodiment of the present disclosure.

[0230] like Figure 8 As shown, the computer system 800 includes a processing unit (CPU, GPU, NPU, FPGA, etc.) 801, which can perform various processes in the embodiments shown in the above figures according to the program stored in the read-only memory (ROM) 802 or the program loaded from the storage part 808 to the random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the system 800 are also stored. The processing unit 801, ROM 802 and RAM 803 are connected to each other through a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0231] The following components are connected to the I / O interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed, so that a computer program read therefrom is installed into the storage section 808 as needed.

[0232] In particular, according to an embodiment of the present disclosure, the method described above with reference to the accompanying drawings can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program tangibly contained on a readable medium thereof, and the computer program includes program code for executing the method in the accompanying drawings. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 809, and / or installed from a removable medium 811.

[0233] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the road map or block diagram can represent a part of a module, program segment or code, and the part of the module, program segment or code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a different order from the order marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0234] The units or modules involved in the embodiments described in the present disclosure may be implemented by software or hardware. The units or modules described may also be set in a processor, and the names of these units or modules do not constitute limitations on the units or modules themselves in some cases.

[0235] As another aspect, the present disclosure further provides a computer-readable storage medium, which may be a computer-readable storage medium included in the device described in the above embodiment; or a computer-readable storage medium that exists independently and is not assembled into the device. The computer-readable storage medium stores one or more programs, and the programs are used by one or more processors to execute the method described in the present disclosure, thereby achieving the technical effects brought by the method.

[0236] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present disclosure is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the inventive concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other.

Claims

1. A microservice operation optimization method, comprising: Establish a connection between the local resource space where the microservice process runs and the memory pool; Migrating the memory page of the specified microservice process running in the local resource space from the local memory in the local resource space to the memory pool, wherein the specified microservice process remains in a running state when the memory page is migrated to the memory pool; In response to the designated microservice process to which the memory page is migrated out to the memory pool being unable to access the memory page in the local resource space, migrating the memory page from the memory pool back to the local memory in the local resource space; The establishing of a connection between the local resource space in which the microservice process is running and the memory pool includes: establishing a connection between the local resource space in which the microservice process is running and the memory pool through a memory expansion device.

2. The method according to claim 1, wherein: The step of migrating the memory page of the specified microservice process running in the local resource space from the local memory in the local resource space to the memory pool includes: Intercepting offline instructions for the specified microservice process; According to the intercepted offline instruction for the designated microservice process, the memory page of the designated microservice process running in the local resource space is migrated from the local memory in the local resource space to the memory pool.

3. The method according to claim 2, wherein: In response to the memory page being migrated out to the memory pool, the designated microservice process cannot access the memory page in the local resource space, migrating the memory page from the memory pool back to the local memory in the local resource space, comprising: Intercepting an online instruction of the designated microservice process whose memory page is migrated out to the memory pool; According to the intercepted online instruction of the designated microservice process whose memory page is migrated out to the memory pool, in response to monitoring that the designated microservice process cannot access the memory page in the local resource space, the memory page is migrated from the memory pool back to the local memory in the local resource space.

4. The method according to claim 1, wherein: The step of migrating the memory page of the specified microservice process running in the local resource space from the local memory in the local resource space to the memory pool includes: The memory expansion device migrates the memory pages of the specified microservice process running in the local resource space from the local memory in the local resource space to the memory pool.

5. The method according to claim 4, further comprising: Monitoring, by the memory expansion device, memory resources used by the process of the designated microservice whose memory pages are migrated out to the memory pool; Wherein, in response to the designated microservice process that is unable to access the memory page in the local resource space after the memory page is migrated out to the memory pool, migrating the memory page from the memory pool back to the local memory in the local resource space includes: In response to the memory expansion device detecting that the designated microservice process whose memory page is migrated out to the memory pool cannot access the memory page in the local resource space, the memory expansion device pre-migrates the memory page from the memory pool back to the cache memory in the memory expansion device through the memory expansion device; The memory page is migrated from the cache memory in the memory expansion device back to the local memory in the local resource space.

6. The method according to any one of claims 1 to 3, wherein: Before migrating the memory page of the specified microservice process running in the local resource space from the local memory in the local resource space to the memory pool, the method further includes: The mapping relationship between the virtual address in the local resource space and the memory page is released.

7. The method according to claim 6, wherein: In response to the memory page being migrated out to the memory pool, the designated microservice process cannot access the memory page in the local resource space, migrating the memory page from the memory pool back to the local memory in the local resource space, comprising: In response to the memory page being migrated out to the memory pool, the virtual address of the designated microservice process in the local resource space that has a mapping relationship with the memory page cannot access the memory page, triggering a page fault exception; In response to detecting the page fault exception, migrating the memory page from the memory pool back to the local memory in the local resource space; A mapping relationship between the virtual address in the local resource space and the memory page is established to resolve the page missing exception.

8. A microservice operation system, comprising a local server and a memory pool connected to each other, in, The local server has a local resource space in which a microservice process is running. wherein the local server migrates the memory page of the specified microservice process running in the local resource space from the local memory in the local resource space to the memory pool, wherein the specified microservice process remains in a running state when the memory page is migrated to the memory pool, In response to the designated microservice process that has migrated the memory page out to the memory pool being unable to access the memory page in the local resource space, the local server migrates the memory page from the memory pool back to the local memory in the local resource space; The system also includes establishing a connection between the local resource space running the microservice process and the memory pool through a memory expansion device.

9. The system according to claim 8, wherein: The local server intercepts the offline instruction of the specified microservice process, According to the intercepted offline instruction for the designated microservice process, the local server migrates the memory pages of the designated microservice process running in the local resource space from the local memory in the local resource space to the memory pool.

10. The system according to claim 9, wherein: The local server intercepts the online instruction of the designated microservice process whose memory page is migrated out to the memory pool, Among them, according to the intercepted online instruction of the designated microservice process whose memory page is migrated out to the memory pool, the local server responds to monitoring that the designated microservice process cannot access the memory page in the local resource space, and migrates the memory page from the memory pool back to the local memory in the local resource space.

11. The system according to any one of claims 8 to 10, further comprising: A memory expansion device is arranged between the local server and the memory pool, and the memory expansion device includes a buffer memory for caching data transmitted between the local resource space running the microservice process and the memory pool.

12. The system according to claim 11, wherein: The memory expansion device migrates the memory pages of the specified microservice process running in the local resource space from the local memory in the local resource space to the memory pool.

13. The system according to claim 12, wherein: The memory expansion device further includes a buffer storage management module, which is used to monitor the memory resources used by the process of the specified microservice whose memory pages are migrated out to the memory pool, In response to the buffer storage management module detecting that the designated microservice process whose memory page is migrated out of the memory pool cannot access the memory page in the local resource space, the buffer storage management module migrates the memory page from the memory pool back to the buffer memory in advance, The local server migrates the memory page from the buffer memory back to the local memory in the local resource space.

14. The system according to claim 11, wherein: The memory expansion device is implemented by a field programmable gate array, and the memory expansion device has a high-speed cache memory as the buffer memory.

15. A server system comprising a local server, a memory expansion device and a memory pool, in, The local server is connected to the memory pool via the memory expansion device. The local server has a local resource space running a microservice process, and the memory expansion device includes a buffer memory, and the buffer memory is used to cache data transmitted between the local resource space running the microservice process and the memory pool. wherein the local server migrates the memory page of the specified microservice process running in the local resource space from the local memory in the local resource space to the memory pool via the memory expansion device, wherein the specified microservice process remains in a running state when the memory page is migrated to the memory pool, In which, in response to the designated microservice process whose memory page is migrated out to the memory pool being unable to access the memory page in the local resource space, the local server migrates the memory page from the memory pool back to the local memory in the local resource space via the memory expansion device.

16. The system of claim 15, wherein: The local server includes an active page recovery module for intercepting offline instructions for the specified microservice process. Among them, according to the intercepted offline instruction for the designated microservice process, the active page recovery module migrates the memory pages of the designated microservice process running in the local resource space from the local memory in the local resource space to the memory pool via the memory expansion device.

17. The system of claim 16, wherein: The active page recovery module intercepts the online instruction of the designated microservice process whose memory page is migrated out to the memory pool, According to the intercepted online instruction of the designated microservice process whose memory page is migrated out to the memory pool, the active page recovery module monitors whether the designated microservice process accesses the memory page in the local resource space. In response to monitoring that the designated microservice process cannot access the memory page in the local resource space, the active page recovery module migrates the memory page from the memory pool back to the local memory in the local resource space via the memory expansion device.

18. An electronic device, characterized in that: The method comprises a memory and a processor; wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the method according to any one of claims 1 to 7.

19. A readable storage medium having computer instructions stored thereon, characterized in that: When the computer instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Method for achieving software fast handover based on physical internal storage and device thereof

    CN102467404A