A data caching method, a caching device, equipment and a medium
By dynamically setting the disk write speed and memory parameters of local computing nodes in the AI cluster, the data caching method was optimized, solving the IO blocking problem caused by high-concurrency data caching and improving the stability of the AI cluster.
Patent Information
- Application Number
- CN202310775018.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-28
- Publication Date
- 2026-11-20
- Estimated Expiration
- 2043-06-28
AI Technical Summary
In AI training platforms, high-concurrency data caching leads to excessive disk I/O pressure, causing I/O blocking, which in turn affects the availability of cluster nodes and leads to abnormal situations.
By setting disk write speed and memory parameters based on the disk type and network type of the local computing node, kernel parameter values for disk write are generated, and the data caching method is dynamically adjusted to optimize the data write process and avoid IO blocking.
It improves the stability of the AI cluster in high-concurrency data caching scenarios, avoids cluster unavailability caused by excessive node disk throughput, and enhances the overall stability of the cluster.
Smart Images

Figure CN116795734B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of AI cluster technology, and in particular to a data caching method, caching device, equipment, and medium. Background Technology
[0002] Currently, in the data caching module of AI (Artificial Intelligence) training platforms, users typically have a large amount of data in order to train models with higher accuracy.
[0003] Currently, the training platform serves a large number of educational and research users, whose user scenarios include the following characteristics:
[0004] 1. The user dataset is quite large;
[0005] 2. Large user base;
[0006] 3. Furthermore, user activity time is relatively concentrated;
[0007] 4. The cluster nodes have relatively few resources.
[0008] To improve AI training efficiency, users typically pull data from remote shared storage to their local computing nodes before training. For teaching and research user groups with a large number of users and concentrated user activity times, high-concurrency data caching often occurs on the same computing node.
[0009] In high-concurrency data caching scenarios on the same computing node, a relatively concentrated amount of data will be written to the server's disk. The large amount of data written to the disk in a short period of time will inevitably cause excessive disk I / O pressure, resulting in I / O blocking.
[0010] When the data is written to disk, the Docker (i.e., the application container engine) background daemon hangs (i.e. crashes) due to IO blocking. The kubelet (i.e., a proxy component on the Kubernetes worker node) service in the cluster fails to access dockerd (i.e., the process running in the background of the application container engine), and then sets the node to NotReady state (i.e., unavailable state), causing the cluster node to become unavailable and thus affecting the use of the cluster node. Summary of the Invention
[0011] To address the aforementioned technical problems, this invention provides a data caching method, caching device, equipment, and medium. The caching method is used to solve the problem that high-concurrency data cannot be cached on local computing nodes in current AI clusters.
[0012] To achieve the above objectives, the present invention provides a data caching method for caching data on high-concurrency local computing nodes in an AI cluster, the caching method comprising:
[0013] Set the disk write speed parameters corresponding to the local computing node according to the disk type and network type of the local computing node, and obtain the node memory parameters of the local computing node;
[0014] The disk write speed parameters and the node memory parameters are updated in the configuration item loading template file; wherein, the configuration item loading template file is stored in the default global shared directory of the shared storage;
[0015] When the data caching proxy module microservice of the local computing node starts, it obtains the disk write speed parameters and the node memory parameters corresponding to the local computing node from the configuration item loading template file, and calculates and generates the disk write kernel parameter value corresponding to the local computing node according to the data write-to-disk preset algorithm to ensure that the local computing node performs high-concurrency data caching.
[0016] Furthermore, the calculation and generation of the disk-based kernel parameter values corresponding to the local computing node specifically includes:
[0017] The disk write kernel parameter value corresponding to the local computing node is calculated and generated according to the preset algorithm for data write to disk. The disk write kernel parameter value includes a first percentage parameter of dirty data that triggers synchronous write to occupy available memory and a second percentage parameter of dirty data that triggers flush to occupy memory.
[0018] The formula for calculating the first percentage parameter is as follows:
[0019]
[0020]
[0021] The formula for calculating the second percentage parameter is:
[0022]
[0023] Wherein, vm.dirty_ratio is the first percentage parameter, vm.dirty_background_ratio is the second percentage parameter; disk_ws is the disk write speed parameter, and total_mem is the node memory parameter.
[0024] Furthermore, the caching method also includes:
[0025] When the data caching proxy module microservice starts in each computing node, it mounts the default global shared directory as a storage volume to the container.
[0026] Furthermore, setting the disk write speed parameters corresponding to the local computing node specifically includes:
[0027] The disk write speed parameters are set according to the disk type and network type of the local computing node; wherein, the disk type of the local computing node includes at least one of the following: NVME, SSD, HDD; and the network card type of the local computing node includes at least one of the following: Gigabit Ethernet, 10 Gigabit Ethernet, IB network card.
[0028] Furthermore, based on the disk type and network type of the local computing node, the disk write speed parameters corresponding to the local computing node are set, and the node memory parameters of the local computing node are obtained, specifically including:
[0029] The disk write speed parameters corresponding to the local computing node are obtained by testing with the dd command, and the node memory parameters corresponding to the local computing node are obtained by testing with the free command.
[0030] Furthermore, the caching method also includes:
[0031] The configuration item loading template file is stored in JSON format in the default global shared directory.
[0032] Furthermore, the startup of the data caching proxy module microservice on the local computing node specifically includes:
[0033] The data caching proxy module microservice writes files to write the data to be cached to a memory buffer, and then writes the data to be cached from the memory buffer to the local disk.
[0034] The present invention also provides a data caching device for implementing the aforementioned data caching method, the caching device comprising:
[0035] The local computing node parameter acquisition unit is used to: set the disk write speed parameters corresponding to the local computing node according to the disk type and network type of the local computing node, and acquire the node memory parameters of the local computing node;
[0036] The local computing node parameter update unit is used to update the disk write speed parameters and the node memory parameters to the configuration item loading template file; wherein the configuration item loading template file is stored in the default global shared directory of the shared storage;
[0037] The disk write kernel parameter calculation unit is used to: when the data caching proxy module microservice of the local computing node starts, obtain the disk write speed parameters and the node memory parameters corresponding to the local computing node from the configuration item loading template file, and calculate and generate the disk write kernel parameter value corresponding to the local computing node according to the data write-to-disk preset algorithm, so as to ensure that the local computing node performs high-concurrency data caching.
[0038] The present invention also provides a computer device, including a memory, a processor, and a computer program, wherein the computer program is stored in the memory and can run on the processor, and the processor executes the computer program to implement the steps of the aforementioned data caching method.
[0039] The present invention further provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the aforementioned data caching method.
[0040] The above-described technical solution of the present invention has the following technical effects compared with the prior art:
[0041] In this invention, the disk write speed of the local computing node is first set according to the disk and network types of different nodes in the cluster, which can be defined as the variable disk_ws; the memory size of the computing node is obtained, which can be defined as the variable total_mem.
[0042] Then, based on the actual environment, the variables corresponding to each node are updated to the pre-configured loading template file; this template file is stored in the default global shared directory of shared storage; when the microservice of the data caching proxy module of each compute node starts, the default global shared directory of shared storage can be mounted as a storage volume into the container;
[0043] Finally, the data caching proxy module deployed on each computing node loads a pre-set configuration template file when the microservice starts, reads the disk write speed and total memory parameters corresponding to that node, and calculates reasonable kernel parameter values related to disk writes for that node using a specific algorithm (e.g., the percentage of memory occupied by dirty data that triggers a flush (vm.dirty_background_ratio), the percentage of available memory occupied by dirty data that triggers synchronous writes (vm.dirty_ratio). The executable command sets the kernel parameters according to the calculated values and makes them take effect immediately.
[0044] Therefore, by using a pre-setting algorithm for data persistence parameters, the data persistence parameter values can be dynamically set according to the parameters of each node in the actual production environment cluster, so as to ensure that the local computing nodes can successfully perform high-concurrency data caching. Attached Figure Description
[0045] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0046] Figure 1 This is a flowchart illustrating the data caching method in Embodiment 1 of the present invention;
[0047] Figure 2 This is a data caching architecture diagram of a 3-node cluster in an actual embodiment of the present invention;
[0048] Figure 3 This is a structural block diagram of the data caching device in Embodiment 2 of the present invention;
[0049] Figure 4 This is an internal structural diagram of the computer device in Embodiment 2 of the present invention. Detailed Implementation
[0050] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0051] Example 1:
[0052] like Figure 1 As shown, this embodiment of the invention provides a data caching method for caching data on high-concurrency local computing nodes in an AI cluster. The caching method includes:
[0053] S1 sets the disk write speed parameters corresponding to the local computing node based on the disk type and network type of the local computing node, and obtains the node memory parameters of the local computing node.
[0054] S2 updates the disk write speed parameters and node memory parameters to the configuration item loading template file; the configuration item loading template file is stored in the default global shared directory of the shared storage;
[0055] When the S3 local compute node's data caching proxy module microservice starts, it retrieves the disk write speed parameters and node memory parameters corresponding to the local compute node from the configuration item loading template file. Based on the data write-to-disk preset algorithm, it calculates and generates the corresponding disk write kernel parameter values for the local compute node to ensure high-concurrency data caching on the local compute node.
[0056] In a specific embodiment, firstly, for different disk and network types of nodes in the cluster, the disk write speed of the local computing node is set, which can be defined as the variable disk_ws; the memory size of the computing node is obtained, which can be defined as the variable total_mem.
[0057] Then, based on the actual environment, the variables corresponding to each node are updated to the pre-configured loading template file; this template file is stored in the default global shared directory of shared storage; when the microservice of the data caching proxy module of each compute node starts, the default global shared directory of shared storage can be mounted as a storage volume into the container;
[0058] Finally, the data caching proxy module deployed on each computing node loads a pre-set configuration template file when the microservice starts, reads the disk write speed and total memory parameters corresponding to that node, and calculates reasonable kernel parameter values related to disk writes for that node using a specific algorithm (e.g., the percentage of memory occupied by dirty data that triggers a flush (vm.dirty_background_ratio), the percentage of available memory occupied by dirty data that triggers synchronous writes (vm.dirty_ratio). The executable command sets the kernel parameters according to the calculated values and makes them take effect immediately.
[0059] Therefore, by using a pre-setting algorithm for data persistence parameters, the data persistence parameter values can be dynamically set according to the parameters of each node in the actual production environment cluster, so as to ensure that the local computing nodes can successfully perform high-concurrency data caching.
[0060] In practical embodiments, the above data caching method is mainly applied to the data caching module of the AI training platform, which can solve the following abnormal situations in high-concurrency scenarios: in the same computing node of the cluster, the data cache suddenly experiences high disk throughput, causing the entire cluster node to become unavailable;
[0061] It can improve the cluster stability of AI training platforms in high-concurrency data caching scenarios, and can solve the abnormal situation of high disk throughput in high-concurrency scenarios when the dataset is cached to local computing nodes, which leads to cluster unavailability, thus improving the stability of AI clusters.
[0062] In practice, the disk configuration (e.g., NVMe, SSD, HDD) and network configuration (network card type, including Gigabit Ethernet, 10 Gigabit Ethernet, IB network card) of different nodes in different clusters have a great impact on disk write speed.
[0063] Based on the above data caching methods, a data caching scheme with dynamically set disk persistence parameters is proposed for high-concurrency data caching scenarios in AI training platforms. It can set reasonable kernel parameters according to the disk, network card, and memory information of different nodes in each actual production environment cluster, solving abnormal situations such as excessive disk I / O peaks, Docker background daemons hanging due to I / O blocking (i.e., crashes), and failure of kubelet service in the cluster to access dockerd (i.e., the process running in the background of the application container engine), which can lead to the unavailability of each node in the cluster. This avoids the abnormal situation of node unavailability caused by excessive disk throughput during high-concurrency data caching in the cluster, and improves the stability of the entire AI cluster.
[0064] In a preferred embodiment, calculating the disk-based kernel parameter values corresponding to the local computing node specifically includes:
[0065] The disk writing kernel parameter values corresponding to the local computing node are calculated and generated according to the preset algorithm for data disk writing. The disk writing kernel parameter values include the first percentage of available memory occupied by dirty data that triggers synchronous writing and the second percentage of memory occupied by dirty data that triggers flushing.
[0066] The formula for calculating the first percentage parameter is as follows:
[0067]
[0068]
[0069] The formula for calculating the second percentage parameter is:
[0070]
[0071] Where vm.dirty_ratio is the first percentage parameter, vm.dirty_background_ratio is the second percentage parameter; disk_ws is the disk write speed parameter, and total_mem is the node memory parameter.
[0072] In a practical implementation, vm.dirty_background_ratio represents the percentage of memory occupied by dirty data that triggered the flush;
[0073] For example, if a server has 250GB of memory and vm.dirty_background_ratio = 10, then 25GB of data can be temporarily stored in memory (this part of the data is called dirty data). When the data in memory exceeds 25GB, a write-back procedure will be triggered, and the system will write the data in memory to the disk.
[0074] Meanwhile, vm.dirty_ratio represents the percentage of available memory occupied by dirty data that triggers synchronous writes;
[0075] For example, if a server has 250GB of memory and vm.dirty_ratio=20, then once the data in memory reaches 50GB, the data must be written back to the disk.
[0076] If the application continuously writes data at a rate greater than the rate at which data is written back from memory to disk, the vm.dirty_ratio threshold will be reached, and new I / O will be blocked until the data is written to disk.
[0077] In high-concurrency data caching scenarios on the same compute node, there will be a relatively concentrated dataset cache on the server's disk, meaning that the application writes a large amount of data in a short period of time. When it exceeds the set vm.dirty_ratio threshold, it will inevitably lead to excessive disk pressure and IO blocking. When dirty data in memory is written to disk, the kubelet service in the cluster fails to access dockerd (i.e., the process running in the background of the application container engine), and then puts the node into NotReady (i.e., unavailable state). This causes an abnormal situation where the cluster node becomes unavailable, which in turn affects the use of the cluster node.
[0078] Furthermore, in the algorithm of the above data caching method, disk_ws is the disk write speed and total_mem is the total memory size of the computing node. In actual use, available memory may not reach the total memory, so the value estimated by using the total memory can be considered as having calculated the boundary margin.
[0079] In this algorithm, the value of vm.dirty_ratio cannot exceed 80% of the available memory. This is to reserve a certain proportion of memory to ensure the normal operation of various applications on the server and to prevent dirty data in the memory buffer from filling up the available memory. In addition, this threshold is guaranteed to be no less than 20% to ensure a certain level of data caching efficiency. Because the reading and writing of the memory buffer is relatively fast, if this value is small, the time for data to be synchronously written to the disk will be longer, and the efficiency will be relatively low.
[0080] The algorithm uses half of vm.dirty_background_ratio to ensure that the system actively flushes the data in the memory buffer to disk after the vm.dirty_ratio value is reached.
[0081] In a preferred embodiment, the caching method further includes:
[0082] When the data caching proxy module microservice starts in each compute node, it mounts the default global shared directory as a storage volume to the container.
[0083] In a practical implementation, the configuration item loading template file is stored in the default global shared directory of the shared storage; when the microservice of the data caching proxy module of each compute node starts, it will mount the default global shared directory of the shared storage as a storage volume into the container.
[0084] In a preferred embodiment, setting the disk write speed parameters corresponding to the local computing node specifically includes:
[0085] Set the disk write speed parameters according to the disk type and network type of the local computing node; wherein, the disk type of the local computing node includes at least one of the following: NVME, SSD, HDD; and the network card type of the local computing node includes at least one of the following: Gigabit Ethernet, 10 Gigabit Ethernet, IB network card.
[0086] In a preferred embodiment, the disk write speed parameters corresponding to the local computing node are set according to the disk type and network type of the local computing node, and the node memory parameters of the local computing node are obtained, specifically including:
[0087] The disk write speed parameters of the local compute node are obtained by testing with the dd command, and the node memory parameters of the local compute node are obtained by testing with the free command.
[0088] In practical implementations, the disk write speed for shared storage pulled to the local compute node can be set according to the disk type (NVME, SSD, HDD) and network interface card (NIC) type (Gigabit Ethernet, 10 Gigabit Ethernet, IB NIC) of the cluster nodes, and a variable `disk_ws` is defined. The memory size of the compute node is obtained, and a variable `total_mem` is defined.
[0089] disk_ws can be obtained using the dd command, and total_mem can be obtained using the free command.
[0090] In a preferred embodiment, the caching method further includes:
[0091] The configuration item loading template file is stored in JSON format in the default global shared directory.
[0092] In a practical implementation, the template file can be saved in JSON format, making it easy for the application to parse and retrieve it.
[0093] In a preferred embodiment, the data caching proxy module microservice on the local compute node is started, specifically including:
[0094] The data caching proxy module microservice writes files to write the data to be cached to a memory buffer, and then writes the data to be cached from the memory buffer to the local disk.
[0095] In practice, users' datasets are large and are usually placed in external shared storage (such as NFS, BeegFS, GPFS, etc.). In the past, for AI training, in order to avoid the performance problems caused by directly accessing the remote shared storage for each batch and epoch, the dataset from the remote shared storage was usually pulled to the local cache before training.
[0096] In a practical implementation, a dataset-agent microservice (i.e., a data proxy microservice) is deployed on each compute node to perform local caching for that node. The main function of this microservice is to cache data from shared storage onto the local disk of that node.
[0097] The ata-agent data caching microservice caching process uses a lot of Java code in the NIO package. This program writes files using the Buffed IO type, writing data to a memory buffer, and then the system writes the data back from the memory buffer to the local disk.
[0098] In a preferred embodiment, the caching method further includes:
[0099] When the disk write speed parameters and node memory parameters corresponding to the local computing node are written into the configuration item loading template file, the local computing node's data cache proxy module microservice calculates and generates the disk write kernel parameter values corresponding to the local computing node according to the preset data write algorithm.
[0100] In practical implementations, it is only necessary to write the disk_ws and total_mem parameters from the actual cluster into the parameter template file in the shared storage. The parameter calculation algorithm is handled by the application in the data cache agent microservice, which reduces the tediousness and error-proneness of manual operation by maintenance personnel.
[0101] like Figure 2 As shown, in the actual implementation, node1-node3 are used to briefly represent a cluster (the size of the cluster varies in different production environments, and this cluster is only for illustrative purposes).
[0102] Disk write speed (disk_ws) can be tested using the dd command, and memory size (total_mem) can be obtained using the free command.
[0103] The disk write speed and memory size are obtained from nodes node1, node2, and node3 in the cluster, respectively, and written to a parameter template file in shared storage. The template file can be saved in JSON format for easy parsing and retrieval by the application.
[0104] Since the dataset in the shared storage needs to be cached locally, the shared storage needs to be mounted as a storage volume in the dataset-agent data caching agent microservice. Therefore, the parameter template file is also placed in a directory of the shared storage for easy reading when the microservice starts.
[0105] When the data caching proxy microservice starts, it reads the updated parameter template file, writes the above algorithm into the microservice startup program, calculates the reasonable kernel parameter values related to disk persistence for the node, and then sets the computing node according to the calculated kernel parameter values and executes commands to make it take effect immediately after the microservice starts.
[0106] In summary, the advantages of the above data caching methods are as follows:
[0107] 1. By dynamically setting reasonable disk persistence parameters based on the resource information of different nodes in the cluster, the abnormal situation of nodes becoming unavailable due to excessive disk throughput during high-concurrency data caching within the cluster is avoided, thus improving the stability of the entire AI cluster.
[0108] 2. Meanwhile, the parameter value is preset in the template file of the shared storage. After the calculated parameter value is filled into the template file, the data cache agent microservice of the compute node starts, dynamically modifies the parameter value and makes it effective, reducing the tediousness and error-proneness of manual operation by operation and maintenance personnel.
[0109] In other words, you only need to write the disk_ws and total_mem parameters from the actual cluster into the parameter template file in the shared storage. The parameter calculation algorithm is handled by the application in the data caching agent microservice, which reduces the tediousness and error-proneness of manual operation by maintenance personnel.
[0110] It is important to note that although the steps in the flowchart are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the exact order indicated by the arrows. Unless explicitly stated herein, there is no strict order constraint on the execution of these steps; they can be executed in other orders. Furthermore, at least some steps in the flowchart may include multiple sub-steps or stages. These sub-steps or stages do not necessarily complete at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be alternated or carried out in turn with other steps or at least some of the sub-steps or stages of other steps.
[0111] Example 2:
[0112] like Figure 3 As shown, this embodiment of the invention also provides a data caching device for implementing the aforementioned data caching method. The caching device includes:
[0113] The local compute node parameter acquisition unit is used to: set the disk write speed parameters corresponding to the local compute node according to the disk type and network type of the local compute node, and acquire the node memory parameters of the local compute node.
[0114] The local compute node parameter update unit is used to update disk write speed parameters and node memory parameters to the configuration item loading template file; wherein, the configuration item loading template file is stored in the default global shared directory of the shared storage;
[0115] The disk write kernel parameter calculation unit is used to: when the data caching proxy module microservice of the local computing node starts, obtain the disk write speed parameters and node memory parameters corresponding to the local computing node from the configuration item loading template file, and calculate and generate the disk write kernel parameter values corresponding to the local computing node according to the preset data write algorithm, so as to ensure that the local computing node performs high-concurrency data caching.
[0116] In a preferred embodiment, the disk kernel parameter calculation unit is further used for:
[0117] The disk writing kernel parameter values corresponding to the local computing node are calculated and generated according to the preset algorithm for data disk writing. The disk writing kernel parameter values include the first percentage of available memory occupied by dirty data that triggers synchronous writing and the second percentage of memory occupied by dirty data that triggers flushing.
[0118] The formula for calculating the first percentage parameter is as follows:
[0119]
[0120]
[0121] The formula for calculating the second percentage parameter is:
[0122]
[0123] Where vm.dirty_ratio is the first percentage parameter, vm.dirty_background_ratio is the second percentage parameter; disk_ws is the disk write speed parameter, and total_mem is the node memory parameter.
[0124] In a preferred embodiment, the caching device further includes a storage volume mounting unit, which is used for:
[0125] When the data caching proxy module microservice starts in each compute node, it mounts the default global shared directory as a storage volume to the container.
[0126] In a preferred embodiment, the local computing node parameter acquisition unit is further configured to:
[0127] Set the disk write speed parameters according to the disk type and network type of the local computing node; wherein, the disk type of the local computing node includes at least one of the following: NVME, SSD, HDD; and the network card type of the local computing node includes at least one of the following: Gigabit Ethernet, 10 Gigabit Ethernet, IB network card.
[0128] In a preferred embodiment, the local computing node parameter acquisition unit is further configured to:
[0129] The disk write speed parameters of the local compute node are obtained by testing with the dd command, and the node memory parameters of the local compute node are obtained by testing with the free command.
[0130] In a preferred embodiment, the caching device further includes a configuration item loading template file storage unit, which is used for:
[0131] The configuration item loading template file is stored in JSON format in the default global shared directory.
[0132] In a preferred embodiment, the caching device further includes a data caching proxy module microservice startup unit, which is used for:
[0133] The data caching proxy module microservice writes files to write the data to be cached to a memory buffer, and then writes the data to be cached from the memory buffer to the local disk.
[0134] For specific limitations on the aforementioned apparatus, please refer to the limitations on the method described above, which will not be repeated here.
[0135] Each module in the aforementioned device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0136] Among them, such as Figure 4As shown, the aforementioned computer device can be a terminal, comprising a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with external terminals via a network connection. The display screen can be an LCD screen or an e-ink display screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the computer device casing, or an external keyboard, touchpad, or mouse, etc.
[0137] It is understood that the structures shown in the above figures are merely block diagrams of some structures related to the present invention and do not constitute a limitation on the computer device to which the present invention is applied. Specific computer devices may include more or fewer components than those shown in the figures, or combine certain components, or have different component arrangements.
[0138] The implementation of all or part of the processes in the methods of the above embodiments can be accomplished by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods.
[0139] Any references to memory, storage, database, or other media used in the embodiments provided in this invention may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.
[0140] It should be noted that the above description is merely a preferred embodiment of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of the present invention, the scope of which is determined by the scope of the appended claims.
Claims
1. A data caching method, characterized in that, The caching method is used to cache data on high-concurrency local computing nodes in an AI cluster, and includes: Set the disk write speed parameters corresponding to the local computing node according to the disk type and network type of the local computing node, and obtain the node memory parameters of the local computing node; The disk write speed parameters and the node memory parameters are updated in the configuration item loading template file; wherein, the configuration item loading template file is stored in the default global shared directory of the shared storage; When the data caching proxy module microservice of the local computing node starts, it obtains the disk write speed parameters and the node memory parameters corresponding to the local computing node from the configuration item loading template file, and calculates and generates the disk write kernel parameter value corresponding to the local computing node according to the data write-to-disk preset algorithm to ensure that the local computing node performs high-concurrency data caching. The caching method further includes: When the data caching proxy module microservice starts in each computing node, the default global shared directory is mounted as a storage volume into the container. The microservice startup of the data caching proxy module on the local computing node specifically includes: The data caching proxy module microservice writes files to write the data to be cached to a memory buffer, and then writes the data to be cached from the memory buffer to the local disk. Specifically, the calculation and generation of the disk-based kernel parameter values corresponding to the local computing node includes: The disk write kernel parameter value corresponding to the local computing node is calculated and generated according to the preset algorithm for data write to disk. The disk write kernel parameter value includes a first percentage parameter of dirty data that triggers synchronous write to occupy available memory and a second percentage parameter of dirty data that triggers flush to occupy memory. The formula for calculating the first percentage parameter is as follows: ; ; The formula for calculating the second percentage parameter is: ; Wherein, vm.dirty_ratio is the first percentage parameter, vm.dirty_background_ratio is the second percentage parameter; disk_ws is the disk write speed parameter, and total_mem is the node memory parameter.
2. The data caching method according to claim 1, characterized in that, Setting the disk write speed parameters corresponding to the local computing node specifically includes: The disk write speed parameters are set according to the disk type and network type of the local computing node; wherein, the disk type of the local computing node includes at least one of the following: NVME, SSD, HDD; and the network card type of the local computing node includes at least one of the following: Gigabit Ethernet, 10 Gigabit Ethernet, IB network card.
3. The data caching method according to claim 1, characterized in that, Based on the disk type and network type of the local computing node, the disk write speed parameters corresponding to the local computing node are set, and the node memory parameters of the local computing node are obtained, specifically including: The disk write speed parameters corresponding to the local computing node are obtained by testing with the dd command, and the node memory parameters corresponding to the local computing node are obtained by testing with the free command.
4. The data caching method according to claim 1, characterized in that, The caching method further includes: The configuration item loading template file is stored in JSON format in the default global shared directory.
5. A data caching device, characterized in that, For implementing the data caching method as described in any one of claims 1-4, the caching device comprises: The local computing node parameter acquisition unit is used to: set the disk write speed parameters corresponding to the local computing node according to the disk type and network type of the local computing node, and acquire the node memory parameters of the local computing node; The local computing node parameter update unit is used to update the disk write speed parameters and the node memory parameters to the configuration item loading template file; wherein the configuration item loading template file is stored in the default global shared directory of the shared storage; The disk write kernel parameter calculation unit is used to: when the data caching proxy module microservice of the local computing node starts, obtain the disk write speed parameters and the node memory parameters corresponding to the local computing node from the configuration item loading template file, and calculate and generate the disk write kernel parameter value corresponding to the local computing node according to the data write-to-disk preset algorithm, so as to ensure that the local computing node performs high-concurrency data caching.
6. A computer device comprising a memory, a processor, and a computer program, wherein the computer program is stored in the memory and can run on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the data caching method as described in any one of claims 1-4.
7. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the data caching method as described in any one of claims 1-4.
Citation Information
Patent Citations
Dynamic data buffer allocation method and apparatus, computer device, and storage medium
CN109542346A
Data caching method and device, equipment and storage medium
CN116303132A
