WO2024077993A1 - Resource allocation method and apparatus, storage medium, and program product - Google Patents

Resource allocation method and apparatus, storage medium, and program product Download PDF

Info

Publication number
WO2024077993A1
WO2024077993A1 PCT/CN2023/100421 CN2023100421W WO2024077993A1 WO 2024077993 A1 WO2024077993 A1 WO 2024077993A1 CN 2023100421 W CN2023100421 W CN 2023100421W WO 2024077993 A1 WO2024077993 A1 WO 2024077993A1
Authority
WO
WIPO (PCT)
Prior art keywords
reserved space
size
space
actual
garbage collection
Prior art date
Application number
PCT/CN2023/100421
Other languages
French (fr)
Chinese (zh)
Inventor
张嘉伟
张
陈俊伟
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2024077993A1 publication Critical patent/WO2024077993A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]

Definitions

  • the present application relates to the field of data storage, and in particular to a resource allocation method, device, storage medium and program product.
  • the two-layer log (log-on-log) structure is currently a mainstream storage system architecture.
  • the storage system of this architecture includes two objects based on the log structure, and each object supports the garbage collection (GC) algorithm to ensure that the storage system can implement a sequential write mechanism.
  • the more common objects are the system layer of software and the device layer of hardware (including solid state disks (SSD)).
  • GC garbage collection
  • SSD solid state disks
  • a certain amount of over-provisioning (OP) is generally set in each of the two objects to serve garbage collection and ensure the performance of the storage system. The larger the reserved space, the more friendly it is to write amplification and the higher the performance of the storage system.
  • the reserved space size of the device layer and system layer of some storage systems is determined after the user purchases them. It will not change during the subsequent operation of the storage system and is not visible to the user. There may be a situation where the reserved space at the system layer is limited, resulting in heavy write pressure, which in turn leads to poor network connection performance from the system layer to the device layer of the storage system.
  • Other storage systems have improved the hardware devices at the device layer, and actively exposed the improved interface to the system layer through the device layer, so that there is almost no reserved space at the device layer.
  • the system layer controls the reserved space allocation of the system layer and the device layer, which in turn increases the size of the reserved space at the system layer.
  • it leaves the management of hardware to software decisions it is necessary to redesign the software stack for hardware devices, resulting in high costs for the entire software stack ecosystem and subsequent operation and maintenance.
  • the configuration mode of the reserved space of the second object can also be dynamically adjusted when the system is running, so that the storage resource allocation mode is more flexible and the impact of write amplification on system performance is reduced. And there is no need to specially design the interface, so there is no need to redesign the software stack for the interface, which can reduce data processing costs and operation and maintenance costs, and optimize user experience.
  • an embodiment of the present application provides a resource allocation method, the method comprising: obtaining the size of the available reserved space of a first object and the size of the available reserved space of a second object; adjusting the size of the actual reserved space of the first object and the size of the actual reserved space of the second object according to characteristic parameters of the user load and type parameters of the garbage collection algorithm.
  • the size of the available reserved space of the first object and the size of the available reserved space of the second object by obtaining the size of the available reserved space of the first object and the size of the available reserved space of the second object, the size of the available reserved space determined by the hardware parameters and actual usage of the first object and the second object can be determined; the size of the actual reserved space of the first object and the size of the actual reserved space of the second object are adjusted according to the characteristic parameters of the user load and the type parameters of the garbage collection algorithm, so that the actual reserved space size of the first object is not limited by the hardware parameters of the first object, and the actual reserved space size of the second object is not limited by the hardware parameters of the first object, and the flexible adjustment of the actual reserved space size is realized at the software level; when the system includes the first object and the second object, the configuration method of the actual reserved space of the second object can also be dynamically adjusted when the system is running, so that the resource allocation method is more flexible; by integrating the characteristic parameters of the user load and the type parameters of the garbage collection algorithm and other factors that affect the
  • the first object and the second object are set in a storage system, the storage system runs the garbage collection algorithm, the first object includes the system layer of the storage system, the second object includes the device layer of the storage system, the available reserved space of the first object includes the hot backup space, the initial reserved space and the unused space in the user-visible space of the system layer; the available reserved space of the second object includes the initial reserved space of the device layer; wherein the hot backup space, the initial reserved space of the system layer and the initial reserved space of the device layer remain unchanged.
  • the resource allocation method of the embodiment of the present application can be applied to a storage system based on a general hardware device. Since there is no need to customize the hardware device, there is no need to design and maintain the corresponding software stack, which can reduce the dependence of the resource allocation method on the hardware device and improve the universality of the resource allocation method. Under the premise of specific system-level software configuration and device-level hardware configuration, the network connection between different objects in the storage system can maintain good performance, improve the utilization of the device-level space, reduce write amplification, extend the life of the device-level hardware, and reduce costs.
  • the first object and the second object are set in a storage system, the storage system runs the garbage collection algorithm, the first object includes the system layer of the storage system, the second object includes the application layer of the storage system, the available reserved space of the first object includes the hot backup space, the initial reserved space and the unused space in the user-visible space of the system layer; the available reserved space of the second object includes the initial reserved space of the application layer; wherein the hot backup space and the initial reserved space of the system layer remain unchanged.
  • the resource allocation method of the embodiment of the present application can be applied to any storage system with a double-layer log structure, which can further improve the universality of the resource allocation method and expand the application scenarios of the resource allocation method.
  • the method before adjusting the size of the actual reserved space of the first object and the size of the actual reserved space of the second object according to the characteristic parameters of the user load and the type parameters of the garbage collection algorithm, the method also includes: determining the user input/output access objects and frequency within a preset time window; sorting the access objects according to the frequency and constructing a statistical histogram; based on the statistical histogram, determining the linear relationship between the frequency and the sorting sequence number of the access objects; determining the characteristic parameters of the user load according to the slope of the linear relationship.
  • the characteristic parameters of the user load can be determined in real time.
  • the characteristic parameters of the user load can be determined at any time before or during the operation of the system, which will not affect the normal operation of the storage system, and is convenient for users to determine the user load situation. It also provides the possibility of adjusting the size of the actual reserved space of the first object and the size of the actual reserved space of the second object using the characteristic parameters of the user load.
  • adjusting the size of the actual reserved space of the first object and the size of the actual reserved space of the second object according to the characteristic parameters of the user load and the type parameters of the garbage collection algorithm includes: selecting a configuration method that matches the sum of the spaces of the size of the available reserved space of the first object and the size of the available reserved space of the second object, the characteristic parameters and the type parameters from a plurality of pre-set configuration methods of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object as the optimal configuration method; and adjusting the size of the actual reserved space of the first object and the size of the actual reserved space of the second object according to the optimal configuration method.
  • the best configuration method can be quickly determined during system operation, thereby improving the efficiency from obtaining the available reserved space size of the first object and the available reserved space size of the second object to adjusting the actual reserved space size of the first object and the actual reserved space size of the second object.
  • the method also includes: determining a value range of the total space according to the hot backup space, the initial reserved space, the user visible space, and the available reserved space of the second object; for each numerical value in the value range of the total space, determining multiple division methods of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object under the numerical value; determining multiple configuration methods of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object according to multiple characteristic parameters of the user load, multiple types of parameters of the garbage collection algorithm, the total space, and the multiple division methods.
  • the multiple configuration manners of determining the size of the actual reserved space of the first object and the size of the actual reserved space of the second object according to the multiple characteristic parameters of the user load, the multiple type parameters of the garbage collection algorithm, the space sum, and the multiple division methods include: determining multiple combinations of the characteristic parameters, the type parameters, and the space sum according to the multiple characteristic parameters of the user load, the multiple type parameters of the garbage collection algorithm, and the space sum, wherein at least one of the characteristic parameters, the type parameters, and the space sum in different combinations is different; for each combination of the characteristic parameters, the type parameters, and the space sum, respectively determining the write amplification factor of each division method of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object; determining the division method of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object corresponding to the smallest write amplification factor in each combination as
  • adjusting the size of the actual reserved space of the first object and the size of the actual reserved space of the second object according to the optimal configuration mode includes at least one of the following: lowering a watermark parameter of the garbage collection algorithm, and the garbage collection algorithm is started when the value of the watermark parameter is greater than the size of the actual reserved space of the first object; increasing a speed parameter of the garbage collection algorithm, and the speed parameter indicates the garbage collection speed when the storage system executes the garbage collection algorithm; and reducing the startup delay of the garbage collection algorithm.
  • the storage system can complete the adjustment of the actual reserved space of the first object and the second object as soon as possible, reducing the time required for the storage system to adapt to the new configuration mode and improving the performance of the storage system.
  • the adjustment method is more flexible.
  • adjusting the size of the actual reserved space of the first object and the size of the actual reserved space of the second object according to the optimal configuration mode includes at least one of the following: increasing a waterline parameter of the garbage collection algorithm, and the garbage collection algorithm is started when the value of the waterline parameter is greater than the size of the actual reserved space of the first object; reducing a speed parameter of the garbage collection algorithm, and the speed parameter indicates the garbage collection speed when the storage system executes the garbage collection algorithm; and increasing the startup delay of the garbage collection algorithm.
  • the storage system can complete the adjustment of the actual reserved space of the first object and the second object as soon as possible, reducing the time required for the storage system to adapt to the new configuration mode and improving the performance of the storage system.
  • the adjustment method is more flexible.
  • an embodiment of the present application provides a resource allocation device, comprising: an acquisition module for acquiring the size of an available reserved space of a first object and the size of an available reserved space of a second object; an adjustment module for adjusting the size of an actual reserved space of the first object and the size of an actual reserved space of the second object according to characteristic parameters of a user load and type parameters of a garbage collection algorithm.
  • the first object and the second object are set in a storage system, the storage system runs the garbage collection algorithm, the first object includes the system layer of the storage system, the second object includes the device layer of the storage system, the available reserved space of the first object includes the hot backup space, the initial reserved space and the unused space in the user-visible space of the system layer; the available reserved space of the second object includes the initial reserved space of the device layer; wherein the hot backup space, the initial reserved space of the system layer and the initial reserved space of the device layer remain unchanged.
  • the first object and the second object are set in a storage system, the storage system runs the garbage collection algorithm, the first object includes the system layer of the storage system, the second object includes the application layer of the storage system, the available reserved space of the first object includes the hot backup space, the initial reserved space and unused space in the user-visible space of the system layer; the available reserved space of the second object includes the initial reserved space of the application layer; wherein the hot backup space and the initial reserved space of the system layer remain unchanged.
  • the device in a third possible implementation of the resource allocation device, also includes: a first determination module, used to determine the user input/output access objects and frequency within a preset time window; a construction module, used to sort the access objects according to the frequency and construct a statistical histogram; a second determination module, used to determine the linear relationship between the frequency and the sorting sequence number of the access object based on the statistical histogram; a third determination module, used to determine the characteristic parameters of the user load according to the slope of the linear relationship.
  • a first determination module used to determine the user input/output access objects and frequency within a preset time window
  • a construction module used to sort the access objects according to the frequency and construct a statistical histogram
  • a second determination module used to determine the linear relationship between the frequency and the sorting sequence number of the access object based on the statistical histogram
  • a third determination module used to determine the characteristic parameters of the user load according to the slope of the linear relationship.
  • the adjustment module includes: a selection unit, used to select a configuration method that matches the sum of the space of the available reserved space of the first object and the size of the available reserved space of the second object, the characteristic parameters, and the type parameters from a plurality of pre-set configuration methods of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object as the optimal configuration method; an adjustment unit, used to adjust the size of the actual reserved space of the first object and the size of the actual reserved space of the second object according to the optimal configuration method.
  • the device also includes: a fourth determination module, used to determine the value range of the total space according to the hot backup space, the initial reserved space, the user visible space, and the available reserved space of the second object; a fifth determination module, used to determine, for each value in the value range of the total space, multiple division methods of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object under the value; a sixth determination module, used to determine multiple configuration methods of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object according to multiple characteristic parameters of the user load, multiple types of parameters of the garbage collection algorithm, the total space, and the multiple division methods.
  • the sixth determination module includes: a first determination unit, used to determine multiple combinations of the characteristic parameters, the type parameters, and the space sum according to multiple characteristic parameters of the user load, multiple type parameters of the garbage collection algorithm, and the space sum, wherein at least one of the characteristic parameters, the type parameters, and the space sum in different combinations is different; a second determination unit, used to determine the write amplification factor of each division method of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object for each combination of the characteristic parameters, the type parameters, and the space sum; a third determination unit, used to determine the division method of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object corresponding to the smallest write amplification factor in each combination as a configuration method of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object.
  • adjusting the size of the actual reserved space of the first object and the size of the actual reserved space of the second object according to the optimal configuration mode includes at least one of the following: lowering a watermark parameter of the garbage collection algorithm, and the garbage collection algorithm is started when the value of the watermark parameter is greater than the size of the actual reserved space of the first object; increasing a speed parameter of the garbage collection algorithm, and the speed parameter indicates the garbage collection speed when the storage system executes the garbage collection algorithm; and reducing the startup delay of the garbage collection algorithm.
  • adjusting the size of the actual reserved space of the first object and the size of the actual reserved space of the second object according to the optimal configuration mode includes at least one of the following: increasing a waterline parameter of the garbage collection algorithm, and the garbage collection algorithm is started when the value of the waterline parameter is greater than the size of the actual reserved space of the first object; reducing a speed parameter of the garbage collection algorithm, and the speed parameter indicates the garbage collection speed when the storage system executes the garbage collection algorithm; and increasing the startup delay of the garbage collection algorithm.
  • an embodiment of the present application provides a resource allocation device, comprising: a processor; a memory for storing processor executable instructions; wherein the processor is configured to implement the resource allocation method of the above-mentioned first aspect or one or more of the multiple possible implementation methods of the first aspect when executing the instructions.
  • an embodiment of the present application provides a non-volatile computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, implement the resource allocation method of the above-mentioned first aspect or one or more of the multiple possible implementation methods of the first aspect.
  • an embodiment of the present application provides a computer program product, comprising a computer-readable code, or a non-volatile computer-readable storage medium carrying a computer-readable code.
  • the processor in the electronic device executes the resource allocation method of the above-mentioned first aspect or one or several of the multiple possible implementation methods of the first aspect.
  • FIG1 shows a schematic diagram of a typical two-layer log structure storage system.
  • FIG. 2 shows an example of a method for allocating reserved space at the system layer and the device layer of a two-layer log structure storage system.
  • FIG. 3 a shows an exemplary application scenario of the resource allocation method according to an embodiment of the present application.
  • FIG. 3 b shows an exemplary application scenario of the resource allocation method according to an embodiment of the present application.
  • FIG4 is a schematic diagram showing a process of a resource allocation method according to an embodiment of the present application.
  • FIG5 is a schematic diagram showing a method for obtaining characteristic parameters of a user load according to an embodiment of the present application.
  • FIG. 6 shows an example of a functional relationship between a write amplification factor of a single object and a reserved space size according to an embodiment of the present application.
  • FIG. 7 shows an example of a functional relationship between a write amplification factor of a storage system and reserved space sizes of two objects according to an embodiment of the present application.
  • FIG. 8 is a schematic diagram showing how to adjust the size of the actual reserved space of the first object and the size of the actual reserved space of the second object according to an embodiment of the present application.
  • FIG. 9 is a schematic diagram showing the structure of a resource allocation device according to an embodiment of the present application.
  • FIG. 10 shows an exemplary structural diagram of a resource allocation device according to an embodiment of the present application.
  • FIG1 shows a schematic diagram of a typical two-layer log structure storage system.
  • the storage system includes two log-structured objects, namely the system layer and the device layer.
  • Each object supports the garbage collection algorithm to ensure that the storage system can implement a sequential write mechanism.
  • This mechanism will cause write amplification, also known as write amplification, that is, the actual amount of physical data written is multiple times the theoretical value of the amount of data written. The reason is that, assuming that an 8KB data is to be written, but there is no free space at this time, but there is invalid data that can be erased, and the erasure is in blocks, so it is necessary to first write a block of data to the cache space or reserved space, then erase the block, and then write the 8KB new data.
  • a certain amount of over-provisioning is generally set in the two objects to serve garbage collection and ensure the performance of the storage system.
  • the space at the system layer is mainly used to store the garbage collection algorithm, user data, metadata at the system layer, and the garbage collection algorithm for serving the system layer.
  • the part used to serve the garbage collection algorithm at the system layer can be called the reserved space at the system layer.
  • the space at the device layer is mainly used to store the garbage collection algorithm, host data, metadata at the device layer, and the space used to serve the garbage collection algorithm at the device layer.
  • the part used to serve the garbage collection algorithm at the device layer can be called the reserved space at the device layer. The larger the reserved space, the more friendly it is to write amplification and the higher the system performance, but it also brings the problem of high cost.
  • FIG. 2 shows an example of a reserved space allocation method for the system layer and the device layer of a dual-layer log structure storage system.
  • a fixed reserved space is set for the system layer and the device layer respectively according to user requirements.
  • the space of the device layer may include the device visible space and the fixed reserved space of the device layer.
  • the space of the system layer may include the system visible space, the disk array, the hot backup space and the fixed reserved space of the system layer.
  • the size of the device visible space is the same as the size of the space of the system layer.
  • the system visible space and the disk array are also visible to the user, so the sum of the system visible space and the disk array is also equal to the user visible space of the user layer.
  • the maximum value of its available reserved space is equal to the size of the fixed reserved space of the device layer.
  • the maximum value of its available reserved space is equal to the sum of the hot backup space and the fixed reserved space of the system layer.
  • MS-SSD multi-stream solid state disk
  • O-SSD open channel solid state disk
  • ZNS-SSD zone namespaces solid state disk
  • the erase logic of the device layer partition is controlled by the system layer on the host side, so that the internal management of the SSD is controlled by the system layer, thereby eliminating the write amplification effect of garbage collection of the SSD and reducing the fixed reserved space on the SSD side.
  • the customized hardware device itself provides a specially customized interface and exposes it to the system layer to achieve the goal of reducing the fixed reserved space, which is not applicable to general hardware devices. Therefore, the dependence on hardware is too strong and the interface is not universal.
  • the management of the underlying hardware is handed over to the upper layer for decision-making, which requires the redesign of the software stack of the system layer.
  • the software stack has high ecological costs and subsequent maintenance costs, and the user's operation is complicated, which is extremely unfriendly to users.
  • the configuration mode of the reserved space of the second object can also be dynamically adjusted when the system is running, so that the storage resource allocation mode is more flexible and the impact of write amplification on system performance is reduced. And there is no need to specially design the interface, so there is no need to redesign the software stack for the interface, which can reduce data processing costs and operation and maintenance costs and optimize user experience.
  • FIG. 3a and FIG. 3b respectively illustrate an exemplary application scenario of the resource allocation method according to an embodiment of the present application.
  • the resource allocation method of an embodiment of the present application can be applied to a storage system with a double-layer log structure.
  • the storage system may include two objects based on the log structure. Both objects are append-sequential write mechanisms and both require space to be freed up through garbage collection. Therefore, a garbage collection algorithm is provided.
  • the two objects may be a system layer and a device layer, respectively.
  • the device layer may include a general solid-state hard disk, and the storage system may be a double-layer log structure storage system based on a solid-state hard disk.
  • the system layer may include a system-visible space, a disk array (the sum of the system-visible space and the disk array is the user-visible space), a hot backup space, and an initial reserved space, wherein the hot backup space of the system layer may be, for example, the hot backup space of the system layer in FIG. 2, the initial reserved space may be the fixed reserved space of the system layer in FIG. 2, and the user-visible space may be the system-visible space and the disk array of the system layer in FIG. 2.
  • One or more of the system-visible space, the disk array, and the hot backup space can be used to store garbage collection algorithms, user data, metadata, etc.
  • the solid-state hard disk of the device layer may include a device-visible space and an initial reserved space, and the initial reserved space of the device layer may be, for example, the fixed reserved space of the device layer in FIG. 2.
  • the device-visible space can be used to store garbage collection algorithms, user data, metadata, etc.
  • the initial reserved space of the system layer, the hot backup space, and the unused portion of the user-visible space are collectively used as the available reserved space of the system layer.
  • the initial reserved space of the device layer is used as the available reserved space of the device layer.
  • the total space of the available reserved space of the system layer and the device layer (hereinafter referred to as the total space) is shared and allocated to the system layer and the device layer according to the requirements of the application scenarios during system operation to serve the garbage collection algorithms of the system layer and the device layer.
  • the two objects may be a system layer and an application layer, respectively.
  • the application layer may include a key-value separated log structure application
  • the storage system may be a two-layer log structure file system, such as a flash friendly file-system (F2FS).
  • the system layer may include a system visible space, a disk array (the sum of the system visible space and the disk array is the user visible space), a hot backup space, and an initial reserved space, wherein the hot backup space of the system layer may be, for example, the hot backup space of the system layer in FIG2, the initial reserved space may be the fixed reserved space of the system layer in FIG2, and the user visible space may be the system visible space and the disk array of the system layer in FIG2.
  • One or more of the system visible space, the disk array, and the hot backup space may be used to store garbage collection algorithms, user data, metadata, etc.
  • the application layer may include an application visible space and an initial reserved space.
  • the application visible space may be used to store garbage collection algorithms, application data, metadata, etc.
  • the initial reserved space of the system layer, the hot backup space, and the unused portion of the user-visible space are collectively used as the available reserved space of the system layer.
  • the initial reserved space of the application layer is used as the available reserved space of the application layer.
  • the total space of the reserved space of the system layer and the application layer (hereinafter referred to as the total space) is shared and allocated to the system layer and the application layer according to the requirements of the application scenario during system operation to serve the garbage collection algorithms of the system layer and the application layer.
  • the storage system shown in Figures 3a and 3b can be set on a terminal device or a server.
  • the terminal device of the present application can be a smart phone, a netbook, a tablet computer, a laptop computer, a wearable electronic device (such as a smart bracelet, a smart watch, etc.), a TV, a virtual reality device, a speaker, electronic ink, etc.
  • FIG4 is a schematic diagram showing a process of a resource allocation method according to an embodiment of the present application.
  • the present application proposes a resource allocation method, the method comprising steps S41-S42:
  • Step S41 obtaining the size of the available reserved space of the first object and the size of the available reserved space of the second object.
  • the first object and the second object can be log-structured objects included in the system (such as the storage system described above).
  • the first object may include a system layer
  • the second object may include a device layer or an application layer.
  • the available reserved space can be determined based on the hardware parameters and actual usage of the object, and the sum of the space allowed to be used for garbage collection on the object at the current moment.
  • the size of the available reserved space of the first object and the size of the available reserved space of the second object can be added to obtain the total space.
  • the total space can be shared by the first object and the second object, and is the resource to be allocated to the first object and the second object in an embodiment of the present application.
  • Step S42 adjusting the size of the actual reserved space of the first object and the size of the actual reserved space of the second object according to the characteristic parameters of the user load and the type parameters of the garbage collection algorithm.
  • the characteristic parameters of the user load can indicate the user load situation, and the size of the reserved space required under different user loads may be different.
  • the specific acquisition method can be found in the following text and the relevant descriptions of Figures 5-7.
  • the type parameter of the garbage collection algorithm can be determined based on the system's configuration information for the garbage collection algorithm, and can be obtained through the interface provided by two objects.
  • the acquisition method can be implemented based on the existing technology and will not be repeated here.
  • the sum of the space is allocated to the space of the first object and the second object as the actual reserved space of the first object and the actual reserved space of the second object, respectively, wherein there can be multiple allocation methods, and the performance of the storage system may be different under each allocation method.
  • the size of the actual reserved space of the first object and the size of the actual reserved space of the second object can be adjusted.
  • the adjusted size of the available reserved space of the first object and the size of the available reserved space of the second object can be the most suitable for the current system, thereby improving the performance of the system.
  • the size of the available reserved space of the first object and the size of the available reserved space of the second object by obtaining the size of the available reserved space of the first object and the size of the available reserved space of the second object, the size of the available reserved space determined by the hardware parameters and actual usage of the first object and the second object can be determined; the size of the actual reserved space of the first object and the size of the actual reserved space of the second object are adjusted according to the characteristic parameters of the user load and the type parameters of the garbage collection algorithm, so that the actual reserved space size of the first object is not limited by the hardware parameters of the first object, and the actual reserved space size of the second object is not limited by the hardware parameters of the first object, and the flexible adjustment of the actual reserved space size is realized at the software level; when the system includes the first object and the second object, the configuration method of the actual reserved space of the second object can also be dynamically adjusted when the system is running, so that the resource allocation method is more flexible; by integrating the characteristic parameters of the user load and the type parameters of the garbage collection algorithm and other factors that affect the
  • the following describes how to determine the available reserved space of the second object when the second object is different.
  • the first object and the second object are set in a storage system, and the storage system runs the garbage collection algorithm.
  • the first object includes a system layer of the storage system
  • the second object includes a device layer of the storage system.
  • the available reserved space of the first object includes the hot backup space of the system layer, the initial reserved space, and the unused space in the user visible space;
  • the available reserved space of the second object includes the initial reserved space of the device layer
  • the hot backup space and the initial reserved space of the system layer and the initial reserved space of the device layer remain unchanged.
  • the storage system can include general hardware devices, such as general solid-state drives, without using customized hardware devices, such as the multi-stream solid-state drive MS-SSD, open channel solid-state drive OC-SSD, partition namespace solid-state drive ZNS-SSD, etc. mentioned above.
  • general hardware devices such as general solid-state drives
  • customized hardware devices such as the multi-stream solid-state drive MS-SSD, open channel solid-state drive OC-SSD, partition namespace solid-state drive ZNS-SSD, etc. mentioned above.
  • the available reserved space of the first object may include the hot backup space of the system layer, the initial reserved space, and the unused space in the user-visible space.
  • the hot backup space and the initial reserved space of the system layer may be set before the system is run, and therefore may be fixed.
  • the variable part lies in the size of the unused space in the user-visible space of the system layer.
  • the hot backup space of the system layer may be, for example, the hot backup space of the system layer in Figure 2
  • the initial reserved space may be the fixed reserved space of the system layer in Figure 2
  • the user-visible space may be the system-visible space and disk array of the system layer in Figure 2.
  • the available reserved space of the second object may include the initial reserved space of the device layer.
  • the initial reserved space of the device layer may be set before the system is run, and thus may be fixed. In this case, the available reserved space of the second object may also be fixed.
  • the initial reserved space of the device layer may be, for example, the fixed reserved space of the device layer in FIG. 2.
  • step S41 the size of the available reserved space of the first object needs to be obtained in real time, while the size of the available reserved space of the second object can be obtained once when step S41 is executed for the first time or before the system runs.
  • the size of the available reserved space of the second object needs to be obtained subsequently, the size of the available reserved space of the second object that has been obtained can be directly used.
  • the resource allocation method of the embodiment of the present application can be applied to a storage system based on a general hardware device. Since there is no need to customize the hardware device, there is no need to design and maintain the corresponding software stack, which can reduce the dependence of the resource allocation method on the hardware device and improve the universality of the resource allocation method. Under the premise of specific system-level software configuration and device-level hardware configuration, the network connection between different objects in the storage system can maintain good performance, improve the utilization of the device-level space, reduce write amplification, extend the life of the device-level hardware, and reduce costs.
  • the first object and the second object are set in a storage system, and the storage system runs the garbage collection algorithm.
  • the first object includes a system layer of the storage system
  • the second object includes an application layer of the storage system.
  • the available reserved space of the first object includes the hot backup space of the system layer, the initial reserved space, and the unused space in the user visible space;
  • the available reserved space of the second object includes the initial reserved space of the application layer
  • the hot backup space and the initial reserved space of the system layer remain unchanged.
  • the available reserved space of the first object can include the hot backup space of the system layer (such as the hot backup space of the system layer in Figure 2), the initial reserved space (such as the fixed reserved space of the system layer in Figure 2), and the unused space in the user-visible space (such as the system-visible space and disk array of the system layer in Figure 2).
  • the hot backup space and the initial reserved space of the system layer can be set before the system is run, and therefore can be fixed.
  • the variable part lies in the size of the unused space in the user-visible space of the system layer.
  • the available reserved space of the second object may include the initial reserved space of the application layer.
  • the initial reserved space of the application layer may be set before the system is run and remain unchanged during the system operation.
  • the available reserved space of the second object may also be fixed.
  • the initial reserved space of the application layer may also be set to be variable according to user needs during the system operation.
  • the variable part is the real-time size of the initial reserved space of the application layer.
  • the initial reserved space of the application layer can be seen in the example in Figure 3b.
  • step S41 the size of the available reserved space of the first object needs to be obtained in real time, and the size of the available reserved space of the second object can be obtained according to the system settings. If the initial reserved space of the application layer is fixed, the size of the available reserved space of the second object only needs to be obtained once when step S41 is executed for the first time or before the system runs. When the size of the available reserved space of the second object needs to be obtained subsequently, the size of the available reserved space of the second object that has been obtained can be directly used; if the size of the available reserved space of the second object is variable, the size of the available reserved space of the second object also needs to be obtained in real time.
  • the resource allocation method of the embodiment of the present application can be applied to any storage system with a double-layer log structure, which can further improve the universality of the resource allocation method and expand the application scenarios of the resource allocation method.
  • the hardware storage device corresponding to the available reserved space may have some bad blocks, and it can be considered that the space corresponding to the bad blocks is occupied and cannot be erased.
  • the available reserved space of the first object and the second object may change. Since bad blocks may appear at any time during the operation of the system, in order to make the determined optimal configuration method more accurate, the size of the available reserved space of the first object and the size of the available reserved space of the second object may be obtained once each time step S41 is executed.
  • the present application does not limit the frequency of obtaining the size of the available reserved space of the first object and the size of the available reserved space of the second object.
  • Fig. 5 is a schematic diagram of a method for obtaining characteristic parameters of user load according to an embodiment of the present application.
  • the method further includes:
  • the characteristic parameter of the user load is determined according to the slope of the linear relationship.
  • the user may generate multiple input/output access requests.
  • the user input/output access object and frequency within the preset time window can be determined.
  • the access objects can be ABCDEBDC, then the access objects can include A, B, C, D, E, and the frequency of each access object can be access A frequency: 1, access B frequency: 2, access C frequency: 2, access D frequency: 2, access E frequency: 1.
  • the preset time window can be set according to user needs, and this application does not limit the setting method of the preset time window.
  • a statistical histogram By sorting the access objects according to the frequency, a statistical histogram can be constructed.
  • the horizontal axis of the statistical histogram can be the sorting number of the access object, and the vertical axis can be the value of the frequency.
  • the order of the access objects is B, C, D (all 2 times), A, E (all 1 time), where the order between B, C, D can be randomly determined, and the order between A and E can be randomly determined.
  • the horizontal axis of the obtained statistical histogram can be B, C, D, A, E, and the vertical axis can be the access frequency corresponding to these access objects. Based on the statistical histogram, the linear relationship between the frequency and the sorting number of the access object can be determined.
  • the logarithm of the frequency and the sorting number of the access object can be taken respectively, and then the linear relationship of the logarithm can be determined.
  • the characteristic parameters of the user load can be determined in real time.
  • the characteristic parameters of the user load can be determined at any time before or during the operation of the system, which will not affect the normal operation of the storage system, and is convenient for users to determine the user load situation. It also provides the possibility of adjusting the size of the actual reserved space of the first object and the size of the actual reserved space of the second object using the characteristic parameters of the user load.
  • step S42 The following describes an exemplary method for adjusting the size of the actual reserved space of the first object and the size of the actual reserved space of the second object (step S42) according to characteristic parameters of the user load and type parameters of the garbage collection algorithm according to an embodiment of the present application.
  • step S42 includes:
  • the size of the actual reserved space of the first object and the size of the actual reserved space of the second object are adjusted.
  • the pre-set configuration mode includes the configuration mode of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object that achieves the best performance of the storage system under each combination of the sum of space, characteristic parameters, and type parameters. That is, the configuration mode that matches the sum of space, characteristic parameters, and type parameters of the size of the available reserved space of the first object and the size of the available reserved space of the second object may be the best configuration mode of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object.
  • the configuration method that matches the space sum, the characteristic parameter, and the type parameter can be M1; N1.
  • the size of the actual reserved space of the first object is M1, and the size of the actual reserved space of the second object is N1.
  • adjust the size of the actual reserved space of the first object and the size of the actual reserved space of the second object adjust the size of the actual reserved space of the first object to M1, and adjust the size of the actual reserved space of the second object to N1.
  • Its exemplary implementation method can be referred to the relevant description below and Figure 8.
  • the best configuration method can be quickly determined during system operation, thereby improving the efficiency from obtaining the available reserved space size of the first object and the available reserved space size of the second object to adjusting the actual reserved space size of the first object and the actual reserved space size of the second object.
  • the following describes an exemplary method for determining the size of the actual reserved space of the first object and the size of the actual reserved space of the second object in various configuration modes according to an embodiment of the present application.
  • the method further includes:
  • the multiple types of parameters of the garbage collection algorithm, the total space and the multiple division methods, multiple configuration methods of the actual reserved space size of the first object and the actual reserved space size of the second object are determined.
  • the value range of the total space can be determined based on the hot backup space, the initial reserved space, the user-visible space, and the available reserved space of the second object.
  • the user load can have multiple characteristic parameters
  • the garbage collection algorithm can have multiple types of parameters.
  • the storage system performance is related to the characteristic parameters of the user load, the type parameters of the garbage collection algorithm, the size of the actual reserved space of the first object, and the size of the actual reserved space of the second object. Therefore, based on the multiple characteristic parameters of the user load, the multiple types of parameters of the garbage collection algorithm, the total space, and multiple division methods, all possible resource allocation methods of the storage system can be enumerated, and the system performance corresponding to each resource allocation method can be determined.
  • the resource allocation method with the best performance can be selected to determine the configuration method of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object.
  • the multiple configuration methods of determining the size of the actual reserved space of the first object and the size of the actual reserved space of the second object according to the multiple characteristic parameters of the user load, the multiple type parameters of the garbage collection algorithm, the total space, and the multiple division methods include:
  • a division method of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object corresponding to the minimum write amplification factor in each combination method is determined as a configuration method of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object.
  • various combinations of characteristic parameters, type parameters, and the total space can be determined. For any combination of characteristic parameters, type parameters, and the total space, when different combinations of the size M of the actual reserved space of the first object and the size N of the actual reserved space of the second object are used, the system performance may be different. The combination of M and N with the best performance can be screened out as the optimal configuration method of the size M of the actual reserved space of the first object and the size N of the actual reserved space of the second object under the combination of characteristic parameters, type parameters, and the total space.
  • the optimal configuration method of the size M of the actual reserved space of the first object and the size N of the actual reserved space of the second object under each combination is found, thereby realizing multiple configuration methods of determining the size of the actual reserved space of the first object and the size of the actual reserved space of the second object.
  • the performance of the system can be reflected by the write amplification factor (WAF).
  • WAF write amplification factor
  • the write amplification factor is a parameter that characterizes the degree of write amplification.
  • the determination method of the write amplification factor can be implemented based on the existing technology and will not be repeated here.
  • the write amplification factor has a logarithmic function-like relationship with the garbage collection algorithm, the reserved space size, the user load, etc.
  • FIG6 shows an example of a functional relationship between the write amplification factor and the reserved space size of a single object according to an embodiment of the present application. As shown in FIG6, the larger the reserved space, the smaller the corresponding write amplification factor, indicating that the object performance is better.
  • the write amplification factor at the system level and the reserved space size of the two objects can present a convex function relationship.
  • Figure 7 shows an example of the functional relationship between the write amplification factor of the storage system according to an embodiment of the present application and the reserved space size of the two objects.
  • the reserved space size of the two objects corresponding to the minimum value of the write amplification factor i.e., the size M of the actual reserved space of the first object and the size N of the actual reserved space of the second object
  • Table 1 shows an example of multiple configuration methods for the size of the actual reserved space of the first object and the size of the actual reserved space of the second object determined in an embodiment of the present application.
  • the characteristic parameters of the user load include ⁇ 1, etc.
  • the space sum includes R1 and R2, etc.
  • the type parameters of the garbage collection algorithm include GC Algor1, GC Algor2, etc.
  • the optimal configuration method of the actual reserved space size of the first object and the actual reserved space size of the second object can be M2; N2, under the combination of characteristic parameter ⁇ 1, type parameter GC Algor2, and total reserved space R1, the optimal configuration method of the actual reserved space size of the first object and the actual reserved space size of the second object can be M3; N3, under the combination of characteristic parameter ⁇ 1, type parameter GC Algor2, and total reserved space R2, the optimal configuration method of the actual reserved space size of the first object and the actual reserved space size of the second object can be M4; N4.
  • the optimal configuration of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object can also be reflected by using other features.
  • the value of the size of the actual reserved space of the first object is M1
  • the value of the size of the actual reserved space of the second object is N1.
  • the proportional relationship M1:N1 between the two can be determined based on M1 and N1, and M1:N1 can be stored in the table as a configuration method. This application does not limit the specific storage method of the configuration method.
  • the quality of system performance can also be characterized by using other parameters besides the write amplification factor, and the present application does not limit the specific method of combining the size of the actual reserved space of the first object with the best screening performance and the size of the actual reserved space of the second object.
  • the following describes an exemplary method for adjusting the size of the actual reserved space of the first object and the size of the actual reserved space of the second object according to the optimal configuration mode in an embodiment of the present application.
  • Fig. 8 shows a schematic diagram of adjusting the size of the actual reserved space of the first object and the size of the actual reserved space of the second object according to an embodiment of the present application.
  • the size of the available reserved space of the system layer i.e., the available reserved space of the first object
  • the size of the available reserved space of the device layer i.e., the available reserved space of the second object
  • the initial reserved space i.e., the available reserved space of the second object
  • the total space is equal to the sum of the hot backup space, the initial reserved space (reserved space 1) of the system layer, and the initial reserved space (reserved space 2) of the device layer.
  • the left half of the dotted line represents the size of the actual reserved space at the system layer (i.e., the actual reserved space of the first object), and the right half of the dotted line represents the size of the actual reserved space at the device layer (i.e., the actual reserved space of the second object). If the dotted line moves to the left, it means that the size of the actual reserved space of the first object increases, while the size of the actual reserved space of the second object decreases; if the dotted line moves to the right, it means that the size of the actual reserved space of the first object decreases, while the size of the actual reserved space of the second object increases.
  • adjusting the size of the actual reserved space of the first object and the size of the actual reserved space of the second object according to the optimal configuration mode includes at least one of the following:
  • the speed parameter indicating a garbage collection speed when the storage system executes the garbage collection algorithm
  • the actual reserved space of the first object indicated by the optimal configuration is smaller than the size of the actual reserved space of the first object at the current moment (i.e., the size of the actual reserved space of the first object is reduced, and the size of the actual reserved space of the second object is increased), it can be considered that less actual reserved space needs to be allocated to the first object. In other words, the garbage collection process needs to be accelerated for the first object.
  • the actual reserved space of the first object and the second object can be adjusted in at least one of the following ways.
  • Method one may be to lower the watermark parameter of the garbage collection algorithm.
  • the watermark parameter indicates the maximum capacity of the first object to store data. Therefore, when the size of the actual reserved space of the first object is greater than the value of the watermark parameter, it can be considered that the first object still has margin for new data to be written; when the size of the actual reserved space of the first object is equal to the value of the watermark parameter, it can be considered that the margin of the first object is exactly 0; when the size of the actual reserved space of the first object is less than the value of the watermark parameter, the data needs to be erased, that is, the garbage collection algorithm needs to be started when the value of the watermark parameter is greater than the size of the actual reserved space of the first object. Once the garbage collection algorithm is started, garbage collection can be performed, so that the size of the actual reserved space of the first object gradually increases until it reaches the size of the actual reserved space of the first object indicated by the optimal configuration method.
  • the second method may be to increase the speed parameter of the garbage collection algorithm.
  • the speed parameter indicates the garbage collection speed when the storage system executes the garbage collection algorithm. Therefore, the larger the speed parameter, the faster the garbage collection speed, that is, accelerated data erasure is achieved, so that the storage system, especially the first object, can adapt to the new configuration mode as soon as possible.
  • the third method is to reduce the startup delay of the garbage collection algorithm. There may be a certain startup delay from receiving the startup instruction to the actual startup of the garbage collection algorithm. By reducing this startup delay, garbage collection can also be accelerated, so that the storage system, especially the first object, can adapt to the new configuration mode as soon as possible.
  • the second object can adaptively adjust the size of the actual reserved space of the second object based on the existing technology, which will not be described in detail here.
  • the above method does not require changing the size of the hot backup space, the initial reserved space, etc., but instead adjusts the actual reserved space size of the first object and the second object by adjusting the waterline parameters, speed parameters, or startup delay. In other words, the space (actual reserved space) that can be used for garbage collection of the first object and the second object in actual use is adjusted.
  • the storage system can complete the adjustment of the actual reserved space of the first object and the second object as soon as possible, reducing the time required for the storage system to adapt to the new configuration mode and improving the performance of the storage system.
  • the adjustment method is more flexible.
  • adjusting the size of the actual reserved space of the first object and the size of the actual reserved space of the second object according to the optimal configuration includes at least one of the following:
  • the speed parameter indicating a garbage collection speed when the storage system executes the garbage collection algorithm
  • the actual reserved space of the first object and the second object can be adjusted according to the size of the actual reserved space of the first object indicated by the optimal configuration and the size of the actual reserved space of the second object. If the size of the actual reserved space of the first object indicated by the optimal configuration is larger than the size of the actual reserved space of the first object at the current moment (that is, the size of the actual reserved space of the first object increases, and the size of the actual reserved space of the second object decreases), it can be considered that more reserved space resources need to be allocated to the first object. That is, for the first object, the garbage collection process needs to be slowed down. In this case, at least one of the following methods can be used to adjust the actual reserved space of the first object and the second object.
  • Method 1 may be to increase the waterline parameter of the garbage collection algorithm.
  • the garbage collection algorithm needs to be started when the value of the waterline parameter is greater than the size of the actual reserved space of the first object, and the size of the actual reserved space of the first object indicated by the optimal configuration method is larger than the size of the actual reserved space of the first object at the current moment, so the garbage collection algorithm can be started later.
  • the waterline parameter of the garbage collection algorithm can be increased so that the garbage collection algorithm can be started later, thereby reducing the data processing cost of running the garbage collection algorithm.
  • the second method is to reduce the speed parameter of the garbage collection algorithm.
  • the speed parameter indicates the garbage collection speed when the storage system executes the garbage collection algorithm. Therefore, the smaller the speed parameter, the slower the garbage collection speed, so that the storage system, especially the first object, can adapt to the new configuration mode as soon as possible.
  • the third method is to increase the startup delay of the garbage collection algorithm. There may be a certain startup delay from receiving the startup instruction to the actual startup of the garbage collection algorithm. By increasing this startup delay, garbage collection can also be slowed down, so that the storage system, especially the first object, can adapt to the new configuration mode as soon as possible.
  • the second object can adaptively adjust the size of the actual reserved space of the second object based on the existing technology, which will not be described in detail here.
  • the storage system can complete the adjustment of the actual reserved space of the first object and the second object as soon as possible, reducing the time required for the storage system to adapt to the new configuration mode and improving the performance of the storage system.
  • the adjustment method is more flexible.
  • FIG9 is a schematic diagram showing the structure of the resource allocation device according to the embodiment of the present application.
  • an embodiment of the present application provides a resource allocation device, the device comprising:
  • An acquisition module 91 is used to acquire the size of the available reserved space of the first object and the size of the available reserved space of the second object;
  • the adjustment module 92 is used to adjust the size of the actual reserved space of the first object and the size of the actual reserved space of the second object according to the characteristic parameters of the user load and the type parameters of the garbage collection algorithm.
  • the first object and the second object are set in a storage system, and the storage system runs the garbage collection algorithm.
  • the first object includes a system layer of the storage system
  • the second object includes a device layer of the storage system.
  • the available reserved space of the first object includes the hot backup space of the system layer, the initial reserved space, and the unused space in the user visible space;
  • the available reserved space of the second object includes the initial reserved space of the device layer
  • the hot backup space and the initial reserved space of the system layer and the initial reserved space of the device layer remain unchanged.
  • the first object and the second object are set in a storage system, and the storage system runs the garbage collection algorithm.
  • the first object includes a system layer of the storage system
  • the second object includes an application layer of the storage system.
  • the available reserved space of the first object includes the hot backup space of the system layer, the initial reserved space, and the unused space in the user visible space;
  • the available reserved space of the second object includes the initial reserved space of the application layer
  • the hot backup space and the initial reserved space of the system layer remain unchanged.
  • the device further includes:
  • a first determination module is used to determine the user input/output access object and frequency within a preset time window
  • a construction module used to sort the access objects according to the frequency and construct a statistical histogram
  • a second determination module configured to determine a linear relationship between the frequency and the sorting sequence number of the access object based on the statistical histogram
  • the third determination module is used to determine the characteristic parameter of the user load according to the slope of the linear relationship.
  • the adjustment module includes:
  • a selecting unit configured to select, from among a plurality of preset configuration modes of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object, a configuration mode that matches the sum of the space of the available reserved space of the first object and the size of the available reserved space of the second object, the characteristic parameter, and the type parameter as the optimal configuration mode;
  • An adjusting unit is used to adjust the size of the actual reserved space of the first object and the size of the actual reserved space of the second object according to the optimal configuration mode.
  • the device further includes:
  • a fourth determining module configured to determine a value range of the total space according to the hot backup space, the initial reserved space, the user visible space, and the available reserved space of the second object;
  • a fifth determining module configured to determine, for each value in the value range of the space sum, a plurality of division methods of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object under the value;
  • the sixth determination module is used to determine multiple configuration methods of the actual reserved space size of the first object and the actual reserved space size of the second object based on multiple characteristic parameters of the user load, multiple types of parameters of the garbage collection algorithm, the total space and the multiple division methods.
  • the sixth determining module includes:
  • a first determining unit configured to determine, according to the plurality of characteristic parameters of the user load, the plurality of type parameters of the garbage collection algorithm, and the space sum, a plurality of combinations of the characteristic parameters, the type parameters, and the space sum, wherein at least one of the characteristic parameters, the type parameters, and the space sum in different combinations is different;
  • a second determining unit configured to determine, for each combination of the characteristic parameter, the type parameter, and the space sum, a write amplification factor for each division method of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object;
  • the third determination unit is used to determine the division method of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object corresponding to the minimum write amplification factor under each combination method as a configuration method of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object.
  • adjusting the size of the actual reserved space of the first object and the size of the actual reserved space of the second object according to the optimal configuration mode includes at least one of the following:
  • the speed parameter indicating a garbage collection speed when the storage system executes the garbage collection algorithm
  • adjusting the size of the actual reserved space of the first object and the size of the actual reserved space of the second object according to the optimal configuration includes at least one of the following:
  • the speed parameter indicating a garbage collection speed when the storage system executes the garbage collection algorithm
  • An embodiment of the present application provides a resource allocation device, comprising: a processor and a memory for storing processor-executable instructions; wherein the processor is configured to implement the above method when executing the instructions.
  • An embodiment of the present application provides a non-volatile computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the above method is implemented.
  • An embodiment of the present application provides a computer program product, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code.
  • the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above method.
  • FIG. 10 shows an exemplary structural diagram of a resource allocation device according to an embodiment of the present application.
  • the resource allocation device may include at least one of a mobile phone, a foldable electronic device, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) device, a virtual reality (VR) device, an artificial intelligence (AI) device, a wearable device, an in-vehicle device, a smart home device, or a smart city device, and a server device.
  • PDA personal digital assistant
  • AR augmented reality
  • VR virtual reality
  • AI artificial intelligence
  • the embodiment of the present application does not impose any special restrictions on the specific type of the resource allocation device.
  • the resource allocation device may include a processor 110, a memory 121, and a communication module 160. It is understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the resource allocation device. In other embodiments of the present application, the resource allocation device may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
  • the processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and/or a neural-network processing unit (NPU), etc.
  • AP application processor
  • GPU graphics processor
  • ISP image signal processor
  • DSP digital signal processor
  • NPU neural-network processing unit
  • Different processing units may be independent devices or integrated in one or more processors.
  • the processor can generate operation control signals based on instruction opcodes and timing signals to complete the control of instruction fetching and execution.
  • a memory may also be provided in the processor 110 for storing instructions and data.
  • the memory in the processor 110 may be a cache memory.
  • the memory may store instructions or data that have been used or are frequently used by the processor 110, such as the multiple configuration modes of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object pre-set in the embodiment of the present application. If the processor 110 needs to use the instruction or data, it may be directly called from the memory. Repeated access is avoided, the waiting time of the processor 110 is reduced, and the efficiency of the system is improved.
  • the memory 121 can be used to store computer executable program codes, which include instructions.
  • the memory 121 can include a program storage area and a data storage area.
  • the program storage area can store an operating system, an application required for at least one function (such as the least squares method), etc.
  • the data storage area can store data acquired or created during the use of the resource allocation device (such as the size of the available reserved space of the first object and the size of the available reserved space of the second object, etc.).
  • the memory 121 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
  • the processor 110 executes various functional methods of the resource allocation device or the above-mentioned resource allocation method by running instructions stored in the memory 121 and/or instructions stored in a memory provided in the processor.
  • the communication module 160 can be used to receive data (such as the characteristic attributes in the embodiment of the present application) from other devices or equipment through wireless communication/wired communication, and output data to other devices or equipment.
  • wireless communication solutions including WLAN (such as Wi-Fi network), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (IR), etc. can be provided.
  • WLAN such as Wi-Fi network
  • BT Bluetooth
  • GNSS global navigation satellite system
  • FM frequency modulation
  • NFC near field communication
  • IR infrared technology
  • a computer readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device.
  • a computer readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing.
  • Computer readable storage media include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disc (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing.
  • RAM random access memory
  • ROM read-only memory
  • EPROM or flash memory erasable programmable read-only memory
  • SRAM static random access memory
  • CD-ROM compact disc read-only memory
  • DVD digital versatile disc
  • memory stick a floppy disk
  • mechanical encoding device such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing.
  • the computer-readable program instructions or codes described herein can be downloaded from a computer-readable storage medium to each computing/processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and/or a wireless network.
  • the network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and/or edge servers.
  • the network adapter card or network interface in each computing/processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing/processing device.
  • the computer program instructions for performing the operations of the present application may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as "C" language or similar programming languages.
  • the computer-readable program instructions may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server.
  • the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
  • LAN local area network
  • WAN wide area network
  • an Internet service provider e.g., via the Internet using an Internet service provider.
  • an electronic circuit such as a programmable logic circuit, a field programmable gate array (FPGA) or a programmable logic array (PLA)
  • FPGA field programmable gate array
  • PLA programmable logic array
  • These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions/actions specified in one or more boxes in the flowchart and/or block diagram is generated.
  • These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and/or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions/actions specified in one or more boxes in the flowchart and/or block diagram.
  • Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions/actions specified in one or more boxes in the flowchart and/or block diagram.
  • each square frame in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the logical function of the specification.
  • the functions marked in the square frame can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square frames can actually be executed substantially in parallel, and they can also be executed in the opposite order sometimes, depending on the functions involved.
  • each box in the block diagram and/or flowchart, and the combination of boxes in the block diagram and/or flowchart can be implemented by hardware (such as circuits or ASICs (Application Specific Integrated Circuit)) that performs the corresponding function or action, or can be implemented by a combination of hardware and software, such as firmware.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present application relates to a resource allocation method and apparatus, a storage medium, and a program product. The method comprises: acquiring the size of an available reserved space of a first object and the size of an available reserved space of a second object; and according to a characteristic parameter of a user load and a type parameter of a garbage collection algorithm, adjusting the size of an actual reserved space of the first object and the size of an actual reserved space of the second object. According to the resource allocation method of embodiments of the present application, when a system comprises a first object and a second object, a configuration method for dynamically adjusting the reserved spaces of two objects when the system is running reduces the influence of write amplification on the system performance. Moreover, there is no need to specially design an interface, such that there is no need to re-design a software stack for the interface, thereby reducing data processing costs and operation and maintenance costs, and optimizing the user experience.

Description

资源分配方法、装置、存储介质及程序产品Resource allocation method, device, storage medium and program product
本申请要求于2022年10月14日提交中国专利局、申请号为202211262519.8、申请名称为“资源分配方法、装置、存储介质及程序产品”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to the Chinese patent application filed with the China Patent Office on October 14, 2022, with application number 202211262519.8 and application name “Resource allocation method, device, storage medium and program product”, all contents of which are incorporated by reference in this application.
技术领域Technical Field
本申请涉及数据存储领域,尤其涉及一种资源分配方法、装置、存储介质及程序产品。The present application relates to the field of data storage, and in particular to a resource allocation method, device, storage medium and program product.
背景技术Background technique
双层日志(log-on-log)结构是目前主流的一种存储系统架构,该种架构的存储系统包括两个基于日志结构的对象,且每个对象均支持垃圾回收(garbage collection,GC)算法,以保证存储系统能够实现顺序写机制。较为常见的对象是软件的系统层和硬件的设备层(包括固态硬盘(solid state disk,SSD))。为了减少写放大(write amplification,WA)对存储系统性能的不良影响,一般会在两个对象中分别设置一定的预留空间(over-provisioning,OP)以服务垃圾回收,保证存储系统的性能。越大的预留空间,对写放大越友好,存储系统的性能也越高。The two-layer log (log-on-log) structure is currently a mainstream storage system architecture. The storage system of this architecture includes two objects based on the log structure, and each object supports the garbage collection (GC) algorithm to ensure that the storage system can implement a sequential write mechanism. The more common objects are the system layer of software and the device layer of hardware (including solid state disks (SSD)). In order to reduce the adverse effects of write amplification (WA) on the performance of the storage system, a certain amount of over-provisioning (OP) is generally set in each of the two objects to serve garbage collection and ensure the performance of the storage system. The larger the reserved space, the more friendly it is to write amplification and the higher the performance of the storage system.
一些存储系统的设备层和系统层的预留空间大小在用户购买后就确定了,在存储系统后续运行中不会变化,也对用户不可见。可能存在系统层预留空间有限,导致写压力很大,进而导致存储系统的系统层到设备层的网络连接性能较差的情况。另一些存储系统改进了设备层的硬件设备,通过设备层主动将改进后的接口暴露给系统层,可实现设备层空间几乎没有预留空间,而是全由系统层控制系统层以及设备层的预留空间分配,变相扩大了系统层的预留空间大小。但是也因其将硬件的管理交由软件决策,需要针对硬件设备重新设计软件栈,造成整个软件栈生态以及后期运维的成本都很高。The reserved space size of the device layer and system layer of some storage systems is determined after the user purchases them. It will not change during the subsequent operation of the storage system and is not visible to the user. There may be a situation where the reserved space at the system layer is limited, resulting in heavy write pressure, which in turn leads to poor network connection performance from the system layer to the device layer of the storage system. Other storage systems have improved the hardware devices at the device layer, and actively exposed the improved interface to the system layer through the device layer, so that there is almost no reserved space at the device layer. Instead, the system layer controls the reserved space allocation of the system layer and the device layer, which in turn increases the size of the reserved space at the system layer. However, because it leaves the management of hardware to software decisions, it is necessary to redesign the software stack for hardware devices, resulting in high costs for the entire software stack ecosystem and subsequent operation and maintenance.
发明内容Summary of the invention
有鉴于此,提出了一种资源分配方法、装置、存储介质及程序产品,根据本申请实施例的资源分配方法,在系统包括第一对象和第二对象时,在系统运行时也能动态调整第两个对象的预留空间的配置方式,使得存资源分配方式更灵活,降低写放大对系统性能的影响。且不需对接口进行特别设计,因此无需针对接口重新进行软件栈的对应设计,可以降低数据处理成本和运维成本,优化用户体验。In view of this, a resource allocation method, device, storage medium and program product are proposed. According to the resource allocation method of the embodiment of the present application, when the system includes a first object and a second object, the configuration mode of the reserved space of the second object can also be dynamically adjusted when the system is running, so that the storage resource allocation mode is more flexible and the impact of write amplification on system performance is reduced. And there is no need to specially design the interface, so there is no need to redesign the software stack for the interface, which can reduce data processing costs and operation and maintenance costs, and optimize user experience.
第一方面,本申请的实施例提供了一种资源分配方法,所述方法包括:获取第一对象的可用预留空间的大小和第二对象的可用预留空间的大小;根据用户负载的特性参数以及垃圾回收算法的类型参数调整所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小。In a first aspect, an embodiment of the present application provides a resource allocation method, the method comprising: obtaining the size of the available reserved space of a first object and the size of the available reserved space of a second object; adjusting the size of the actual reserved space of the first object and the size of the actual reserved space of the second object according to characteristic parameters of the user load and type parameters of the garbage collection algorithm.
根据本申请实施例的资源分配方法,通过获取第一对象的可用预留空间的大小和第二对象的可用预留空间的大小,能够确定由第一对象和第二对象的硬件参数和实际使用情况决定的可用预留空间大小;根据用户负载的特性参数以及垃圾回收算法的类型参数调整第一对象的实际预留空间的大小和第二对象的实际预留空间的大小,使得第一对象的实际预留空间大小不受限于第一对象的硬件参数,第二对象的实际预留空间大小也不受限于第一对象的硬件参数,在软件层次上实现了实际预留空间大小的灵活调整;在系统包括第一对象和第二对象时,在系统运行时也能动态调整第两个对象的实际预留空间的配置方式,使得资源分配方式更灵活;通过综合用户负载的特性参数以及垃圾回收算法的类型参数等对系统有影响的多方面因素,实现了资源的合理分配,因此能够降低写放大对系统性能的影响。且分配并不需对接口进行特别设计,因此也无需重新进行软件栈的对应设计,可以降低数据处理成本和运维成本,优化用户体验。According to the resource allocation method of the embodiment of the present application, by obtaining the size of the available reserved space of the first object and the size of the available reserved space of the second object, the size of the available reserved space determined by the hardware parameters and actual usage of the first object and the second object can be determined; the size of the actual reserved space of the first object and the size of the actual reserved space of the second object are adjusted according to the characteristic parameters of the user load and the type parameters of the garbage collection algorithm, so that the actual reserved space size of the first object is not limited by the hardware parameters of the first object, and the actual reserved space size of the second object is not limited by the hardware parameters of the first object, and the flexible adjustment of the actual reserved space size is realized at the software level; when the system includes the first object and the second object, the configuration method of the actual reserved space of the second object can also be dynamically adjusted when the system is running, so that the resource allocation method is more flexible; by integrating the characteristic parameters of the user load and the type parameters of the garbage collection algorithm and other factors that affect the system, reasonable allocation of resources is realized, so the impact of write amplification on system performance can be reduced. And the allocation does not require special design of the interface, so there is no need to redesign the corresponding software stack, which can reduce data processing costs and operation and maintenance costs, and optimize user experience.
根据第一方面,在所述资源分配方法的第一种可能的实现方式中,所述第一对象和所述第二对象设置在存储系统中,所述存储系统运行所述垃圾回收算法,所述第一对象包括所述存储系统的系统层,所述第二对象包括所述存储系统的设备层,所述第一对象的可用预留空间包括所述系统层的热备份空间、初始预留空间以及用户可见空间中未被使用的空间;所述第二对象的可用预留空间包括所述设备层的初始预留空间;其中,所述系统层的热备份空间、初始预留空间以及所述设备层的初始预留空间不变。According to the first aspect, in a first possible implementation of the resource allocation method, the first object and the second object are set in a storage system, the storage system runs the garbage collection algorithm, the first object includes the system layer of the storage system, the second object includes the device layer of the storage system, the available reserved space of the first object includes the hot backup space, the initial reserved space and the unused space in the user-visible space of the system layer; the available reserved space of the second object includes the initial reserved space of the device layer; wherein the hot backup space, the initial reserved space of the system layer and the initial reserved space of the device layer remain unchanged.
通过这种方式,使得本申请实施例的资源分配方法可以应用于基于通用的硬件设备的存储系统,由于无需定制硬件设备,因此也无需设计和维护对应的软件栈,可以降低资源分配方法对于硬件设备的依赖,提升资源分配方法普适性;在系统层软件配置与设备层硬件配置特定的前提下,能够使存储系统中不同对象间的网络连接保持较好的性能,提高设备层空间的利用率,降低写放大,延长设备层硬件寿命,降低成本。In this way, the resource allocation method of the embodiment of the present application can be applied to a storage system based on a general hardware device. Since there is no need to customize the hardware device, there is no need to design and maintain the corresponding software stack, which can reduce the dependence of the resource allocation method on the hardware device and improve the universality of the resource allocation method. Under the premise of specific system-level software configuration and device-level hardware configuration, the network connection between different objects in the storage system can maintain good performance, improve the utilization of the device-level space, reduce write amplification, extend the life of the device-level hardware, and reduce costs.
根据第一方面,在所述资源分配方法的第二种可能的实现方式中,所述第一对象和所述第二对象设置在存储系统中,所述存储系统运行所述垃圾回收算法,所述第一对象包括所述存储系统的系统层,所述第二对象包括所述存储系统的应用层,所述第一对象的可用预留空间包括所述系统层的热备份空间、初始预留空间以及用户可见空间中未被使用的空间;所述第二对象的可用预留空间包括所述应用层的初始预留空间;其中,所述系统层的热备份空间、初始预留空间不变。According to the first aspect, in a second possible implementation of the resource allocation method, the first object and the second object are set in a storage system, the storage system runs the garbage collection algorithm, the first object includes the system layer of the storage system, the second object includes the application layer of the storage system, the available reserved space of the first object includes the hot backup space, the initial reserved space and the unused space in the user-visible space of the system layer; the available reserved space of the second object includes the initial reserved space of the application layer; wherein the hot backup space and the initial reserved space of the system layer remain unchanged.
通过这种方式,使得本申请实施例的资源分配方法可以应用于双层日志结构的任意存储系统,可以进一步提升资源分配方法的普适性,扩展资源分配方法的应用场景。In this way, the resource allocation method of the embodiment of the present application can be applied to any storage system with a double-layer log structure, which can further improve the universality of the resource allocation method and expand the application scenarios of the resource allocation method.
根据第一方面,或以上第一方面的任意一种可能的实现方式,在所述资源分配方法的第三种可能的实现方式中,所述根据用户负载的特性参数以及垃圾回收算法的类型参数调整所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小之前,所述方法还包括:确定预设时间窗口内的用户输入/输出访问对象及频次;根据所述频次的高低对所述访问对象进行排序,构建统计直方图;基于所述统计直方图,确定所述频次与所述访问对象的排序序号的线性关系;根据所述线性关系的斜率确定所述用户负载的特性参数。According to the first aspect, or any possible implementation of the first aspect above, in a third possible implementation of the resource allocation method, before adjusting the size of the actual reserved space of the first object and the size of the actual reserved space of the second object according to the characteristic parameters of the user load and the type parameters of the garbage collection algorithm, the method also includes: determining the user input/output access objects and frequency within a preset time window; sorting the access objects according to the frequency and constructing a statistical histogram; based on the statistical histogram, determining the linear relationship between the frequency and the sorting sequence number of the access objects; determining the characteristic parameters of the user load according to the slope of the linear relationship.
通过这种方式,可以完成用户负载的特性参数的实时确定。用户负载的特性参数的确定可以在系统运行前或者运行过程中随时进行,不会影响存储系统的正常运作,便于用户确定用户负载情况的同时,也为使用用户负载的特性参数调整第一对象的实际预留空间的大小和第二对象的实际预留空间的大小提供可能。In this way, the characteristic parameters of the user load can be determined in real time. The characteristic parameters of the user load can be determined at any time before or during the operation of the system, which will not affect the normal operation of the storage system, and is convenient for users to determine the user load situation. It also provides the possibility of adjusting the size of the actual reserved space of the first object and the size of the actual reserved space of the second object using the characteristic parameters of the user load.
根据第一方面,或以上第一方面的任意一种可能的实现方式,在所述资源分配方法的第四种可能的实现方式中,所述根据用户负载的特性参数以及垃圾回收算法的类型参数调整所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小,包括:从预先设置的所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小的多种配置方式中,选择与所述第一对象的可用预留空间的大小和所述第二对象的可用预留空间的大小的空间总和、所述特性参数以及所述类型参数相匹配的配置方式,作为所述最佳配置方式;根据所述最佳配置方式,调整所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小。According to the first aspect, or any possible implementation of the first aspect above, in a fourth possible implementation of the resource allocation method, adjusting the size of the actual reserved space of the first object and the size of the actual reserved space of the second object according to the characteristic parameters of the user load and the type parameters of the garbage collection algorithm includes: selecting a configuration method that matches the sum of the spaces of the size of the available reserved space of the first object and the size of the available reserved space of the second object, the characteristic parameters and the type parameters from a plurality of pre-set configuration methods of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object as the optimal configuration method; and adjusting the size of the actual reserved space of the first object and the size of the actual reserved space of the second object according to the optimal configuration method.
通过这种方式,可以在系统运行过程中快速确定最佳配置方式,进而提升从获取第一对象的可用预留空间大小和第二对象的可用预留空间大小到调整第一对象的实际预留空间的大小和第二对象的实际预留空间的大小的效率。In this way, the best configuration method can be quickly determined during system operation, thereby improving the efficiency from obtaining the available reserved space size of the first object and the available reserved space size of the second object to adjusting the actual reserved space size of the first object and the actual reserved space size of the second object.
根据第一方面的第四种可能的实现方式,在所述资源分配方法的第五种可能的实现方式中,所述方法还包括:根据所述热备份空间、所述初始预留空间、所述用户可见空间、所述第二对象的可用预留空间,确定所述空间总和的取值范围;针对所述空间总和的取值范围中的每一数值,确定该数值下所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小的多种划分方式;根据所述用户负载的多种特性参数、所述垃圾回收算法的多种类型参数、所述空间总和以及所述多种划分方式,确定所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小的多种配置方式。According to the fourth possible implementation manner of the first aspect, in the fifth possible implementation manner of the resource allocation method, the method also includes: determining a value range of the total space according to the hot backup space, the initial reserved space, the user visible space, and the available reserved space of the second object; for each numerical value in the value range of the total space, determining multiple division methods of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object under the numerical value; determining multiple configuration methods of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object according to multiple characteristic parameters of the user load, multiple types of parameters of the garbage collection algorithm, the total space, and the multiple division methods.
通过这种方式,使得可以确定第一对象的实际预留空间的大小和第二对象的实际预留空间的大小的多种配置方式。由于使用了与存储系统性能有关的用户负载的特性参数、垃圾回收算法的类型参数、空间总和以及多种划分方式作为确定多种配置方式的依据,使得确定的配置方式下存储系统性能得到保障。In this way, multiple configuration modes of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object can be determined. Since characteristic parameters of user load related to storage system performance, type parameters of garbage collection algorithm, total space and multiple division modes are used as the basis for determining multiple configuration modes, the storage system performance is guaranteed under the determined configuration mode.
根据第一方面的第五种可能的实现方式,在所述资源分配方法的第六种可能的实现方式中,所述根据所述用户负载的多种特性参数、所述垃圾回收算法的多种类型参数、所述空间总和以及所述多种划分方式,确定所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小的多种配置方式,包括:根据所述用户负载的多种特性参数、所述垃圾回收算法的多种类型参数、所述空间总和,确定所述特性参数、所述类型参数、所述空间总和的多种组合方式,其中,不同组合方式下的特性参数、类型参数、空间总和中的至少其中之一不同;针对所述特性参数、所述类型参数、所述空间总和的每种组合方式,分别确定所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小的每种划分方式的写放大因子;将每种组合方式下最小的写放大因子对应的第一对象的实际预留空间的大小和第二对象的实际预留空间的大小的划分方式,确定为所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小的一种配置方式。According to a fifth possible implementation manner of the first aspect, in a sixth possible implementation manner of the resource allocation method, the multiple configuration manners of determining the size of the actual reserved space of the first object and the size of the actual reserved space of the second object according to the multiple characteristic parameters of the user load, the multiple type parameters of the garbage collection algorithm, the space sum, and the multiple division methods include: determining multiple combinations of the characteristic parameters, the type parameters, and the space sum according to the multiple characteristic parameters of the user load, the multiple type parameters of the garbage collection algorithm, and the space sum, wherein at least one of the characteristic parameters, the type parameters, and the space sum in different combinations is different; for each combination of the characteristic parameters, the type parameters, and the space sum, respectively determining the write amplification factor of each division method of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object; determining the division method of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object corresponding to the smallest write amplification factor in each combination as a configuration manner of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object.
通过这种方式,可以完成第一对象的实际预留空间的大小和第二对象的实际预留空间的大小的多种配置方式的确定。最终确定的多种配置方式都是性能最优的,因此能够节省存储多种配置方式的成本。In this way, multiple configuration modes of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object can be determined. The multiple configuration modes finally determined are all optimal in performance, thus saving the cost of storing multiple configuration modes.
根据第一方面的第四种至第六种可能的实现方式中的任意一种可能的实现方式,在所述资源分配方法的第七种可能的实现方式中,在所述最佳配置方式下,所述第一对象的实际预留空间的大小减小,所述第二对象的实际预留空间的大小增大时,所述根据所述最佳配置方式,调整所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小,包括以下至少其中之一:降低所述垃圾回收算法的水位线参数,所述水位线参数的数值大于所述第一对象的实际预留空间的大小时所述垃圾回收算法启动;提高所述垃圾回收算法的速度参数,所述速度参数指示所述存储系统执行所述垃圾回收算法时的垃圾回收速度;减小所述垃圾回收算法的启动时延。According to any one of the fourth to sixth possible implementations of the first aspect, in the seventh possible implementation of the resource allocation method, under the optimal configuration mode, when the size of the actual reserved space of the first object decreases and the size of the actual reserved space of the second object increases, adjusting the size of the actual reserved space of the first object and the size of the actual reserved space of the second object according to the optimal configuration mode includes at least one of the following: lowering a watermark parameter of the garbage collection algorithm, and the garbage collection algorithm is started when the value of the watermark parameter is greater than the size of the actual reserved space of the first object; increasing a speed parameter of the garbage collection algorithm, and the speed parameter indicates the garbage collection speed when the storage system executes the garbage collection algorithm; and reducing the startup delay of the garbage collection algorithm.
通过这种方式,能够在最佳配置方式指示第一对象的实际预留空间的大小减小,第二对象的实际预留空间的大小增大时,能够尽快使得存储系统完成第一对象和第二对象的实际预留空间的调整,降低存储系统适应新的配置方式所需的时间,提升存储系统的性能。通过采用多种途径完成调整,使得调整的方式更灵活。In this way, when the optimal configuration indicates that the size of the actual reserved space of the first object is reduced and the size of the actual reserved space of the second object is increased, the storage system can complete the adjustment of the actual reserved space of the first object and the second object as soon as possible, reducing the time required for the storage system to adapt to the new configuration mode and improving the performance of the storage system. By adopting multiple ways to complete the adjustment, the adjustment method is more flexible.
根据第一方面的第四种至第七种可能的实现方式中的任意一种可能的实现方式,在所述资源分配方法的第八种可能的实现方式中,在所述最佳配置方式下,所述第一对象的实际预留空间的大小增大,所述第二对象的实际预留空间的大小减小时,所述根据所述最佳配置方式,调整所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小,包括以下至少其中之一:提高所述垃圾回收算法的水位线参数,所述水位线参数的数值大于所述第一对象的实际预留空间的大小时所述垃圾回收算法启动;降低所述垃圾回收算法的速度参数,所述速度参数指示所述存储系统执行所述垃圾回收算法时的垃圾回收速度;增大所述垃圾回收算法的启动时延。According to any one of the fourth to seventh possible implementations of the first aspect, in an eighth possible implementation of the resource allocation method, under the optimal configuration mode, when the size of the actual reserved space of the first object increases and the size of the actual reserved space of the second object decreases, adjusting the size of the actual reserved space of the first object and the size of the actual reserved space of the second object according to the optimal configuration mode includes at least one of the following: increasing a waterline parameter of the garbage collection algorithm, and the garbage collection algorithm is started when the value of the waterline parameter is greater than the size of the actual reserved space of the first object; reducing a speed parameter of the garbage collection algorithm, and the speed parameter indicates the garbage collection speed when the storage system executes the garbage collection algorithm; and increasing the startup delay of the garbage collection algorithm.
通过这种方式,能够在最佳配置方式指示第一对象的实际预留空间的大小增大,第二对象的实际预留空间的大小减小时,能够尽快使得存储系统完成第一对象和第二对象的实际预留空间的调整,降低存储系统适应新的配置方式所需的时间,提升存储系统的性能。通过采用多种途径完成调整,使得调整的方式更灵活。In this way, when the optimal configuration indicates that the size of the actual reserved space of the first object is increased and the size of the actual reserved space of the second object is decreased, the storage system can complete the adjustment of the actual reserved space of the first object and the second object as soon as possible, reducing the time required for the storage system to adapt to the new configuration mode and improving the performance of the storage system. By adopting multiple ways to complete the adjustment, the adjustment method is more flexible.
第二方面,本申请的实施例提供了一种资源分配装置,所述装置包括:获取模块,用于获取第一对象的可用预留空间的大小和第二对象的可用预留空间的大小;调整模块,用于根据用户负载的特性参数以及垃圾回收算法的类型参数调整所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小。In a second aspect, an embodiment of the present application provides a resource allocation device, comprising: an acquisition module for acquiring the size of an available reserved space of a first object and the size of an available reserved space of a second object; an adjustment module for adjusting the size of an actual reserved space of the first object and the size of an actual reserved space of the second object according to characteristic parameters of a user load and type parameters of a garbage collection algorithm.
根据第二方面,在所述资源分配装置的第一种可能的实现方式中,所述第一对象和所述第二对象设置在存储系统中,所述存储系统运行所述垃圾回收算法,所述第一对象包括所述存储系统的系统层,所述第二对象包括所述存储系统的设备层,所述第一对象的可用预留空间包括所述系统层的热备份空间、初始预留空间以及用户可见空间中未被使用的空间;所述第二对象的可用预留空间包括所述设备层的初始预留空间;其中,所述系统层的热备份空间、初始预留空间以及所述设备层的初始预留空间不变。According to the second aspect, in a first possible implementation of the resource allocation device, the first object and the second object are set in a storage system, the storage system runs the garbage collection algorithm, the first object includes the system layer of the storage system, the second object includes the device layer of the storage system, the available reserved space of the first object includes the hot backup space, the initial reserved space and the unused space in the user-visible space of the system layer; the available reserved space of the second object includes the initial reserved space of the device layer; wherein the hot backup space, the initial reserved space of the system layer and the initial reserved space of the device layer remain unchanged.
根据第二方面,在所述资源分配装置的第二种可能的实现方式中,所述第一对象和所述第二对象设置在存储系统中,所述存储系统运行所述垃圾回收算法,所述第一对象包括所述存储系统的系统层,所述第二对象包括所述存储系统的应用层,所述第一对象的可用预留空间包括所述系统层的热备份空间、初始预留空间以及用户可见空间中未被使用的空间;所述第二对象的可用预留空间包括所述应用层的初始预留空间;其中,所述系统层的热备份空间、初始预留空间不变。According to the second aspect, in a second possible implementation of the resource allocation device, the first object and the second object are set in a storage system, the storage system runs the garbage collection algorithm, the first object includes the system layer of the storage system, the second object includes the application layer of the storage system, the available reserved space of the first object includes the hot backup space, the initial reserved space and unused space in the user-visible space of the system layer; the available reserved space of the second object includes the initial reserved space of the application layer; wherein the hot backup space and the initial reserved space of the system layer remain unchanged.
根据第二方面,或以上第二方面的任意一种可能的实现方式,在所述资源分配装置的第三种可能的实现方式中,所述装置还包括:第一确定模块,用于确定预设时间窗口内的用户输入/输出访问对象及频次;构建模块,用于根据所述频次的高低对所述访问对象进行排序,构建统计直方图;第二确定模块,用于基于所述统计直方图,确定所述频次与所述访问对象的排序序号的线性关系;第三确定模块,用于根据所述线性关系的斜率确定所述用户负载的特性参数。According to the second aspect, or any possible implementation of the second aspect above, in a third possible implementation of the resource allocation device, the device also includes: a first determination module, used to determine the user input/output access objects and frequency within a preset time window; a construction module, used to sort the access objects according to the frequency and construct a statistical histogram; a second determination module, used to determine the linear relationship between the frequency and the sorting sequence number of the access object based on the statistical histogram; a third determination module, used to determine the characteristic parameters of the user load according to the slope of the linear relationship.
根据第二方面,或以上第二方面的任意一种可能的实现方式,在所述资源分配装置的第四种可能的实现方式中,所述调整模块包括:选择单元,用于从预先设置的所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小的多种配置方式中,选择与所述第一对象的可用预留空间的大小和所述第二对象的可用预留空间的大小的空间总和、所述特性参数以及所述类型参数相匹配的配置方式,作为所述最佳配置方式;调整单元,用于根据所述最佳配置方式,调整所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小。According to the second aspect, or any possible implementation of the second aspect above, in a fourth possible implementation of the resource allocation device, the adjustment module includes: a selection unit, used to select a configuration method that matches the sum of the space of the available reserved space of the first object and the size of the available reserved space of the second object, the characteristic parameters, and the type parameters from a plurality of pre-set configuration methods of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object as the optimal configuration method; an adjustment unit, used to adjust the size of the actual reserved space of the first object and the size of the actual reserved space of the second object according to the optimal configuration method.
根据第二方面的第四种可能的实现方式,在所述资源分配装置的第五种可能的实现方式中,所述装置还包括:第四确定模块,用于根据所述热备份空间、所述初始预留空间、所述用户可见空间、所述第二对象的可用预留空间,确定所述空间总和的取值范围;第五确定模块,用于针对所述空间总和的取值范围中的每一数值,确定该数值下所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小的多种划分方式;第六确定模块,用于根据所述用户负载的多种特性参数、所述垃圾回收算法的多种类型参数、所述空间总和以及所述多种划分方式,确定所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小的多种配置方式。According to a fourth possible implementation manner of the second aspect, in a fifth possible implementation manner of the resource allocation device, the device also includes: a fourth determination module, used to determine the value range of the total space according to the hot backup space, the initial reserved space, the user visible space, and the available reserved space of the second object; a fifth determination module, used to determine, for each value in the value range of the total space, multiple division methods of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object under the value; a sixth determination module, used to determine multiple configuration methods of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object according to multiple characteristic parameters of the user load, multiple types of parameters of the garbage collection algorithm, the total space, and the multiple division methods.
根据第二方面的第五种可能的实现方式,在所述资源分配装置的第六种可能的实现方式中,所述第六确定模块包括:第一确定单元,用于根据所述用户负载的多种特性参数、所述垃圾回收算法的多种类型参数、所述空间总和,确定所述特性参数、所述类型参数、所述空间总和的多种组合方式,其中,不同组合方式下的特性参数、类型参数、空间总和中的至少其中之一不同;第二确定单元,用于针对所述特性参数、所述类型参数、所述空间总和的每种组合方式,分别确定所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小的每种划分方式的写放大因子;第三确定单元,用于将每种组合方式下最小的写放大因子对应的第一对象的实际预留空间的大小和第二对象的实际预留空间的大小的划分方式,确定为所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小的一种配置方式。According to a fifth possible implementation manner of the second aspect, in a sixth possible implementation manner of the resource allocation device, the sixth determination module includes: a first determination unit, used to determine multiple combinations of the characteristic parameters, the type parameters, and the space sum according to multiple characteristic parameters of the user load, multiple type parameters of the garbage collection algorithm, and the space sum, wherein at least one of the characteristic parameters, the type parameters, and the space sum in different combinations is different; a second determination unit, used to determine the write amplification factor of each division method of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object for each combination of the characteristic parameters, the type parameters, and the space sum; a third determination unit, used to determine the division method of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object corresponding to the smallest write amplification factor in each combination as a configuration method of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object.
根据第二方面的第四种至第六种可能的实现方式中的任意一种可能的实现方式,在所述资源分配装置的第七种可能的实现方式中,在所述最佳配置方式下,所述第一对象的实际预留空间的大小减小,所述第二对象的实际预留空间的大小增大时,所述根据所述最佳配置方式,调整所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小,包括以下至少其中之一:降低所述垃圾回收算法的水位线参数,所述水位线参数的数值大于所述第一对象的实际预留空间的大小时所述垃圾回收算法启动;提高所述垃圾回收算法的速度参数,所述速度参数指示所述存储系统执行所述垃圾回收算法时的垃圾回收速度;减小所述垃圾回收算法的启动时延。According to any one of the fourth to sixth possible implementations of the second aspect, in the seventh possible implementation of the resource allocation device, under the optimal configuration mode, when the size of the actual reserved space of the first object decreases and the size of the actual reserved space of the second object increases, adjusting the size of the actual reserved space of the first object and the size of the actual reserved space of the second object according to the optimal configuration mode includes at least one of the following: lowering a watermark parameter of the garbage collection algorithm, and the garbage collection algorithm is started when the value of the watermark parameter is greater than the size of the actual reserved space of the first object; increasing a speed parameter of the garbage collection algorithm, and the speed parameter indicates the garbage collection speed when the storage system executes the garbage collection algorithm; and reducing the startup delay of the garbage collection algorithm.
根据第二方面的第四种至第七种可能的实现方式中的任意一种可能的实现方式,在所述资源分配装置的第八种可能的实现方式中,在所述最佳配置方式下,所述第一对象的实际预留空间的大小增大,所述第二对象的实际预留空间的大小减小时,所述根据所述最佳配置方式,调整所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小,包括以下至少其中之一:提高所述垃圾回收算法的水位线参数,所述水位线参数的数值大于所述第一对象的实际预留空间的大小时所述垃圾回收算法启动;降低所述垃圾回收算法的速度参数,所述速度参数指示所述存储系统执行所述垃圾回收算法时的垃圾回收速度;增大所述垃圾回收算法的启动时延。According to any one of the fourth to seventh possible implementations of the second aspect, in an eighth possible implementation of the resource allocation device, under the optimal configuration mode, when the size of the actual reserved space of the first object increases and the size of the actual reserved space of the second object decreases, adjusting the size of the actual reserved space of the first object and the size of the actual reserved space of the second object according to the optimal configuration mode includes at least one of the following: increasing a waterline parameter of the garbage collection algorithm, and the garbage collection algorithm is started when the value of the waterline parameter is greater than the size of the actual reserved space of the first object; reducing a speed parameter of the garbage collection algorithm, and the speed parameter indicates the garbage collection speed when the storage system executes the garbage collection algorithm; and increasing the startup delay of the garbage collection algorithm.
第三方面,本申请的实施例提供了一种资源分配装置,包括:处理器;用于存储处理器可执行指令的存储器;其中,所述处理器被配置为执行所述指令时实现上述第一方面或者第一方面的多种可能的实现方式中的一种或几种的资源分配方法。In a third aspect, an embodiment of the present application provides a resource allocation device, comprising: a processor; a memory for storing processor executable instructions; wherein the processor is configured to implement the resource allocation method of the above-mentioned first aspect or one or more of the multiple possible implementation methods of the first aspect when executing the instructions.
第四方面,本申请的实施例提供了一种非易失性计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现上述第一方面或者第一方面的多种可能的实现方式中的一种或几种的资源分配方法。In a fourth aspect, an embodiment of the present application provides a non-volatile computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, implement the resource allocation method of the above-mentioned first aspect or one or more of the multiple possible implementation methods of the first aspect.
第五方面,本申请的实施例提供了一种计算机程序产品,包括计算机可读代码,或者承载有计算机可读代码的非易失性计算机可读存储介质,当所述计算机可读代码在电子设备中运行时,所述电子设备中的处理器执行上述第一方面或者第一方面的多种可能的实现方式中的一种或几种的资源分配方法。In a fifth aspect, an embodiment of the present application provides a computer program product, comprising a computer-readable code, or a non-volatile computer-readable storage medium carrying a computer-readable code. When the computer-readable code runs in an electronic device, the processor in the electronic device executes the resource allocation method of the above-mentioned first aspect or one or several of the multiple possible implementation methods of the first aspect.
本申请的这些和其他方面在以下(多个)实施例的描述中会更加简明易懂。These and other aspects of the present application will become more apparent from the following description of the embodiment(s).
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
包含在说明书中并且构成说明书的一部分的附图与说明书一起示出了本申请的示例性实施例、特征和方面,并且用于解释本申请的原理。The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate exemplary embodiments, features, and aspects of the present application and, together with the description, serve to explain the principles of the present application.
图1示出一种典型的双层日志结构存储系统的示意图。FIG1 shows a schematic diagram of a typical two-layer log structure storage system.
图2示出双层日志结构存储系统的系统层和设备层的预留空间分配方式的一个示例。FIG. 2 shows an example of a method for allocating reserved space at the system layer and the device layer of a two-layer log structure storage system.
图3a示出根据本申请实施例的资源分配方法的一种示例性应用场景。FIG. 3 a shows an exemplary application scenario of the resource allocation method according to an embodiment of the present application.
图3b示出根据本申请实施例的资源分配方法的一种示例性应用场景。FIG. 3 b shows an exemplary application scenario of the resource allocation method according to an embodiment of the present application.
图4示出根据本申请实施例的资源分配方法的流程的示意图。FIG4 is a schematic diagram showing a process of a resource allocation method according to an embodiment of the present application.
图5示出根据本申请实施例获取用户负载的特性参数的方法的示意图。FIG5 is a schematic diagram showing a method for obtaining characteristic parameters of a user load according to an embodiment of the present application.
图6示出根据本申请实施例的单个对象的写放大因子与预留空间大小的函数关系的一个示例。FIG. 6 shows an example of a functional relationship between a write amplification factor of a single object and a reserved space size according to an embodiment of the present application.
图7示出根据本申请实施例的存储系统的写放大因子与两个对象的预留空间大小的函数关系的一个示例。FIG. 7 shows an example of a functional relationship between a write amplification factor of a storage system and reserved space sizes of two objects according to an embodiment of the present application.
图8示出根据本申请实施例调整第一对象的实际预留空间的大小和第二对象的实际预留空间的大小的示意图。FIG. 8 is a schematic diagram showing how to adjust the size of the actual reserved space of the first object and the size of the actual reserved space of the second object according to an embodiment of the present application.
图9示出根据本申请实施例的资源分配装置的结构的示意图。FIG. 9 is a schematic diagram showing the structure of a resource allocation device according to an embodiment of the present application.
图10示出根据本申请实施例的资源分配装置的示例性结构图。FIG. 10 shows an exemplary structural diagram of a resource allocation device according to an embodiment of the present application.
具体实施方式Detailed ways
以下将参考附图详细说明本申请的各种示例性实施例、特征和方面。附图中相同的附图标记表示功能相同或相似的元件。尽管在附图中示出了实施例的各种方面,但是除非特别指出,不必按比例绘制附图。 Various exemplary embodiments, features and aspects of the present application will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.
在这里专用的词“示例性”意为“用作例子、实施例或说明性”。这里作为“示例性”所说明的任何实施例不必解释为优于或好于其它实施例。The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.
另外,为了更好的说明本申请,在下文的具体实施方式中给出了众多的具体细节。本领域技术人员应当理解,没有某些具体细节,本申请同样可以实施。在一些实例中,对于本领域技术人员熟知的方法、手段、元件和电路未作详细描述,以便于凸显本申请的主旨。In addition, in order to better illustrate the present application, numerous specific details are provided in the following specific embodiments. It should be understood by those skilled in the art that the present application can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present application.
图1示出一种典型的双层日志结构存储系统的示意图。FIG1 shows a schematic diagram of a typical two-layer log structure storage system.
如图1所示,该存储系统包括两个基于日志结构的对象,分别是系统层和设备层。且每个对象均支持垃圾回收算法,以保证存储系统能够实现顺序写机制。这种机制会出现写放大现象,也称写入放大,即实际写入的物理数据量是写入数据量的理论值的多倍。原因在于,假设要写入一个8KB的数据,但此时已经没有空余的空间,但是有失效的数据可以擦除,擦除以块(block)为单位,所以需要先把一块数据写入到缓存空间或者预留空间,然后擦除块,再把8KB新数据写入。即本来是写8KB的数据,却造成了整个块(512KB)的写入操作,也就是64倍放大。擦除的过程即为垃圾回收。可以看出,写放大的倍数越大,数据的写入效率越低,降低存储系统的数据存储效率。As shown in Figure 1, the storage system includes two log-structured objects, namely the system layer and the device layer. Each object supports the garbage collection algorithm to ensure that the storage system can implement a sequential write mechanism. This mechanism will cause write amplification, also known as write amplification, that is, the actual amount of physical data written is multiple times the theoretical value of the amount of data written. The reason is that, assuming that an 8KB data is to be written, but there is no free space at this time, but there is invalid data that can be erased, and the erasure is in blocks, so it is necessary to first write a block of data to the cache space or reserved space, then erase the block, and then write the 8KB new data. That is, originally 8KB of data was written, but it caused the entire block (512KB) to be written, that is, 64 times amplification. The erasure process is garbage collection. It can be seen that the larger the write amplification factor, the lower the data writing efficiency, which reduces the data storage efficiency of the storage system.
为了减少写放大对存储系统性能的不良影响,一般会在两个对象中分别设置一定的预留空间(over-provisioning,OP)以服务垃圾回收,保证存储系统的性能。其中系统层的空间主要用于存储系统层的垃圾回收算法、用户数据、元数据,以及用于服务系统层的垃圾回收算法,其中用于服务系统层的垃圾回收算法的部分可称为系统层的预留空间。设备层的空间主要用于存储设备层的垃圾回收算法、主机数据、元数据,以及用于服务设备层的垃圾回收算法的空间,其中用于服务设备层的垃圾回收算法的部分可称为设备层的预留空间。越大的预留空间,对写放大越友好,系统性能也越高,但是也带来了高成本的问题。In order to reduce the adverse effects of write amplification on the performance of the storage system, a certain amount of over-provisioning (OP) is generally set in the two objects to serve garbage collection and ensure the performance of the storage system. The space at the system layer is mainly used to store the garbage collection algorithm, user data, metadata at the system layer, and the garbage collection algorithm for serving the system layer. The part used to serve the garbage collection algorithm at the system layer can be called the reserved space at the system layer. The space at the device layer is mainly used to store the garbage collection algorithm, host data, metadata at the device layer, and the space used to serve the garbage collection algorithm at the device layer. The part used to serve the garbage collection algorithm at the device layer can be called the reserved space at the device layer. The larger the reserved space, the more friendly it is to write amplification and the higher the system performance, but it also brings the problem of high cost.
图2示出双层日志结构存储系统的系统层和设备层的预留空间分配方式的一个示例。在图2的示例中,在系统运行之前,根据用户需求,为系统层和设备层分别设置一个固定预留空间。其中,设备层的空间可包括设备可见空间和设备层的固定预留空间。系统层的空间可包括系统可见空间、磁盘阵列、热备份空间以及系统层的固定预留空间。设备可见空间的大小与系统层的空间的大小相同。系统可见空间以及磁盘阵列也对用户可见,因此系统可见空间以及磁盘阵列的总和也等于用户层的用户可见空间。FIG. 2 shows an example of a reserved space allocation method for the system layer and the device layer of a dual-layer log structure storage system. In the example of FIG. 2 , before the system is run, a fixed reserved space is set for the system layer and the device layer respectively according to user requirements. Among them, the space of the device layer may include the device visible space and the fixed reserved space of the device layer. The space of the system layer may include the system visible space, the disk array, the hot backup space and the fixed reserved space of the system layer. The size of the device visible space is the same as the size of the space of the system layer. The system visible space and the disk array are also visible to the user, so the sum of the system visible space and the disk array is also equal to the user visible space of the user layer.
在图2的示例中,对于设备层而言,其可用预留空间的最大值等于设备层的固定预留空间的大小。对于系统层而言,其可用预留空间的最大值等于热备份空间、系统层的固定预留空间的总和。设备层和系统层的可用预留空间的最大值在存储系统后续运行中不会变化,也对用户不可见。在此情况下,存在系统层的预留空间有限,导致写压力很大,进而导致存储系统的系统层到设备层的网络连接性能较差的情况。In the example of Figure 2, for the device layer, the maximum value of its available reserved space is equal to the size of the fixed reserved space of the device layer. For the system layer, the maximum value of its available reserved space is equal to the sum of the hot backup space and the fixed reserved space of the system layer. The maximum values of the available reserved space of the device layer and the system layer will not change in the subsequent operation of the storage system and will not be visible to the user. In this case, there is a situation where the reserved space of the system layer is limited, resulting in a large write pressure, which in turn leads to poor network connection performance from the system layer to the device layer of the storage system.
另一些存储系统改进了设备层的硬件设备,通过设备层主动将改进后的接口暴露给系统层,可实现设备层空间几乎没有预留空间,而是全由系统层控制系统层以及设备层的预留空间分配,变相扩大了系统层的预留空间大小。比如多流固态硬盘(multi-stream solid state disk,MS-SSD),固态硬盘内部可以提供多流标记,将用户标记的数据特性带入到固态硬盘内部,实现用户层-系统层-设备层的控制。又例如开放通道固态硬盘(open channel solid state disk,OC-SSD),将固态硬盘内部的可以并行操作的特性暴露给了用户,由用户决定地址映射、擦除、输入/输出调度等,实现用户层-系统层-设备层的控制。又例如分区命名空间固态硬盘 (zone namespaces solid state disk,ZNS-SSD),作为开放通道固态硬盘的衍生类型,提出分区的概念,设备层分区的擦除逻辑交由主机端的系统层控制,从而实现由系统层控制固态硬盘内部管理,进而消除固态硬盘的垃圾回收的写放大影响,减少固态硬盘侧的固定预留空间。Some other storage systems have improved the hardware devices of the device layer, and actively exposed the improved interface to the system layer through the device layer, so that there is almost no reserved space in the device layer. Instead, the reserved space allocation of the system layer and the device layer is entirely controlled by the system layer, which in disguise expands the size of the reserved space of the system layer. For example, a multi-stream solid state disk (MS-SSD) can provide multi-stream tags inside the SSD, bringing the data characteristics of the user tags into the SSD to achieve control from the user layer to the system layer to the device layer. Another example is an open channel solid state disk (OC-SSD), which exposes the parallel operation characteristics of the SSD to the user, and the user decides the address mapping, erasure, input/output scheduling, etc., to achieve control from the user layer to the system layer to the device layer. Another example is the zone namespaces solid state disk (ZNS-SSD), as a derivative type of open channel SSD, which proposes the concept of partitioning. The erase logic of the device layer partition is controlled by the system layer on the host side, so that the internal management of the SSD is controlled by the system layer, thereby eliminating the write amplification effect of garbage collection of the SSD and reducing the fixed reserved space on the SSD side.
使用上述定制化的硬件设备的存储系统的缺点在于,一是由定制的硬件设备内部自己提供特别定制的接口,并暴露给系统层才能达成减少固定预留空间的目标,通用的硬件设备的不适用,因此对硬件的依赖性过强,接口通用性差。二是将底层硬件的管理交由上层决策,需要系统层的软件栈重新设计,软件栈生态成本以及后期维护成本高,用户的操作复杂等问题,对用户极其不友好。The disadvantages of using the above-mentioned storage system with customized hardware devices are that, first, the customized hardware device itself provides a specially customized interface and exposes it to the system layer to achieve the goal of reducing the fixed reserved space, which is not applicable to general hardware devices. Therefore, the dependence on hardware is too strong and the interface is not universal. Second, the management of the underlying hardware is handed over to the upper layer for decision-making, which requires the redesign of the software stack of the system layer. The software stack has high ecological costs and subsequent maintenance costs, and the user's operation is complicated, which is extremely unfriendly to users.
有鉴于此,提出了一种资源分配方法、装置、存储介质及程序产品,根据本申请实施例的资源分配方法,在系统运行时也能动态调整第两个对象的预留空间的配置方式,使得存资源分配方式更灵活,降低写放大对系统性能的影响。且不需对接口进行特别设计,因此无需针对接口重新进行软件栈的对应设计,可以降低数据处理成本和运维成本,优化用户体验。In view of this, a resource allocation method, device, storage medium and program product are proposed. According to the resource allocation method of the embodiment of the present application, the configuration mode of the reserved space of the second object can also be dynamically adjusted when the system is running, so that the storage resource allocation mode is more flexible and the impact of write amplification on system performance is reduced. And there is no need to specially design the interface, so there is no need to redesign the software stack for the interface, which can reduce data processing costs and operation and maintenance costs and optimize user experience.
图3a和图3b分别示出根据本申请实施例的资源分配方法的一种示例性应用场景。FIG. 3a and FIG. 3b respectively illustrate an exemplary application scenario of the resource allocation method according to an embodiment of the present application.
如图3a和图3b所示,本申请实施例的资源分配方法可以应用于双层日志结构的存储系统中,存储系统可以包括两个基于日志结构的对象,两个对象均为追加顺序写机制,均需要通过垃圾回收腾出空间,因此设置有垃圾回收算法。As shown in Figures 3a and 3b, the resource allocation method of an embodiment of the present application can be applied to a storage system with a double-layer log structure. The storage system may include two objects based on the log structure. Both objects are append-sequential write mechanisms and both require space to be freed up through garbage collection. Therefore, a garbage collection algorithm is provided.
图3a的示例中,两个对象可以分别是系统层和设备层,设备层可以包括通用的固态硬盘,存储系统可以是基于固态硬盘的双层日志结构存储系统。系统层可以包括系统可见空间、磁盘阵列(系统可见空间、磁盘阵列的总和即用户可见空间)、热备份空间以及初始预留空间,其中,系统层的热备份空间例如可以是图2中系统层的热备份空间,初始预留空间可以是图2中系统层的固定预留空间,用户可见空间可以是图2中系统层系统可见空间和磁盘阵列。系统可见空间、磁盘阵列、热备份空间中的一个或多个能够用于存储垃圾回收算法、用户数据、元数据等。设备层的固态硬盘可以包括设备可见空间和初始预留空间,设备层的初始预留空间例如可以是图2中设备层的固定预留空间。设备可见空间能够用于存储垃圾回收算法、用户数据、元数据等。系统层的初始预留空间、热备份空间以及用户可见空间中未被使用的部分共同作为系统层的可用预留空间,设备层的初始预留空间作为设备层的可用预留空间,系统层和设备层的可用预留空间的空间总和(下文简称为空间总和)共享,在系统运行过程中按应用场景需求分配给系统层和设备层,以服务系统层和设备层的垃圾回收算法。In the example of FIG. 3a, the two objects may be a system layer and a device layer, respectively. The device layer may include a general solid-state hard disk, and the storage system may be a double-layer log structure storage system based on a solid-state hard disk. The system layer may include a system-visible space, a disk array (the sum of the system-visible space and the disk array is the user-visible space), a hot backup space, and an initial reserved space, wherein the hot backup space of the system layer may be, for example, the hot backup space of the system layer in FIG. 2, the initial reserved space may be the fixed reserved space of the system layer in FIG. 2, and the user-visible space may be the system-visible space and the disk array of the system layer in FIG. 2. One or more of the system-visible space, the disk array, and the hot backup space can be used to store garbage collection algorithms, user data, metadata, etc. The solid-state hard disk of the device layer may include a device-visible space and an initial reserved space, and the initial reserved space of the device layer may be, for example, the fixed reserved space of the device layer in FIG. 2. The device-visible space can be used to store garbage collection algorithms, user data, metadata, etc. The initial reserved space of the system layer, the hot backup space, and the unused portion of the user-visible space are collectively used as the available reserved space of the system layer. The initial reserved space of the device layer is used as the available reserved space of the device layer. The total space of the available reserved space of the system layer and the device layer (hereinafter referred to as the total space) is shared and allocated to the system layer and the device layer according to the requirements of the application scenarios during system operation to serve the garbage collection algorithms of the system layer and the device layer.
在图3b的示例中,两个对象可以分别是系统层和应用层,应用层可以包括键值分离的日志结构应用程序,存储系统可以是双层日志结构文件系统,例如闪存友好文件系统(flash friendly file-system,F2FS)。系统层可以包括系统可见空间、磁盘阵列(系统可见空间、磁盘阵列的总和即用户可见空间)、热备份空间以及初始预留空间,其中,系统层的热备份空间例如可以是图2中系统层的热备份空间,初始预留空间可以是图2中系统层的固定预留空间,用户可见空间可以是图2中系统层系统可见空间和磁盘阵列。系统可见空间、磁盘阵列、热备份空间中的一个或多个能够用于存储垃圾回收算法、用户数据、元数据等。应用层可以包括应用可见空间和初始预留空间。应用可见空间能够用于存储垃圾回收算法、应用数据、元数据等。系统层的初始预留空间、热备份空间以及用户可见空间中未被使用的部分共同作为系统层的可用预留空间,应用层的初始预留空间作为应用层的可用预留空间,系统层和应用层的预留空间的空间总和(下文简称为空间总和)共享,在系统运行过程中按应用场景需求分配给系统层和应用层,以服务系统层和应用层的垃圾回收算法。In the example of FIG3b, the two objects may be a system layer and an application layer, respectively. The application layer may include a key-value separated log structure application, and the storage system may be a two-layer log structure file system, such as a flash friendly file-system (F2FS). The system layer may include a system visible space, a disk array (the sum of the system visible space and the disk array is the user visible space), a hot backup space, and an initial reserved space, wherein the hot backup space of the system layer may be, for example, the hot backup space of the system layer in FIG2, the initial reserved space may be the fixed reserved space of the system layer in FIG2, and the user visible space may be the system visible space and the disk array of the system layer in FIG2. One or more of the system visible space, the disk array, and the hot backup space may be used to store garbage collection algorithms, user data, metadata, etc. The application layer may include an application visible space and an initial reserved space. The application visible space may be used to store garbage collection algorithms, application data, metadata, etc. The initial reserved space of the system layer, the hot backup space, and the unused portion of the user-visible space are collectively used as the available reserved space of the system layer. The initial reserved space of the application layer is used as the available reserved space of the application layer. The total space of the reserved space of the system layer and the application layer (hereinafter referred to as the total space) is shared and allocated to the system layer and the application layer according to the requirements of the application scenario during system operation to serve the garbage collection algorithms of the system layer and the application layer.
如图3a和图3b所示的存储系统可以设置在终端设备或者服务器上,举例来说,本申请的终端设备可以是智能手机、上网本、平板电脑、笔记本电脑、可穿戴电子设备(如智能手环、智能手表等)、TV、虚拟现实设备、音响、电子墨水,等等。The storage system shown in Figures 3a and 3b can be set on a terminal device or a server. For example, the terminal device of the present application can be a smart phone, a netbook, a tablet computer, a laptop computer, a wearable electronic device (such as a smart bracelet, a smart watch, etc.), a TV, a virtual reality device, a speaker, electronic ink, etc.
图4示出根据本申请实施例的资源分配方法的流程的示意图。FIG4 is a schematic diagram showing a process of a resource allocation method according to an embodiment of the present application.
如图4所示,在一种可能的实现方式中,本申请提出一种资源分配方法,所述方法包括步骤S41-S42:As shown in FIG. 4 , in a possible implementation, the present application proposes a resource allocation method, the method comprising steps S41-S42:
步骤S41,获取第一对象的可用预留空间的大小和第二对象的可用预留空间的大小。Step S41, obtaining the size of the available reserved space of the first object and the size of the available reserved space of the second object.
其中,第一对象和第二对象可以分别是系统(例如上文所述的存储系统)所包括的基于日志结构的对象。其中第一对象可以包括系统层,第二对象可以包括设备层或者包括应用层。可用预留空间可以是根据对象的硬件参数和实际使用情况确定的,当前时刻该对象上允许被用于垃圾回收的空间的总和。第一对象的可用预留空间的大小和第二对象的可用预留空间的大小相加可以得到空间总和。空间总和可以被第一对象和第二对象共享,并且是本申请实施例要分配给第一对象和第二对象的资源。Among them, the first object and the second object can be log-structured objects included in the system (such as the storage system described above). The first object may include a system layer, and the second object may include a device layer or an application layer. The available reserved space can be determined based on the hardware parameters and actual usage of the object, and the sum of the space allowed to be used for garbage collection on the object at the current moment. The size of the available reserved space of the first object and the size of the available reserved space of the second object can be added to obtain the total space. The total space can be shared by the first object and the second object, and is the resource to be allocated to the first object and the second object in an embodiment of the present application.
步骤S42,根据用户负载的特性参数以及垃圾回收算法的类型参数调整所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小。Step S42: adjusting the size of the actual reserved space of the first object and the size of the actual reserved space of the second object according to the characteristic parameters of the user load and the type parameters of the garbage collection algorithm.
用户负载的特性参数可以指示用户负载的情况,不同的用户负载下需求的预留空间大小可能不同。其具体获取方式可以参见下文及图5-图7的相关描述。垃圾回收算法可以有多种类型,不同类型垃圾回收算法下需求的预留空间大小也可能不同。垃圾回收算法的类型参数可以根据系统对垃圾回收算法的配置信息确定,可以通过两个对象提供接口获取,其获取方式可以基于现有技术来实现,在此不再赘述。The characteristic parameters of the user load can indicate the user load situation, and the size of the reserved space required under different user loads may be different. The specific acquisition method can be found in the following text and the relevant descriptions of Figures 5-7. There can be many types of garbage collection algorithms, and the size of the reserved space required under different types of garbage collection algorithms may also be different. The type parameter of the garbage collection algorithm can be determined based on the system's configuration information for the garbage collection algorithm, and can be obtained through the interface provided by two objects. The acquisition method can be implemented based on the existing technology and will not be repeated here.
在第一对象的可用预留空间的大小和第二对象的可用预留空间的大小的空间总和、特性参数、类型参数一定时,空间总和分配给第一对象和第二对象的空间,分别作为第一对象的实际预留空间和第二对象的实际预留空间,其中分配方式可以有多种,每种分配方式下存储系统的性能可能不同。通过这种方式可完成第一对象的实际预留空间的大小和第二对象的实际预留空间的大小的调整。调整后的第一对象的可用预留空间的大小和第二对象的可用预留空间的大小可以是与当前系统最适合的,因此能够提升系统的性能。When the sum of the space, characteristic parameters, and type parameters of the size of the available reserved space of the first object and the size of the available reserved space of the second object are constant, the sum of the space is allocated to the space of the first object and the second object as the actual reserved space of the first object and the actual reserved space of the second object, respectively, wherein there can be multiple allocation methods, and the performance of the storage system may be different under each allocation method. In this way, the size of the actual reserved space of the first object and the size of the actual reserved space of the second object can be adjusted. The adjusted size of the available reserved space of the first object and the size of the available reserved space of the second object can be the most suitable for the current system, thereby improving the performance of the system.
根据本申请实施例的资源分配方法,通过获取第一对象的可用预留空间的大小和第二对象的可用预留空间的大小,能够确定由第一对象和第二对象的硬件参数和实际使用情况决定的可用预留空间大小;根据用户负载的特性参数以及垃圾回收算法的类型参数调整第一对象的实际预留空间的大小和第二对象的实际预留空间的大小,使得第一对象的实际预留空间大小不受限于第一对象的硬件参数,第二对象的实际预留空间大小也不受限于第一对象的硬件参数,在软件层次上实现了实际预留空间大小的灵活调整;在系统包括第一对象和第二对象时,在系统运行时也能动态调整第两个对象的实际预留空间的配置方式,使得资源分配方式更灵活;通过综合用户负载的特性参数以及垃圾回收算法的类型参数等对系统有影响的多方面因素,实现了资源的合理分配,因此能够降低写放大对系统性能的影响。且分配并不需对接口进行特别设计,因此也无需重新进行软件栈的对应设计,可以降低数据处理成本和运维成本,优化用户体验。 According to the resource allocation method of the embodiment of the present application, by obtaining the size of the available reserved space of the first object and the size of the available reserved space of the second object, the size of the available reserved space determined by the hardware parameters and actual usage of the first object and the second object can be determined; the size of the actual reserved space of the first object and the size of the actual reserved space of the second object are adjusted according to the characteristic parameters of the user load and the type parameters of the garbage collection algorithm, so that the actual reserved space size of the first object is not limited by the hardware parameters of the first object, and the actual reserved space size of the second object is not limited by the hardware parameters of the first object, and the flexible adjustment of the actual reserved space size is realized at the software level; when the system includes the first object and the second object, the configuration method of the actual reserved space of the second object can also be dynamically adjusted when the system is running, so that the resource allocation method is more flexible; by integrating the characteristic parameters of the user load and the type parameters of the garbage collection algorithm and other factors that affect the system, reasonable allocation of resources is realized, so the impact of write amplification on system performance can be reduced. And the allocation does not require special design of the interface, so there is no need to redesign the corresponding software stack, which can reduce data processing costs and operation and maintenance costs, and optimize user experience.
下面分别介绍第二对象不同时,第二对象的可用预留空间的确定方式。The following describes how to determine the available reserved space of the second object when the second object is different.
在一种可能的实现方式中,所述第一对象和所述第二对象设置在存储系统中,所述存储系统运行所述垃圾回收算法,In a possible implementation, the first object and the second object are set in a storage system, and the storage system runs the garbage collection algorithm.
所述第一对象包括所述存储系统的系统层,所述第二对象包括所述存储系统的设备层,The first object includes a system layer of the storage system, and the second object includes a device layer of the storage system.
所述第一对象的可用预留空间包括所述系统层的热备份空间、初始预留空间以及用户可见空间中未被使用的空间;The available reserved space of the first object includes the hot backup space of the system layer, the initial reserved space, and the unused space in the user visible space;
所述第二对象的可用预留空间包括所述设备层的初始预留空间;The available reserved space of the second object includes the initial reserved space of the device layer;
其中,所述系统层的热备份空间、初始预留空间以及所述设备层的初始预留空间不变。Among them, the hot backup space and the initial reserved space of the system layer and the initial reserved space of the device layer remain unchanged.
举例来说,第一对象包括存储系统的系统层,第二对象包括存储系统的设备层时,存储系统的示例可以参见图3a。其中,设备层可以包括通用的硬件设备,例如通用的固态硬盘,而不必使用定制的硬件设备,如上文所述的多流固态硬盘MS-SSD、开放通道固态硬盘OC-SSD、分区命名空间固态硬盘ZNS-SSD等等。For example, when the first object includes the system layer of the storage system and the second object includes the device layer of the storage system, an example of the storage system can be shown in Figure 3a. The device layer can include general hardware devices, such as general solid-state drives, without using customized hardware devices, such as the multi-stream solid-state drive MS-SSD, open channel solid-state drive OC-SSD, partition namespace solid-state drive ZNS-SSD, etc. mentioned above.
此时第一对象的可用预留空间可以包括系统层的热备份空间、初始预留空间以及用户可见空间中未被使用的空间。系统层的热备份空间、初始预留空间可以是系统运行前设置好的,因此可以是固定不变的。在此情况下,对于第一对象的可用预留空间而言,可变的部分在于系统层的用户可见空间中未被使用的空间的大小。其中,系统层的热备份空间例如可以是图2中系统层的热备份空间,初始预留空间可以是图2中系统层的固定预留空间,用户可见空间可以是图2中系统层的系统可见空间和磁盘阵列。At this time, the available reserved space of the first object may include the hot backup space of the system layer, the initial reserved space, and the unused space in the user-visible space. The hot backup space and the initial reserved space of the system layer may be set before the system is run, and therefore may be fixed. In this case, for the available reserved space of the first object, the variable part lies in the size of the unused space in the user-visible space of the system layer. Among them, the hot backup space of the system layer may be, for example, the hot backup space of the system layer in Figure 2, the initial reserved space may be the fixed reserved space of the system layer in Figure 2, and the user-visible space may be the system-visible space and disk array of the system layer in Figure 2.
第二对象的可用预留空间可以包括设备层的初始预留空间。设备层的初始预留空间可以是系统运行前设置好的,因此也可以是固定不变的。在此情况下,第二对象的可用预留空间也可以固定不变。其中,设备层的初始预留空间例如可以是图2中设备层的固定预留空间。The available reserved space of the second object may include the initial reserved space of the device layer. The initial reserved space of the device layer may be set before the system is run, and thus may be fixed. In this case, the available reserved space of the second object may also be fixed. The initial reserved space of the device layer may be, for example, the fixed reserved space of the device layer in FIG. 2.
因此,系统运行过程中,每次执行步骤S41时,第一对象的可用预留空间的大小需实时获取,而第二对象的可用预留空间的大小可以在第一次执行步骤S41时、或者系统运行之前获取一次即可,后续需要获取第二对象的可用预留空间的大小时,可以直接使用已经获取过的第二对象的可用预留空间的大小。Therefore, during the operation of the system, each time step S41 is executed, the size of the available reserved space of the first object needs to be obtained in real time, while the size of the available reserved space of the second object can be obtained once when step S41 is executed for the first time or before the system runs. When the size of the available reserved space of the second object needs to be obtained subsequently, the size of the available reserved space of the second object that has been obtained can be directly used.
通过这种方式,使得本申请实施例的资源分配方法可以应用于基于通用的硬件设备的存储系统,由于无需定制硬件设备,因此也无需设计和维护对应的软件栈,可以降低资源分配方法对于硬件设备的依赖,提升资源分配方法普适性;在系统层软件配置与设备层硬件配置特定的前提下,能够使存储系统中不同对象间的网络连接保持较好的性能,提高设备层空间的利用率,降低写放大,延长设备层硬件寿命,降低成本。In this way, the resource allocation method of the embodiment of the present application can be applied to a storage system based on a general hardware device. Since there is no need to customize the hardware device, there is no need to design and maintain the corresponding software stack, which can reduce the dependence of the resource allocation method on the hardware device and improve the universality of the resource allocation method. Under the premise of specific system-level software configuration and device-level hardware configuration, the network connection between different objects in the storage system can maintain good performance, improve the utilization of the device-level space, reduce write amplification, extend the life of the device-level hardware, and reduce costs.
在一种可能的实现方式中,所述第一对象和所述第二对象设置在存储系统中,所述存储系统运行所述垃圾回收算法,In a possible implementation, the first object and the second object are set in a storage system, and the storage system runs the garbage collection algorithm.
所述第一对象包括所述存储系统的系统层,所述第二对象包括所述存储系统的应用层,The first object includes a system layer of the storage system, and the second object includes an application layer of the storage system.
所述第一对象的可用预留空间包括所述系统层的热备份空间、初始预留空间以及用户可见空间中未被使用的空间;The available reserved space of the first object includes the hot backup space of the system layer, the initial reserved space, and the unused space in the user visible space;
所述第二对象的可用预留空间包括所述应用层的初始预留空间;The available reserved space of the second object includes the initial reserved space of the application layer;
其中,所述系统层的热备份空间、初始预留空间不变。Among them, the hot backup space and the initial reserved space of the system layer remain unchanged.
举例来说,第一对象包括存储系统的系统层,第二对象包括存储系统的应用层时,存储系统的示例可以参见图3b。此时第一对象的可用预留空间可以包括系统层的热备份空间(例如图2中系统层的热备份空间)、初始预留空间(例如图2中系统层的固定预留空间)以及用户可见空间(例如图2中系统层的系统可见空间和磁盘阵列)中未被使用的空间。系统层的热备份空间、初始预留空间可以是系统运行前设置好的,因此可以是固定不变的。在此情况下,对于第一对象的可用预留空间而言,可变的部分在于系统层的用户可见空间中未被使用的空间的大小。For example, when the first object includes the system layer of the storage system and the second object includes the application layer of the storage system, an example of the storage system can be seen in Figure 3b. At this time, the available reserved space of the first object can include the hot backup space of the system layer (such as the hot backup space of the system layer in Figure 2), the initial reserved space (such as the fixed reserved space of the system layer in Figure 2), and the unused space in the user-visible space (such as the system-visible space and disk array of the system layer in Figure 2). The hot backup space and the initial reserved space of the system layer can be set before the system is run, and therefore can be fixed. In this case, for the available reserved space of the first object, the variable part lies in the size of the unused space in the user-visible space of the system layer.
第二对象的可用预留空间可以包括应用层的初始预留空间。应用层的初始预留空间可以是系统运行前设置好的,在系统运行过程中不变,在此情况下,第二对象的可用预留空间也可以固定不变。或者,应用层的初始预留空间也可以设置为可以在系统运行过程中随用户需求而变化。在此情况下,对于第二对象的可用预留空间而言,可变的部分在于应用层的初始预留空间的实时大小。其中,应用层的初始预留空间可参见图3b中的示例。The available reserved space of the second object may include the initial reserved space of the application layer. The initial reserved space of the application layer may be set before the system is run and remain unchanged during the system operation. In this case, the available reserved space of the second object may also be fixed. Alternatively, the initial reserved space of the application layer may also be set to be variable according to user needs during the system operation. In this case, for the available reserved space of the second object, the variable part is the real-time size of the initial reserved space of the application layer. The initial reserved space of the application layer can be seen in the example in Figure 3b.
因此,系统运行过程中,每次执行步骤S41时,第一对象的可用预留空间的大小需实时获取,而第二对象的可用预留空间的大小可以根据系统的设置方式获取,如果应用层的初始预留空间固定不变,则第二对象的可用预留空间的大小在第一次执行步骤S41时、或者系统运行之前获取一次即可,后续需要获取第二对象的可用预留空间的大小时,可以直接使用已经获取过的第二对象的可用预留空间的大小;如果第二对象的可用预留空间的大小可变,则第二对象的可用预留空间的大小也需实时获取。Therefore, during the operation of the system, each time step S41 is executed, the size of the available reserved space of the first object needs to be obtained in real time, and the size of the available reserved space of the second object can be obtained according to the system settings. If the initial reserved space of the application layer is fixed, the size of the available reserved space of the second object only needs to be obtained once when step S41 is executed for the first time or before the system runs. When the size of the available reserved space of the second object needs to be obtained subsequently, the size of the available reserved space of the second object that has been obtained can be directly used; if the size of the available reserved space of the second object is variable, the size of the available reserved space of the second object also needs to be obtained in real time.
通过这种方式,使得本申请实施例的资源分配方法可以应用于双层日志结构的任意存储系统,可以进一步提升资源分配方法的普适性,扩展资源分配方法的应用场景。In this way, the resource allocation method of the embodiment of the present application can be applied to any storage system with a double-layer log structure, which can further improve the universality of the resource allocation method and expand the application scenarios of the resource allocation method.
实际应用中,可用预留空间对应的硬件存储设备可能会存在一些坏块(block),可以认为该部分坏块对应的空间已经被占用且无法被擦除。在此情况下,第一对象和第二对象的可用预留空间可能产生变化。由于坏块可能在系统运行过程中随时出现,因此,为了使确定的最佳配置方式更准确,也可以每次执行步骤S41时,均获取一次第一对象的可用预留空间的大小和第二对象的可用预留空间的大小。本申请对于第一对象的可用预留空间的大小和第二对象的可用预留空间的大小的获取频率不作限制。In actual applications, the hardware storage device corresponding to the available reserved space may have some bad blocks, and it can be considered that the space corresponding to the bad blocks is occupied and cannot be erased. In this case, the available reserved space of the first object and the second object may change. Since bad blocks may appear at any time during the operation of the system, in order to make the determined optimal configuration method more accurate, the size of the available reserved space of the first object and the size of the available reserved space of the second object may be obtained once each time step S41 is executed. The present application does not limit the frequency of obtaining the size of the available reserved space of the first object and the size of the available reserved space of the second object.
下面介绍本申请实施例获取用户负载的特性参数的示例性方法。图5示出根据本申请实施例获取用户负载的特性参数的方法的示意图。The following is an exemplary method for obtaining characteristic parameters of user load according to an embodiment of the present application. Fig. 5 is a schematic diagram of a method for obtaining characteristic parameters of user load according to an embodiment of the present application.
如图5所示,在一种可能的实现方式中,步骤S42之前,所述方法还包括:As shown in FIG. 5 , in a possible implementation manner, before step S42, the method further includes:
确定预设时间窗口内的用户输入/输出访问对象及频次;Determine the user input/output access objects and frequencies within a preset time window;
根据所述频次的高低对所述访问对象进行排序,构建统计直方图;Sorting the access objects according to the frequency and constructing a statistical histogram;
基于所述统计直方图,确定所述频次与所述访问对象的排序序号的线性关系;Based on the statistical histogram, determining a linear relationship between the frequency and the sorting sequence number of the access object;
根据所述线性关系的斜率确定所述用户负载的特性参数。The characteristic parameter of the user load is determined according to the slope of the linear relationship.
举例来说,在系统实时运行中,用户可能会产生多个输入/输出访问请求,根据访问请求所包括的信息,可以确定出预设时间窗口内的用户输入/输出访问对象及频次。如图5所示,预设时间窗口内,按照时间由早到晚的顺序,访问对象可以依次是ABCDEBDC,则访问对象可以包括A、B、C、D、E,各访问对象的频次可以分别是访问A频次:1、访问B频次:2、访问C频次:2、访问D频次:2、访问E频次:1。预设时间窗口可以根据用户需求设置,本申请对于预设时间窗口的设置方式不作限制。For example, in the real-time operation of the system, the user may generate multiple input/output access requests. According to the information included in the access request, the user input/output access object and frequency within the preset time window can be determined. As shown in Figure 5, within the preset time window, in the order from early to late, the access objects can be ABCDEBDC, then the access objects can include A, B, C, D, E, and the frequency of each access object can be access A frequency: 1, access B frequency: 2, access C frequency: 2, access D frequency: 2, access E frequency: 1. The preset time window can be set according to user needs, and this application does not limit the setting method of the preset time window.
根据频次的高低对访问对象进行排序,可以构建出统计直方图,统计直方图的横坐标可以是访问对象的排序序号,纵坐标可以是频次的数值。参见上例,按照从高到低的顺序,访问对象的排序为B、C、D(均为2次),A、E(均为1次),其中B、C、D之间的排序可以随机确定,A、E之间的排序可以随机确定,所得到的统计直方图横坐标可以是B、C、D、A、E,纵坐标可以是这些访问对象分别对应的访问频次。基于统计直方图,可以确定频次与访问对象的排序序号的线性关系,例如可以分别取频次以及访问对象的排序序号的对数,再确定对数的线性关系,例如可以通过最小二乘法y=xα拟合计算出线性关系的斜率α,其中频次以及访问对象的排序序号的对数分别代入y和x,得到的线性关系的斜率α作为用户负载的特性参数。By sorting the access objects according to the frequency, a statistical histogram can be constructed. The horizontal axis of the statistical histogram can be the sorting number of the access object, and the vertical axis can be the value of the frequency. Referring to the above example, in order from high to low, the order of the access objects is B, C, D (all 2 times), A, E (all 1 time), where the order between B, C, D can be randomly determined, and the order between A and E can be randomly determined. The horizontal axis of the obtained statistical histogram can be B, C, D, A, E, and the vertical axis can be the access frequency corresponding to these access objects. Based on the statistical histogram, the linear relationship between the frequency and the sorting number of the access object can be determined. For example, the logarithm of the frequency and the sorting number of the access object can be taken respectively, and then the linear relationship of the logarithm can be determined. For example, the slope α of the linear relationship can be calculated by fitting the least squares method y=xα, where the logarithm of the frequency and the sorting number of the access object are substituted into y and x respectively, and the slope α of the obtained linear relationship is used as the characteristic parameter of the user load.
本领域技术人员应理解,基于统计直方图确定频次与访问对象的排序序号的线性关系,以及确定线性关系的斜率,也可以采用现有技术的其他方式来实现,本申请不作限制。Those skilled in the art should understand that determining the linear relationship between the frequency and the sorting number of the access object based on the statistical histogram, as well as determining the slope of the linear relationship, can also be achieved by other methods in the prior art, and this application does not limit this.
通过这种方式,可以完成用户负载的特性参数的实时确定。用户负载的特性参数的确定可以在系统运行前或者运行过程中随时进行,不会影响存储系统的正常运作,便于用户确定用户负载情况的同时,也为使用用户负载的特性参数调整第一对象的实际预留空间的大小和第二对象的实际预留空间的大小提供可能。In this way, the characteristic parameters of the user load can be determined in real time. The characteristic parameters of the user load can be determined at any time before or during the operation of the system, which will not affect the normal operation of the storage system, and is convenient for users to determine the user load situation. It also provides the possibility of adjusting the size of the actual reserved space of the first object and the size of the actual reserved space of the second object using the characteristic parameters of the user load.
下面介绍本申请实施例根据用户负载的特性参数以及垃圾回收算法的类型参数调整所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小(步骤S42)的示例性方法。The following describes an exemplary method for adjusting the size of the actual reserved space of the first object and the size of the actual reserved space of the second object (step S42) according to characteristic parameters of the user load and type parameters of the garbage collection algorithm according to an embodiment of the present application.
在一种可能的实现方式中,步骤S42包括:In a possible implementation, step S42 includes:
从预先设置的所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小的多种配置方式中,选择与所述第一对象的可用预留空间的大小和所述第二对象的可用预留空间的大小的空间总和、所述特性参数以及所述类型参数相匹配的配置方式,作为所述最佳配置方式;From among multiple preset configurations of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object, selecting a configuration that matches the sum of the available reserved space of the first object and the available reserved space of the second object, the characteristic parameter, and the type parameter as the optimal configuration;
根据所述最佳配置方式,调整所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小。According to the optimal configuration mode, the size of the actual reserved space of the first object and the size of the actual reserved space of the second object are adjusted.
举例来说,空间总和、特性参数以及类型参数可以有多种组合,可以预先设置第一对象的实际预留空间的大小和第二对象的实际预留空间的大小的多种配置方式,使得预先设置的配置方式包括空间总和、特性参数以及类型参数的每种组合下,使得存储系统的性能最好的第一对象的实际预留空间的大小和第二对象的实际预留空间的大小的配置方式。也即,与第一对象的可用预留空间的大小和第二对象的可用预留空间的大小的空间总和、特性参数以及类型参数相匹配的配置方式,可以是第一对象的实际预留空间的大小和第二对象的实际预留空间的大小的最佳配置方式。For example, there may be multiple combinations of the sum of space, characteristic parameters, and type parameters, and multiple configuration modes of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object may be pre-set, so that the pre-set configuration mode includes the configuration mode of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object that achieves the best performance of the storage system under each combination of the sum of space, characteristic parameters, and type parameters. That is, the configuration mode that matches the sum of space, characteristic parameters, and type parameters of the size of the available reserved space of the first object and the size of the available reserved space of the second object may be the best configuration mode of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object.
第一对象的实际预留空间的大小和第二对象的实际预留空间的大小的多种配置方式的获取方式及示例,可以参见下文及表1的相关描述。例如,参见表1,空间总和为R1、特性参数为α1、类型参数为GC Algor1时,与空间总和、特性参数以及类型参数相匹配的配置方式可以是M1;N1。其中第一对象的实际预留空间的大小为M1,第二对象的实际预留空间的大小为N1。在调整第一对象的实际预留空间的大小和第二对象的实际预留空间的大小时,将第一对象的实际预留空间的大小调整至M1,将第二对象的实际预留空间的大小调整至N1即可。其示例性实现方式可以参见下文及图8的相关描述。For methods and examples of obtaining various configuration methods of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object, please refer to the relevant description below and Table 1. For example, referring to Table 1, when the space sum is R1, the characteristic parameter is α1, and the type parameter is GC Algor1, the configuration method that matches the space sum, the characteristic parameter, and the type parameter can be M1; N1. The size of the actual reserved space of the first object is M1, and the size of the actual reserved space of the second object is N1. When adjusting the size of the actual reserved space of the first object and the size of the actual reserved space of the second object, adjust the size of the actual reserved space of the first object to M1, and adjust the size of the actual reserved space of the second object to N1. Its exemplary implementation method can be referred to the relevant description below and Figure 8.
通过这种方式,可以在系统运行过程中快速确定最佳配置方式,进而提升从获取第一对象的可用预留空间大小和第二对象的可用预留空间大小到调整第一对象的实际预留空间的大小和第二对象的实际预留空间的大小的效率。In this way, the best configuration method can be quickly determined during system operation, thereby improving the efficiency from obtaining the available reserved space size of the first object and the available reserved space size of the second object to adjusting the actual reserved space size of the first object and the actual reserved space size of the second object.
下面介绍本申请实施例确定第一对象的实际预留空间的大小和第二对象的实际预留空间的大小的多种配置方式的示例性方法。The following describes an exemplary method for determining the size of the actual reserved space of the first object and the size of the actual reserved space of the second object in various configuration modes according to an embodiment of the present application.
在一种可能的实现方式中,所述方法还包括:In a possible implementation, the method further includes:
根据所述热备份空间、所述初始预留空间、所述用户可见空间、所述第二对象的可用预留空间,确定所述空间总和的取值范围;Determine a value range of the total space according to the hot backup space, the initial reserved space, the user visible space, and the available reserved space of the second object;
针对所述空间总和的取值范围中的每一数值,确定该数值下所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小的多种划分方式;For each value in the value range of the space sum, determine multiple division methods of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object under the value;
根据所述用户负载的多种特性参数、所述垃圾回收算法的多种类型参数、所述空间总和以及所述多种划分方式,确定所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小的多种配置方式。According to the multiple characteristic parameters of the user load, the multiple types of parameters of the garbage collection algorithm, the total space and the multiple division methods, multiple configuration methods of the actual reserved space size of the first object and the actual reserved space size of the second object are determined.
举例来说,由于空间总和指示第一对象和第二对象的可用预留空间的总和,且第一对象的可用预留空间包括系统层的热备份空间、初始预留空间以及用户可见空间中未被使用的空间,其中,热备份空间、初始预留空间固定不变,用户可见空间中未被使用的空间的最大值即为用户可见空间大小,用户可见空间中未被使用的空间的最小值为0,则根据热备份空间、初始预留空间、用户可见空间、第二对象的可用预留空间,可以确定空间总和的取值范围。For example, since the total space indicates the sum of the available reserved space of the first object and the second object, and the available reserved space of the first object includes the hot backup space at the system layer, the initial reserved space, and the unused space in the user-visible space, wherein the hot backup space and the initial reserved space are fixed, the maximum value of the unused space in the user-visible space is the user-visible space size, and the minimum value of the unused space in the user-visible space is 0, then the value range of the total space can be determined based on the hot backup space, the initial reserved space, the user-visible space, and the available reserved space of the second object.
针对空间总和的取值范围中的每一数值,可以确定该数值下第一对象的实际预留空间的大小和第二对象的实际预留空间的大小的多种划分方式。也即,满足“M+N=R;R∈[r1,r2]”的M和N的多种组合,其中M表示第一对象的实际预留空间的大小,N表示第二对象的实际预留空间的大小,R表示空间总和,r1,r2分别表示空间总和的最小值和最大值,R∈[r1,r2]表示空间总和的取值范围。For each value in the range of the space sum, multiple ways of dividing the size of the actual reserved space of the first object and the size of the actual reserved space of the second object under the value can be determined. That is, multiple combinations of M and N that satisfy "M+N=R; R∈[r1,r2]", where M represents the size of the actual reserved space of the first object, N represents the size of the actual reserved space of the second object, R represents the space sum, r1, r2 represent the minimum and maximum values of the space sum, respectively, and R∈[r1,r2] represents the value range of the space sum.
用户负载可以有多种特性参数,垃圾回收算法可以有多种类型参数,而存储系统性能与用户负载的特性参数、垃圾回收算法的类型参数、第一对象的实际预留空间的大小、第二对象的实际预留空间的大小均有关,因此,根据用户负载的多种特性参数、垃圾回收算法的多种类型参数、空间总和以及多种划分方式,可以枚举出存储系统可能存在的所有的资源分配方式,并能够确定每种资源分配方式对应的系统性能。从中筛选出性能最好的资源分配方式,即可确定为第一对象的实际预留空间的大小和第二对象的实际预留空间的大小的配置方式。The user load can have multiple characteristic parameters, and the garbage collection algorithm can have multiple types of parameters. The storage system performance is related to the characteristic parameters of the user load, the type parameters of the garbage collection algorithm, the size of the actual reserved space of the first object, and the size of the actual reserved space of the second object. Therefore, based on the multiple characteristic parameters of the user load, the multiple types of parameters of the garbage collection algorithm, the total space, and multiple division methods, all possible resource allocation methods of the storage system can be enumerated, and the system performance corresponding to each resource allocation method can be determined. The resource allocation method with the best performance can be selected to determine the configuration method of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object.
通过这种方式,使得可以确定第一对象的实际预留空间的大小和第二对象的实际预留空间的大小的多种配置方式。由于使用了与存储系统性能有关的用户负载的特性参数、垃圾回收算法的类型参数、空间总和以及多种划分方式作为确定多种配置方式的依据,使得确定的配置方式下存储系统性能得到保障。In this way, multiple configuration modes of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object can be determined. Since characteristic parameters of user load related to storage system performance, type parameters of garbage collection algorithm, total space and multiple division modes are used as the basis for determining multiple configuration modes, the storage system performance is guaranteed under the determined configuration mode.
在一种可能的实现方式中,所述根据所述用户负载的多种特性参数、所述垃圾回收算法的多种类型参数、所述空间总和以及所述多种划分方式,确定所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小的多种配置方式,包括:In a possible implementation, the multiple configuration methods of determining the size of the actual reserved space of the first object and the size of the actual reserved space of the second object according to the multiple characteristic parameters of the user load, the multiple type parameters of the garbage collection algorithm, the total space, and the multiple division methods include:
根据所述用户负载的多种特性参数、所述垃圾回收算法的多种类型参数、所述空间总和,确定所述特性参数、所述类型参数、所述空间总和的多种组合方式,其中,不同组合方式下的特性参数、类型参数、空间总和中的至少其中之一不同;Determine multiple combinations of the characteristic parameters, the type parameters, and the space sum according to the multiple characteristic parameters of the user load, the multiple type parameters of the garbage collection algorithm, and the space sum, wherein at least one of the characteristic parameters, the type parameters, and the space sum in different combinations is different;
针对所述特性参数、所述类型参数、所述空间总和的每种组合方式,分别确定所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小的每种划分方式的写放大因子;For each combination of the characteristic parameter, the type parameter, and the total space, respectively determine a write amplification factor for each division method of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object;
将每种组合方式下最小的写放大因子对应的第一对象的实际预留空间的大小和第二对象的实际预留空间的大小的划分方式,确定为所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小的一种配置方式。A division method of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object corresponding to the minimum write amplification factor in each combination method is determined as a configuration method of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object.
举例来说,根据用户负载的多种特性参数、垃圾回收算法的多种类型参数、空间总和,可以确定特性参数、类型参数、空间总和的多种组合方式。针对特性参数、类型参数、空间总和的任意一种组合,搭配不同的第一对象的实际预留空间的大小M和第二对象的实际预留空间的大小N的组合时,系统性能可能不同。可以从中筛选出性能最好的M和N的组合,作为该特性参数、类型参数、空间总和的组合下,第一对象的实际预留空间的大小M和第二对象的实际预留空间的大小N的最佳配置方式。通过遍历所有的特性参数、类型参数、空间总和的组合,找到每种组合下第一对象的实际预留空间的大小M和第二对象的实际预留空间的大小N的最佳配置方式,即可实现确定第一对象的实际预留空间的大小和第二对象的实际预留空间的大小的多种配置方式。For example, based on various characteristic parameters of user load, various type parameters of garbage collection algorithm, and the total space, various combinations of characteristic parameters, type parameters, and the total space can be determined. For any combination of characteristic parameters, type parameters, and the total space, when different combinations of the size M of the actual reserved space of the first object and the size N of the actual reserved space of the second object are used, the system performance may be different. The combination of M and N with the best performance can be screened out as the optimal configuration method of the size M of the actual reserved space of the first object and the size N of the actual reserved space of the second object under the combination of characteristic parameters, type parameters, and the total space. By traversing all combinations of characteristic parameters, type parameters, and the total space, the optimal configuration method of the size M of the actual reserved space of the first object and the size N of the actual reserved space of the second object under each combination is found, thereby realizing multiple configuration methods of determining the size of the actual reserved space of the first object and the size of the actual reserved space of the second object.
其中,系统性能的好坏,可以通过写放大因子(write amplification factor,WAF)来来体现。写放大因子是表征写放大的程度的一种参数。写放大因子的确定方式可以基于现有技术来实现,在此不再赘述。The performance of the system can be reflected by the write amplification factor (WAF). The write amplification factor is a parameter that characterizes the degree of write amplification. The determination method of the write amplification factor can be implemented based on the existing technology and will not be repeated here.
对于单个对象而言,写放大因子与垃圾回收算法、预留空间大小、用户负载等存在类似对数函数的关系。图6示出根据本申请实施例的单个对象的写放大因子与预留空间大小的函数关系的一个示例。如图6所示,预留空间越大,对应的写放大因子越小,表示对象性能越好。For a single object, the write amplification factor has a logarithmic function-like relationship with the garbage collection algorithm, the reserved space size, the user load, etc. FIG6 shows an example of a functional relationship between the write amplification factor and the reserved space size of a single object according to an embodiment of the present application. As shown in FIG6, the larger the reserved space, the smaller the corresponding write amplification factor, indicating that the object performance is better.
而如果考虑对象之间的网络连接的话,系统层级的写放大因子与两个对象的预留空间大小可以呈现凸函数的关系。图7示出根据本申请实施例的存储系统的写放大因子与两个对象的预留空间大小的函数关系的一个示例。如图7所示,特性参数、类型参数、预留空间总和R一定的前提下,写放大因子的最小值对应的两个对象的预留空间大小(即第一对象的实际预留空间的大小M和第二对象的实际预留空间的大小N),可以是该特性参数、类型参数、预留空间总和的组合下的最佳配置方式。表1示出本申请实施例确定的第一对象的实际预留空间的大小和第二对象的实际预留空间的大小的多种配置方式的一个示例。If the network connection between objects is considered, the write amplification factor at the system level and the reserved space size of the two objects can present a convex function relationship. Figure 7 shows an example of the functional relationship between the write amplification factor of the storage system according to an embodiment of the present application and the reserved space size of the two objects. As shown in Figure 7, under the premise that the characteristic parameters, type parameters, and the total reserved space R are certain, the reserved space size of the two objects corresponding to the minimum value of the write amplification factor (i.e., the size M of the actual reserved space of the first object and the size N of the actual reserved space of the second object) can be the optimal configuration method under the combination of the characteristic parameters, type parameters, and the total reserved space. Table 1 shows an example of multiple configuration methods for the size of the actual reserved space of the first object and the size of the actual reserved space of the second object determined in an embodiment of the present application.
表1
Table 1
在表1的示例中,用户负载的特性参数包括α1等,空间总和包括R1和R2等,垃圾回收算法的类型参数包括GC Algor1、GC Algor2等。则特性参数α1、类型参数GC Algor1、预留空间总和R1的组合下,第一对象的实际预留空间的大小和第二对象的实际预留空间的大小的最佳配置方式可以是M1;N1,其中M1可以指示第一对象的实际预留空间的大小,N1可以指示第二对象的实际预留空间的大小,M1+N1=R1。 In the example of Table 1, the characteristic parameters of the user load include α1, etc., the space sum includes R1 and R2, etc., and the type parameters of the garbage collection algorithm include GC Algor1, GC Algor2, etc. Then, under the combination of the characteristic parameter α1, the type parameter GC Algor1, and the reserved space sum R1, the optimal configuration mode of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object may be M1; N1, where M1 may indicate the size of the actual reserved space of the first object, N1 may indicate the size of the actual reserved space of the second object, and M1+N1=R1.
同理,特性参数α1、类型参数GC Algor1、预留空间总和R2的组合下,第一对象的实际预留空间的大小和第二对象的实际预留空间的大小的最佳配置方式可以是M2;N2,特性参数α1、类型参数GC Algor2、预留空间总和R1的组合下,第一对象的实际预留空间的大小和第二对象的实际预留空间的大小的最佳配置方式可以是M3;N3,特性参数α1、类型参数GC Algor2、预留空间总和R2的组合下,第一对象的实际预留空间的大小和第二对象的实际预留空间的大小的最佳配置方式可以是M4;N4。Similarly, under the combination of characteristic parameter α1, type parameter GC Algor1, and total reserved space R2, the optimal configuration method of the actual reserved space size of the first object and the actual reserved space size of the second object can be M2; N2, under the combination of characteristic parameter α1, type parameter GC Algor2, and total reserved space R1, the optimal configuration method of the actual reserved space size of the first object and the actual reserved space size of the second object can be M3; N3, under the combination of characteristic parameter α1, type parameter GC Algor2, and total reserved space R2, the optimal configuration method of the actual reserved space size of the first object and the actual reserved space size of the second object can be M4; N4.
本领域技术人员应理解,在表1中,第一对象的实际预留空间的大小和第二对象的实际预留空间的大小的最佳配置方式也可以使用其他特征来体现,以第一对象的实际预留空间的大小的数值为M1,第二对象的实际预留空间的大小的数值为N1为例,可以根据M1和N1确定二者的比例关系M1:N1,将M1:N1作为配置方式存储在表格中。本申请对于配置方式的具体存储方式不作限制。Those skilled in the art should understand that in Table 1, the optimal configuration of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object can also be reflected by using other features. For example, the value of the size of the actual reserved space of the first object is M1, and the value of the size of the actual reserved space of the second object is N1. The proportional relationship M1:N1 between the two can be determined based on M1 and N1, and M1:N1 can be stored in the table as a configuration method. This application does not limit the specific storage method of the configuration method.
本领域技术人员应理解,系统性能的好坏也可以使用写放大因子之外的其他参数来表征,本申请对于筛选性能最好的第一对象的实际预留空间的大小和第二对象的实际预留空间的大小的组合的具体方式不作限制。Those skilled in the art should understand that the quality of system performance can also be characterized by using other parameters besides the write amplification factor, and the present application does not limit the specific method of combining the size of the actual reserved space of the first object with the best screening performance and the size of the actual reserved space of the second object.
通过这种方式,可以完成第一对象的实际预留空间的大小和第二对象的实际预留空间的大小的多种配置方式的确定。最终确定的多种配置方式都是性能最优的,因此能够节省存储多种配置方式的成本。In this way, multiple configurations of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object can be determined. The multiple configurations finally determined are all optimal in performance, thus saving the cost of storing multiple configurations.
下面介绍本申请实施例根据最佳配置方式,调整第一对象的实际预留空间的大小和第二对象的实际预留空间的大小的示例性方法。The following describes an exemplary method for adjusting the size of the actual reserved space of the first object and the size of the actual reserved space of the second object according to the optimal configuration mode in an embodiment of the present application.
图8示出根据本申请实施例调整第一对象的实际预留空间的大小和第二对象的实际预留空间的大小的示意图。在图8的示例中,假设第一对象包括系统层,第二对象包括设备层,系统层的用户可用空间以及磁盘阵列中未被使用的空间的大小均为0,则系统层的可用预留空间(即第一对象的可用预留空间)的大小等于系统层的热备份空间、初始预留空间(预留空间1)之和,设备层的可用预留空间(即第二对象的可用预留空间)的大小等于设备层的初始预留空间(预留空间2),空间总和等于系统层的热备份空间、初始预留空间(预留空间1)以及设备层的初始预留空间(预留空间2)之和。虚线左半部分表示系统层的实际预留空间(即第一对象的实际预留空间)的大小,虚线右半部分表示设备层的实际预留空间(即第二对象的实际预留空间)的大小,则虚线左移表示第一对象的实际预留空间的大小增大,第二对象的实际预留空间的大小减小;虚线右移表示第一对象的实际预留空间的大小减小,第二对象的实际预留空间的大小增大。Fig. 8 shows a schematic diagram of adjusting the size of the actual reserved space of the first object and the size of the actual reserved space of the second object according to an embodiment of the present application. In the example of Fig. 8, assuming that the first object includes a system layer, the second object includes a device layer, and the size of the user available space of the system layer and the size of the unused space in the disk array are both 0, then the size of the available reserved space of the system layer (i.e., the available reserved space of the first object) is equal to the sum of the hot backup space and the initial reserved space (reserved space 1) of the system layer, the size of the available reserved space of the device layer (i.e., the available reserved space of the second object) is equal to the initial reserved space (reserved space 2) of the device layer, and the total space is equal to the sum of the hot backup space, the initial reserved space (reserved space 1) of the system layer, and the initial reserved space (reserved space 2) of the device layer. The left half of the dotted line represents the size of the actual reserved space at the system layer (i.e., the actual reserved space of the first object), and the right half of the dotted line represents the size of the actual reserved space at the device layer (i.e., the actual reserved space of the second object). If the dotted line moves to the left, it means that the size of the actual reserved space of the first object increases, while the size of the actual reserved space of the second object decreases; if the dotted line moves to the right, it means that the size of the actual reserved space of the first object decreases, while the size of the actual reserved space of the second object increases.
在一种可能的实现方式中,在所述最佳配置方式下,所述第一对象的实际预留空间的大小减小,所述第二对象的实际预留空间的大小增大时,所述根据所述最佳配置方式,调整所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小,包括以下至少其中之一:In a possible implementation, in the optimal configuration mode, when the size of the actual reserved space of the first object decreases and the size of the actual reserved space of the second object increases, adjusting the size of the actual reserved space of the first object and the size of the actual reserved space of the second object according to the optimal configuration mode includes at least one of the following:
降低所述垃圾回收算法的水位线参数,所述水位线参数的数值大于所述第一对象的实际预留空间的大小时所述垃圾回收算法启动;Lowering a watermark parameter of the garbage collection algorithm, wherein the garbage collection algorithm is started when the value of the watermark parameter is greater than the size of the actual reserved space of the first object;
提高所述垃圾回收算法的速度参数,所述速度参数指示所述存储系统执行所述垃圾回收算法时的垃圾回收速度;increasing a speed parameter of the garbage collection algorithm, the speed parameter indicating a garbage collection speed when the storage system executes the garbage collection algorithm;
减小所述垃圾回收算法的启动时延。 Reduce the startup delay of the garbage collection algorithm.
举例来说,如果最佳配置方式指示的第一对象的实际预留空间的大小相比当前时刻第一对象的实际预留空间的大小更小(即第一对象的实际预留空间的大小减小,第二对象的实际预留空间的大小增大),则可认为需要分配更少的实际预留空间给第一对象。也即,针对第一对象,需要加快垃圾回收的进程。在此情况下,可以采用以下方式中的至少一种对第一对象和第二对象的实际预留空间进行调整。For example, if the size of the actual reserved space of the first object indicated by the optimal configuration is smaller than the size of the actual reserved space of the first object at the current moment (i.e., the size of the actual reserved space of the first object is reduced, and the size of the actual reserved space of the second object is increased), it can be considered that less actual reserved space needs to be allocated to the first object. In other words, the garbage collection process needs to be accelerated for the first object. In this case, the actual reserved space of the first object and the second object can be adjusted in at least one of the following ways.
方式一可以是降低垃圾回收算法的水位线参数。水位线参数指示第一对象存储数据的最大容量,因此第一对象的实际预留空间的大小大于水位线参数的数值时,可认为第一对象尚有余量供新数据写入;第一对象的实际预留空间的大小等于水位线参数的数值时,可认为第一对象余量刚好为0;第一对象的实际预留空间的大小小于水位线参数的数值时,则需要擦除数据,也即,水位线参数的数值大于第一对象的实际预留空间的大小时需启动垃圾回收算法。垃圾回收算法一经启动即可进行垃圾回收,使得第一对象的实际预留空间的大小逐渐增大,直到达到最佳配置方式指示的第一对象的实际预留空间的大小。Method one may be to lower the watermark parameter of the garbage collection algorithm. The watermark parameter indicates the maximum capacity of the first object to store data. Therefore, when the size of the actual reserved space of the first object is greater than the value of the watermark parameter, it can be considered that the first object still has margin for new data to be written; when the size of the actual reserved space of the first object is equal to the value of the watermark parameter, it can be considered that the margin of the first object is exactly 0; when the size of the actual reserved space of the first object is less than the value of the watermark parameter, the data needs to be erased, that is, the garbage collection algorithm needs to be started when the value of the watermark parameter is greater than the size of the actual reserved space of the first object. Once the garbage collection algorithm is started, garbage collection can be performed, so that the size of the actual reserved space of the first object gradually increases until it reaches the size of the actual reserved space of the first object indicated by the optimal configuration method.
方式二可以是提高垃圾回收算法的速度参数。速度参数指示存储系统执行垃圾回收算法时的垃圾回收速度,因此速度参数越大,垃圾回收速度越快,也即实现了加速数据擦除,使得存储系统特别是第一对象能够尽快适应新的配置方式。The second method may be to increase the speed parameter of the garbage collection algorithm. The speed parameter indicates the garbage collection speed when the storage system executes the garbage collection algorithm. Therefore, the larger the speed parameter, the faster the garbage collection speed, that is, accelerated data erasure is achieved, so that the storage system, especially the first object, can adapt to the new configuration mode as soon as possible.
方式三可以是减小垃圾回收算法的启动时延。垃圾回收算法从接收到启动指示到实际启动可能存在一定的启动时延,通过减小这个启动时延,也能够加速垃圾回收,使得存储系统特别是第一对象能够尽快适应新的配置方式。The third method is to reduce the startup delay of the garbage collection algorithm. There may be a certain startup delay from receiving the startup instruction to the actual startup of the garbage collection algorithm. By reducing this startup delay, garbage collection can also be accelerated, so that the storage system, especially the first object, can adapt to the new configuration mode as soon as possible.
针对以上任意一种方式,第二对象可以基于现有技术对第二对象的实际预留空间的大小进行自适应调整,在此不再赘述。For any of the above methods, the second object can adaptively adjust the size of the actual reserved space of the second object based on the existing technology, which will not be described in detail here.
以上方式无需改变热备份空间、初始预留空间等的大小,而是通过调整水位线参数、速度参数、或启动延时的方式,实现了第一对象和第二对象的实际预留空间大小的调整,也就是说,第一对象和第二对象在实际使用中可用于垃圾回收的空间(实际预留空间)发生了调整。The above method does not require changing the size of the hot backup space, the initial reserved space, etc., but instead adjusts the actual reserved space size of the first object and the second object by adjusting the waterline parameters, speed parameters, or startup delay. In other words, the space (actual reserved space) that can be used for garbage collection of the first object and the second object in actual use is adjusted.
通过这种方式,能够在最佳配置方式指示第一对象的实际预留空间的大小减小,第二对象的实际预留空间的大小增大时,能够尽快使得存储系统完成第一对象和第二对象的实际预留空间的调整,降低存储系统适应新的配置方式所需的时间,提升存储系统的性能。通过采用多种途径完成调整,使得调整的方式更灵活。In this way, when the optimal configuration indicates that the size of the actual reserved space of the first object is reduced and the size of the actual reserved space of the second object is increased, the storage system can complete the adjustment of the actual reserved space of the first object and the second object as soon as possible, reducing the time required for the storage system to adapt to the new configuration mode and improving the performance of the storage system. By adopting multiple ways to complete the adjustment, the adjustment method is more flexible.
在一种可能的实现方式中,在所述最佳配置方式下,所述第一对象的实际预留空间的大小增大,所述第二对象的实际预留空间的大小减小时,所述根据所述最佳配置方式,调整所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小,包括以下至少其中之一:In a possible implementation, under the optimal configuration, when the size of the actual reserved space of the first object increases and the size of the actual reserved space of the second object decreases, adjusting the size of the actual reserved space of the first object and the size of the actual reserved space of the second object according to the optimal configuration includes at least one of the following:
提高所述垃圾回收算法的水位线参数,所述水位线参数的数值大于所述第一对象的实际预留空间的大小时所述垃圾回收算法启动;Increasing a watermark parameter of the garbage collection algorithm, wherein the garbage collection algorithm is started when the value of the watermark parameter is greater than the size of the actual reserved space of the first object;
降低所述垃圾回收算法的速度参数,所述速度参数指示所述存储系统执行所述垃圾回收算法时的垃圾回收速度;reducing a speed parameter of the garbage collection algorithm, the speed parameter indicating a garbage collection speed when the storage system executes the garbage collection algorithm;
增大所述垃圾回收算法的启动时延。Increase the startup delay of the garbage collection algorithm.
举例来说,确定最佳配置方式后,可以按照最佳配置方式指示的第一对象的实际预留空间的大小以及第二对象的实际预留空间的大小,调整第一对象和第二对象的实际预留空间。如果最佳配置方式指示的第一对象的实际预留空间的大小相比当前时刻第一对象的实际预留空间的大小更大(即第一对象的实际预留空间的大小增大,第二对象的实际预留空间的大小减小),则可认为需要分配更多的预留空间资源给第一对象。也即,针对第一对象,需要减慢垃圾回收的进程。在此情况下,可以采用以下方式中的至少一种对第一对象和第二对象的实际预留空间进行调整。For example, after determining the optimal configuration, the actual reserved space of the first object and the second object can be adjusted according to the size of the actual reserved space of the first object indicated by the optimal configuration and the size of the actual reserved space of the second object. If the size of the actual reserved space of the first object indicated by the optimal configuration is larger than the size of the actual reserved space of the first object at the current moment (that is, the size of the actual reserved space of the first object increases, and the size of the actual reserved space of the second object decreases), it can be considered that more reserved space resources need to be allocated to the first object. That is, for the first object, the garbage collection process needs to be slowed down. In this case, at least one of the following methods can be used to adjust the actual reserved space of the first object and the second object.
方式一可以是提高垃圾回收算法的水位线参数。由上文描述可知,水位线参数的数值大于第一对象的实际预留空间的大小时需启动垃圾回收算法,而最佳配置方式指示的第一对象的实际预留空间的大小相比当前时刻第一对象的实际预留空间的大小更大,因此启动垃圾回收算法可以更迟一些。在此情况下,可以提高垃圾回收算法的水位线参数,使得垃圾回收算法可以晚一些启动,从而减少运行垃圾回收算法的数据处理成本。Method 1 may be to increase the waterline parameter of the garbage collection algorithm. As can be seen from the above description, the garbage collection algorithm needs to be started when the value of the waterline parameter is greater than the size of the actual reserved space of the first object, and the size of the actual reserved space of the first object indicated by the optimal configuration method is larger than the size of the actual reserved space of the first object at the current moment, so the garbage collection algorithm can be started later. In this case, the waterline parameter of the garbage collection algorithm can be increased so that the garbage collection algorithm can be started later, thereby reducing the data processing cost of running the garbage collection algorithm.
方式二可以是降低垃圾回收算法的速度参数。速度参数指示存储系统执行垃圾回收算法时的垃圾回收速度,因此速度参数越小,垃圾回收速度越慢,使得存储系统特别是第一对象能够尽快适应新的配置方式。The second method is to reduce the speed parameter of the garbage collection algorithm. The speed parameter indicates the garbage collection speed when the storage system executes the garbage collection algorithm. Therefore, the smaller the speed parameter, the slower the garbage collection speed, so that the storage system, especially the first object, can adapt to the new configuration mode as soon as possible.
方式三可以是增大垃圾回收算法的启动时延。垃圾回收算法从接收到启动指示到实际启动可能存在一定的启动时延,通过增大这个启动时延,也能够减慢垃圾回收,使得存储系统特别是第一对象能够尽快适应新的配置方式。The third method is to increase the startup delay of the garbage collection algorithm. There may be a certain startup delay from receiving the startup instruction to the actual startup of the garbage collection algorithm. By increasing this startup delay, garbage collection can also be slowed down, so that the storage system, especially the first object, can adapt to the new configuration mode as soon as possible.
针对以上任意一种方式,第二对象可以基于现有技术对第二对象的实际预留空间的大小进行自适应调整,在此不再赘述。For any of the above methods, the second object can adaptively adjust the size of the actual reserved space of the second object based on the existing technology, which will not be described in detail here.
通过这种方式,能够在最佳配置方式指示第一对象的实际预留空间的大小增大,第二对象的实际预留空间的大小减小时,能够尽快使得存储系统完成第一对象和第二对象的实际预留空间的调整,降低存储系统适应新的配置方式所需的时间,提升存储系统的性能。通过采用多种途径完成调整,使得调整的方式更灵活。In this way, when the optimal configuration indicates that the size of the actual reserved space of the first object is increased and the size of the actual reserved space of the second object is decreased, the storage system can complete the adjustment of the actual reserved space of the first object and the second object as soon as possible, reducing the time required for the storage system to adapt to the new configuration mode and improving the performance of the storage system. By adopting multiple ways to complete the adjustment, the adjustment method is more flexible.
本申请的实施例提供了一种资源分配装置,图9示出根据本申请实施例的资源分配装置的结构的示意图。An embodiment of the present application provides a resource allocation device. FIG9 is a schematic diagram showing the structure of the resource allocation device according to the embodiment of the present application.
如图9所示,在一种可能的实现方式中,本申请的实施例提供了一种资源分配装置,所述装置包括:As shown in FIG9 , in a possible implementation manner, an embodiment of the present application provides a resource allocation device, the device comprising:
获取模块91,用于获取第一对象的可用预留空间的大小和第二对象的可用预留空间的大小;An acquisition module 91 is used to acquire the size of the available reserved space of the first object and the size of the available reserved space of the second object;
调整模块92,用于根据用户负载的特性参数以及垃圾回收算法的类型参数调整所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小。The adjustment module 92 is used to adjust the size of the actual reserved space of the first object and the size of the actual reserved space of the second object according to the characteristic parameters of the user load and the type parameters of the garbage collection algorithm.
在一种可能的实现方式中,所述第一对象和所述第二对象设置在存储系统中,所述存储系统运行所述垃圾回收算法,In a possible implementation, the first object and the second object are set in a storage system, and the storage system runs the garbage collection algorithm.
所述第一对象包括所述存储系统的系统层,所述第二对象包括所述存储系统的设备层,The first object includes a system layer of the storage system, and the second object includes a device layer of the storage system.
所述第一对象的可用预留空间包括所述系统层的热备份空间、初始预留空间以及用户可见空间中未被使用的空间;The available reserved space of the first object includes the hot backup space of the system layer, the initial reserved space, and the unused space in the user visible space;
所述第二对象的可用预留空间包括所述设备层的初始预留空间;The available reserved space of the second object includes the initial reserved space of the device layer;
其中,所述系统层的热备份空间、初始预留空间以及所述设备层的初始预留空间不变。Among them, the hot backup space and the initial reserved space of the system layer and the initial reserved space of the device layer remain unchanged.
在一种可能的实现方式中,所述第一对象和所述第二对象设置在存储系统中,所述存储系统运行所述垃圾回收算法, In a possible implementation, the first object and the second object are set in a storage system, and the storage system runs the garbage collection algorithm.
所述第一对象包括所述存储系统的系统层,所述第二对象包括所述存储系统的应用层,The first object includes a system layer of the storage system, and the second object includes an application layer of the storage system.
所述第一对象的可用预留空间包括所述系统层的热备份空间、初始预留空间以及用户可见空间中未被使用的空间;The available reserved space of the first object includes the hot backup space of the system layer, the initial reserved space, and the unused space in the user visible space;
所述第二对象的可用预留空间包括所述应用层的初始预留空间;The available reserved space of the second object includes the initial reserved space of the application layer;
其中,所述系统层的热备份空间、初始预留空间不变。Among them, the hot backup space and the initial reserved space of the system layer remain unchanged.
在一种可能的实现方式中,所述装置还包括:In a possible implementation manner, the device further includes:
第一确定模块,用于确定预设时间窗口内的用户输入/输出访问对象及频次;A first determination module is used to determine the user input/output access object and frequency within a preset time window;
构建模块,用于根据所述频次的高低对所述访问对象进行排序,构建统计直方图;A construction module, used to sort the access objects according to the frequency and construct a statistical histogram;
第二确定模块,用于基于所述统计直方图,确定所述频次与所述访问对象的排序序号的线性关系;A second determination module, configured to determine a linear relationship between the frequency and the sorting sequence number of the access object based on the statistical histogram;
第三确定模块,用于根据所述线性关系的斜率确定所述用户负载的特性参数。The third determination module is used to determine the characteristic parameter of the user load according to the slope of the linear relationship.
在一种可能的实现方式中,所述调整模块包括:In a possible implementation, the adjustment module includes:
选择单元,用于从预先设置的所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小的多种配置方式中,选择与所述第一对象的可用预留空间的大小和所述第二对象的可用预留空间的大小的空间总和、所述特性参数以及所述类型参数相匹配的配置方式,作为所述最佳配置方式;a selecting unit, configured to select, from among a plurality of preset configuration modes of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object, a configuration mode that matches the sum of the space of the available reserved space of the first object and the size of the available reserved space of the second object, the characteristic parameter, and the type parameter as the optimal configuration mode;
调整单元,用于根据所述最佳配置方式,调整所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小。An adjusting unit is used to adjust the size of the actual reserved space of the first object and the size of the actual reserved space of the second object according to the optimal configuration mode.
在一种可能的实现方式中,所述装置还包括:In a possible implementation manner, the device further includes:
第四确定模块,用于根据所述热备份空间、所述初始预留空间、所述用户可见空间、所述第二对象的可用预留空间,确定所述空间总和的取值范围;a fourth determining module, configured to determine a value range of the total space according to the hot backup space, the initial reserved space, the user visible space, and the available reserved space of the second object;
第五确定模块,用于针对所述空间总和的取值范围中的每一数值,确定该数值下所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小的多种划分方式;a fifth determining module, configured to determine, for each value in the value range of the space sum, a plurality of division methods of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object under the value;
第六确定模块,用于根据所述用户负载的多种特性参数、所述垃圾回收算法的多种类型参数、所述空间总和以及所述多种划分方式,确定所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小的多种配置方式。The sixth determination module is used to determine multiple configuration methods of the actual reserved space size of the first object and the actual reserved space size of the second object based on multiple characteristic parameters of the user load, multiple types of parameters of the garbage collection algorithm, the total space and the multiple division methods.
在一种可能的实现方式中,所述第六确定模块包括:In a possible implementation manner, the sixth determining module includes:
第一确定单元,用于根据所述用户负载的多种特性参数、所述垃圾回收算法的多种类型参数、所述空间总和,确定所述特性参数、所述类型参数、所述空间总和的多种组合方式,其中,不同组合方式下的特性参数、类型参数、空间总和中的至少其中之一不同;a first determining unit, configured to determine, according to the plurality of characteristic parameters of the user load, the plurality of type parameters of the garbage collection algorithm, and the space sum, a plurality of combinations of the characteristic parameters, the type parameters, and the space sum, wherein at least one of the characteristic parameters, the type parameters, and the space sum in different combinations is different;
第二确定单元,用于针对所述特性参数、所述类型参数、所述空间总和的每种组合方式,分别确定所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小的每种划分方式的写放大因子;a second determining unit, configured to determine, for each combination of the characteristic parameter, the type parameter, and the space sum, a write amplification factor for each division method of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object;
第三确定单元,用于将每种组合方式下最小的写放大因子对应的第一对象的实际预留空间的大小和第二对象的实际预留空间的大小的划分方式,确定为所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小的一种配置方式。The third determination unit is used to determine the division method of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object corresponding to the minimum write amplification factor under each combination method as a configuration method of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object.
在一种可能的实现方式中,在所述最佳配置方式下,所述第一对象的实际预留空间的大小减小,所述第二对象的实际预留空间的大小增大时,所述根据所述最佳配置方式,调整所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小,包括以下至少其中之一:In a possible implementation, in the optimal configuration mode, when the size of the actual reserved space of the first object decreases and the size of the actual reserved space of the second object increases, adjusting the size of the actual reserved space of the first object and the size of the actual reserved space of the second object according to the optimal configuration mode includes at least one of the following:
降低所述垃圾回收算法的水位线参数,所述水位线参数的数值大于所述第一对象的实际预留空间的大小时所述垃圾回收算法启动;Lowering a watermark parameter of the garbage collection algorithm, wherein the garbage collection algorithm is started when the value of the watermark parameter is greater than the size of the actual reserved space of the first object;
提高所述垃圾回收算法的速度参数,所述速度参数指示所述存储系统执行所述垃圾回收算法时的垃圾回收速度;increasing a speed parameter of the garbage collection algorithm, the speed parameter indicating a garbage collection speed when the storage system executes the garbage collection algorithm;
减小所述垃圾回收算法的启动时延。Reduce the startup delay of the garbage collection algorithm.
在一种可能的实现方式中,在所述最佳配置方式下,所述第一对象的实际预留空间的大小增大,所述第二对象的实际预留空间的大小减小时,所述根据所述最佳配置方式,调整所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小,包括以下至少其中之一:In a possible implementation, under the optimal configuration, when the size of the actual reserved space of the first object increases and the size of the actual reserved space of the second object decreases, adjusting the size of the actual reserved space of the first object and the size of the actual reserved space of the second object according to the optimal configuration includes at least one of the following:
提高所述垃圾回收算法的水位线参数,所述水位线参数的数值大于所述第一对象的实际预留空间的大小时所述垃圾回收算法启动;Increasing a watermark parameter of the garbage collection algorithm, wherein the garbage collection algorithm is started when the value of the watermark parameter is greater than the size of the actual reserved space of the first object;
降低所述垃圾回收算法的速度参数,所述速度参数指示所述存储系统执行所述垃圾回收算法时的垃圾回收速度;reducing a speed parameter of the garbage collection algorithm, the speed parameter indicating a garbage collection speed when the storage system executes the garbage collection algorithm;
增大所述垃圾回收算法的启动时延。Increase the startup delay of the garbage collection algorithm.
本申请的实施例提供了一种资源分配装置,包括:处理器以及用于存储处理器可执行指令的存储器;其中,所述处理器被配置为执行所述指令时实现上述方法。An embodiment of the present application provides a resource allocation device, comprising: a processor and a memory for storing processor-executable instructions; wherein the processor is configured to implement the above method when executing the instructions.
本申请的实施例提供了一种非易失性计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现上述方法。An embodiment of the present application provides a non-volatile computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the above method is implemented.
本申请的实施例提供了一种计算机程序产品,包括计算机可读代码,或者承载有计算机可读代码的非易失性计算机可读存储介质,当所述计算机可读代码在电子设备的处理器中运行时,所述电子设备中的处理器执行上述方法。An embodiment of the present application provides a computer program product, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above method.
图10示出根据本申请实施例的资源分配装置的示例性结构图。FIG. 10 shows an exemplary structural diagram of a resource allocation device according to an embodiment of the present application.
如图10所示,资源分配装置可以包括手机、可折叠电子设备、平板电脑、桌面型计算机、膝上型计算机、手持计算机、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本、蜂窝电话、个人数字助理(personal digital assistant,PDA)、增强现实(augmented reality,AR)设备、虚拟现实(virtual reality,VR)设备、人工智能(artificial intelligence,AI)设备、可穿戴式设备、车载设备、智能家居设备、或智慧城市设备、服务器设备中的至少一种。本申请实施例对该资源分配装置的具体类型不作特殊限制。As shown in FIG10 , the resource allocation device may include at least one of a mobile phone, a foldable electronic device, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) device, a virtual reality (VR) device, an artificial intelligence (AI) device, a wearable device, an in-vehicle device, a smart home device, or a smart city device, and a server device. The embodiment of the present application does not impose any special restrictions on the specific type of the resource allocation device.
资源分配装置可以包括处理器110,存储器121,通信模块160。可以理解的是,本申请实施例示意的结构并不构成对资源分配装置的具体限定。在本申请另一些实施例中,资源分配装置可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。The resource allocation device may include a processor 110, a memory 121, and a communication module 160. It is understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the resource allocation device. In other embodiments of the present application, the resource allocation device may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
处理器110可包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and/or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated in one or more processors.
处理器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The processor can generate operation control signals based on instruction opcodes and timing signals to complete the control of instruction fetching and execution.
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器可以为高速缓冲存储器。该存储器可以保存处理器110用过或使用频率较高的指令或数据,例如本申请实施例中的预先设置的第一对象的实际预留空间的大小和第二对象的实际预留空间的大小的多种配置方式等。如果处理器110需要使用该指令或数据,可从该存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 may be a cache memory. The memory may store instructions or data that have been used or are frequently used by the processor 110, such as the multiple configuration modes of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object pre-set in the embodiment of the present application. If the processor 110 needs to use the instruction or data, it may be directly called from the memory. Repeated access is avoided, the waiting time of the processor 110 is reduced, and the efficiency of the system is improved.
存储器121可以用于存储计算机可执行程序代码,该可执行程序代码包括指令。存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如最小二乘法)等。存储数据区可存储资源分配装置使用过程中所获取或创建的数据(比如第一对象的可用预留空间的大小和第二对象的可用预留空间的大小等)等。此外,存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。处理器110通过运行存储在存储器121的指令,和/或存储在设置于处理器中的存储器的指令,执行资源分配装置的各种功能方法或上述资源分配方法。The memory 121 can be used to store computer executable program codes, which include instructions. The memory 121 can include a program storage area and a data storage area. The program storage area can store an operating system, an application required for at least one function (such as the least squares method), etc. The data storage area can store data acquired or created during the use of the resource allocation device (such as the size of the available reserved space of the first object and the size of the available reserved space of the second object, etc.). In addition, the memory 121 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional methods of the resource allocation device or the above-mentioned resource allocation method by running instructions stored in the memory 121 and/or instructions stored in a memory provided in the processor.
通信模块160可以用于通过无线通信/有线通信的方式从其他装置或设备接收数据(例如本申请实施例中的特征属性),以及向其他装置或设备输出数据。例如可以提供包括WLAN(如Wi-Fi网络)、蓝牙(Bluetooth,BT)、全球导航卫星系统(global navigation satellite system,GNSS)、调频(frequency modulation,FM)、近距离无线通信技术(near field communication,NFC)、红外技术(infrared,IR)等无线通信的解决方案。The communication module 160 can be used to receive data (such as the characteristic attributes in the embodiment of the present application) from other devices or equipment through wireless communication/wired communication, and output data to other devices or equipment. For example, wireless communication solutions including WLAN (such as Wi-Fi network), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (IR), etc. can be provided.
计算机可读存储介质可以是可以保持和存储由指令执行设备使用的指令的有形设备。计算机可读存储介质例如可以是――但不限于――电存储设备、磁存储设备、光存储设备、电磁存储设备、半导体存储设备或者上述的任意合适的组合。计算机可读存储介质的更具体的例子(非穷举的列表)包括:便携式计算机盘、硬盘、随机存取存储器(Random Access Memory,RAM)、只读存储器(Read Only Memory,ROM)、可擦式可编程只读存储器(Electrically Programmable Read-Only-Memory,EPROM或闪存)、静态随机存取存储器(Static Random-Access Memory,SRAM)、便携式压缩盘只读存储器(Compact Disc Read-Only Memory,CD-ROM)、数字多功能盘(Digital Video Disc,DVD)、记忆棒、软盘、机械编码设备、例如其上存储有指令的打孔卡或凹槽内凸起结构、以及上述的任意合适的组合。A computer readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer readable storage media (a non-exhaustive list) include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disc (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing.
这里所描述的计算机可读程序指令或代码可以从计算机可读存储介质下载到各个计算/处理设备,或者通过网络、例如因特网、局域网、广域网和/或无线网下载到外部计算机或外部存储设备。网络可以包括铜传输电缆、光纤传输、无线传输、路由器、防火墙、交换机、网关计算机和/或边缘服务器。每个计算/处理设备中的网络适配卡或者网络接口从网络接收计算机可读程序指令,并转发该计算机可读程序指令,以供存储在各个计算/处理设备中的计算机可读存储介质中。The computer-readable program instructions or codes described herein can be downloaded from a computer-readable storage medium to each computing/processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and/or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and/or edge servers. The network adapter card or network interface in each computing/processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing/processing device.
用于执行本申请操作的计算机程序指令可以是汇编指令、指令集架构(Instruction Set Architecture,ISA)指令、机器指令、机器相关指令、微代码、固件指令、状态设置数据、或者以一种或多种编程语言的任意组合编写的源代码或目标代码,所述编程语言包括面向对象的编程语言—诸如Smalltalk、C++等,以及常规的过程式编程语言—诸如“C”语言或类似的编程语言。计算机可读程序指令可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络—包括局域网(Local Area Network,LAN)或广域网(Wide Area Network,WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。在一些实施例中,通过利用计算机可读程序指令的状态信息来个性化定制电子电路,例如可编程逻辑电路、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或可编程逻辑阵列(Programmable Logic Array,PLA),该电子电路可以执行计算机可读程序指令,从而实现本申请的各个方面。The computer program instructions for performing the operations of the present application may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as "C" language or similar programming languages. The computer-readable program instructions may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, by utilizing the status information of computer-readable program instructions to personalize an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA) or a programmable logic array (PLA), the electronic circuit can execute computer-readable program instructions to implement various aspects of the present application.
这里参照根据本申请实施例的方法、装置(系统)和计算机程序产品的流程图和/或框图描述了本申请的各个方面。应当理解,流程图和/或框图的每个方框以及流程图和/或框图中各方框的组合,都可以由计算机可读程序指令实现。Various aspects of the present application are described herein with reference to the flowcharts and/or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present application. It should be understood that each box in the flowchart and/or block diagram and the combination of each box in the flowchart and/or block diagram can be implemented by computer-readable program instructions.
这些计算机可读程序指令可以提供给通用计算机、专用计算机或其它可编程数据处理装置的处理器,从而生产出一种机器,使得这些指令在通过计算机或其它可编程数据处理装置的处理器执行时,产生了实现流程图和/或框图中的一个或多个方框中规定的功能/动作的装置。也可以把这些计算机可读程序指令存储在计算机可读存储介质中,这些指令使得计算机、可编程数据处理装置和/或其他设备以特定方式工作,从而,存储有指令的计算机可读介质则包括一个制造品,其包括实现流程图和/或框图中的一个或多个方框中规定的功能/动作的各个方面的指令。These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions/actions specified in one or more boxes in the flowchart and/or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and/or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions/actions specified in one or more boxes in the flowchart and/or block diagram.
也可以把计算机可读程序指令加载到计算机、其它可编程数据处理装置、或其它设备上,使得在计算机、其它可编程数据处理装置或其它设备上执行一系列操作步骤,以产生计算机实现的过程,从而使得在计算机、其它可编程数据处理装置、或其它设备上执行的指令实现流程图和/或框图中的一个或多个方框中规定的功能/动作。Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions/actions specified in one or more boxes in the flowchart and/or block diagram.
附图中的流程图和框图显示了根据本申请的多个实施例的装置、系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或指令的一部分,所述模块、程序段或指令的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the device, system, method and computer program product according to multiple embodiments of the present application. In this regard, each square frame in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the logical function of the specification. In some alternative implementations, the functions marked in the square frame can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square frames can actually be executed substantially in parallel, and they can also be executed in the opposite order sometimes, depending on the functions involved.
也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行相应的功能或动作的硬件(例如电路或ASIC(Application Specific Integrated Circuit,专用集成电路))来实现,或者可以用硬件和软件的组合,如固件等来实现。It should also be noted that each box in the block diagram and/or flowchart, and the combination of boxes in the block diagram and/or flowchart, can be implemented by hardware (such as circuits or ASICs (Application Specific Integrated Circuit)) that performs the corresponding function or action, or can be implemented by a combination of hardware and software, such as firmware.
尽管在此结合各实施例对本发明进行了描述,然而,在实施所要求保护的本发明过程中,本领域技术人员通过查看所述附图、公开内容、以及所附权利要求书,可理解并实现所述公开实施例的其它变化。在权利要求中,“包括”(comprising)一词不排除其他组成部分或步骤,“一”或“一个”不排除多个的情况。单个处理器或其它单元可以实现权利要求中列举的若干项功能。相互不同的从属权利要求中记载了某些措施,但这并不表示这些措施不能组合起来产生良好的效果。 Although the present invention is described herein in conjunction with various embodiments, in the process of implementing the claimed invention, those skilled in the art may understand and implement other variations of the disclosed embodiments by viewing the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and "one" or "an" does not exclude multiple situations. A single processor or other unit may implement several functions listed in the claims. Certain measures are recorded in different dependent claims, but this does not mean that these measures cannot be combined to produce good results.
以上已经描述了本申请的各实施例,上述说明是示例性的,并非穷尽性的,并且也不限于所披露的各实施例。在不偏离所说明的各实施例的范围的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。本文中所用术语的选择,旨在最好地解释各实施例的原理、实际应用或对市场中的技术的改进,或者使本技术领域的其它普通技术人员能理解本文披露的各实施例。 The embodiments of the present application have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes are obvious to those of ordinary skill in the art without departing from the scope of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims (13)

  1. 一种资源分配方法,其特征在于,所述方法包括:A resource allocation method, characterized in that the method comprises:
    获取第一对象的可用预留空间的大小和第二对象的可用预留空间的大小;Get the size of the available reserved space of the first object and the size of the available reserved space of the second object;
    根据用户负载的特性参数以及垃圾回收算法的类型参数调整所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小。The size of the actual reserved space of the first object and the size of the actual reserved space of the second object are adjusted according to the characteristic parameters of the user load and the type parameters of the garbage collection algorithm.
  2. 根据权利要求1所述的方法,其特征在于,所述第一对象和所述第二对象设置在存储系统中,所述存储系统运行所述垃圾回收算法,The method according to claim 1, wherein the first object and the second object are set in a storage system, and the storage system runs the garbage collection algorithm.
    所述第一对象包括所述存储系统的系统层,所述第二对象包括所述存储系统的设备层,The first object includes a system layer of the storage system, and the second object includes a device layer of the storage system.
    所述第一对象的可用预留空间包括所述系统层的热备份空间、初始预留空间以及用户可见空间中未被使用的空间;The available reserved space of the first object includes the hot backup space of the system layer, the initial reserved space, and the unused space in the user visible space;
    所述第二对象的可用预留空间包括所述设备层的初始预留空间;The available reserved space of the second object includes the initial reserved space of the device layer;
    其中,所述系统层的热备份空间、初始预留空间以及所述设备层的初始预留空间不变。Among them, the hot backup space and the initial reserved space of the system layer and the initial reserved space of the device layer remain unchanged.
  3. 根据权利要求1所述的方法,其特征在于,所述第一对象和所述第二对象设置在存储系统中,所述存储系统运行所述垃圾回收算法,The method according to claim 1, wherein the first object and the second object are set in a storage system, and the storage system runs the garbage collection algorithm.
    所述第一对象包括所述存储系统的系统层,所述第二对象包括所述存储系统的应用层,The first object includes a system layer of the storage system, and the second object includes an application layer of the storage system.
    所述第一对象的可用预留空间包括所述系统层的热备份空间、初始预留空间以及用户可见空间中未被使用的空间;The available reserved space of the first object includes the hot backup space of the system layer, the initial reserved space, and the unused space in the user visible space;
    所述第二对象的可用预留空间包括所述应用层的初始预留空间;The available reserved space of the second object includes the initial reserved space of the application layer;
    其中,所述系统层的热备份空间、初始预留空间不变。Among them, the hot backup space and the initial reserved space of the system layer remain unchanged.
  4. 根据权利要求1-3中任一项所述的方法,其特征在于,所述根据用户负载的特性参数以及垃圾回收算法的类型参数调整所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小之前,所述方法还包括:The method according to any one of claims 1 to 3, characterized in that before adjusting the size of the actual reserved space of the first object and the size of the actual reserved space of the second object according to the characteristic parameters of the user load and the type parameters of the garbage collection algorithm, the method further comprises:
    确定预设时间窗口内的用户输入/输出访问对象及频次;Determine the user input/output access objects and frequencies within a preset time window;
    根据所述频次的高低对所述访问对象进行排序,构建统计直方图;Sorting the access objects according to the frequency and constructing a statistical histogram;
    基于所述统计直方图,确定所述频次与所述访问对象的排序序号的线性关系;Based on the statistical histogram, determining a linear relationship between the frequency and the sorting sequence number of the access object;
    根据所述线性关系的斜率确定所述用户负载的特性参数。 The characteristic parameter of the user load is determined according to the slope of the linear relationship.
  5. 根据权利要求1-4中任一项所述的方法,其特征在于,所述根据用户负载的特性参数以及垃圾回收算法的类型参数调整所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小,包括:The method according to any one of claims 1 to 4, characterized in that the step of adjusting the size of the actual reserved space of the first object and the size of the actual reserved space of the second object according to a characteristic parameter of a user load and a type parameter of a garbage collection algorithm comprises:
    从预先设置的所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小的多种配置方式中,选择与所述第一对象的可用预留空间的大小和所述第二对象的可用预留空间的大小的空间总和、所述特性参数以及所述类型参数相匹配的配置方式,作为所述最佳配置方式;From among multiple preset configurations of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object, selecting a configuration that matches the sum of the available reserved space of the first object and the available reserved space of the second object, the characteristic parameter, and the type parameter as the optimal configuration;
    根据所述最佳配置方式,调整所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小。According to the optimal configuration mode, the size of the actual reserved space of the first object and the size of the actual reserved space of the second object are adjusted.
  6. 根据权利要求5所述的方法,其特征在于,所述方法还包括:The method according to claim 5, characterized in that the method further comprises:
    根据所述热备份空间、所述初始预留空间、所述用户可见空间、所述第二对象的可用预留空间,确定所述空间总和的取值范围;Determine a value range of the total space according to the hot backup space, the initial reserved space, the user visible space, and the available reserved space of the second object;
    针对所述空间总和的取值范围中的每一数值,确定该数值下所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小的多种划分方式;For each value in the value range of the space sum, determine multiple division methods of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object under the value;
    根据所述用户负载的多种特性参数、所述垃圾回收算法的多种类型参数、所述空间总和以及所述多种划分方式,确定所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小的多种配置方式。According to the multiple characteristic parameters of the user load, the multiple types of parameters of the garbage collection algorithm, the total space and the multiple division methods, multiple configuration methods of the actual reserved space size of the first object and the actual reserved space size of the second object are determined.
  7. 根据权利要求6所述的方法,其特征在于,所述根据所述用户负载的多种特性参数、所述垃圾回收算法的多种类型参数、所述空间总和以及所述多种划分方式,确定所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小的多种配置方式,包括:The method according to claim 6, characterized in that the multiple configuration methods of determining the size of the actual reserved space of the first object and the size of the actual reserved space of the second object according to the multiple characteristic parameters of the user load, the multiple type parameters of the garbage collection algorithm, the total space, and the multiple division methods include:
    根据所述用户负载的多种特性参数、所述垃圾回收算法的多种类型参数、所述空间总和,确定所述特性参数、所述类型参数、所述空间总和的多种组合方式,其中,不同组合方式下的特性参数、类型参数、空间总和中的至少其中之一不同;Determine multiple combinations of the characteristic parameters, the type parameters, and the space sum according to the multiple characteristic parameters of the user load, the multiple type parameters of the garbage collection algorithm, and the space sum, wherein at least one of the characteristic parameters, the type parameters, and the space sum in different combinations is different;
    针对所述特性参数、所述类型参数、所述空间总和的每种组合方式,分别确定所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小的每种划分方式的写放大因子;For each combination of the characteristic parameter, the type parameter, and the total space, respectively determine a write amplification factor for each division method of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object;
    将每种组合方式下最小的写放大因子对应的第一对象的实际预留空间的大小和第二对象的实际预留空间的大小的划分方式,确定为所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小的一种配置方式。A division method of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object corresponding to the minimum write amplification factor in each combination method is determined as a configuration method of the size of the actual reserved space of the first object and the size of the actual reserved space of the second object.
  8. 根据权利要求5-7中任一项所述的方法,其特征在于,在所述最佳配置方式下,所述第一对象的实际预留空间的大小减小,所述第二对象的实际预留空间的大小增大时, The method according to any one of claims 5 to 7, characterized in that, in the optimal configuration mode, when the size of the actual reserved space of the first object decreases and the size of the actual reserved space of the second object increases,
    所述根据所述最佳配置方式,调整所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小,包括以下至少其中之一:The adjusting the size of the actual reserved space of the first object and the size of the actual reserved space of the second object according to the optimal configuration mode includes at least one of the following:
    降低所述垃圾回收算法的水位线参数,所述水位线参数的数值大于所述第一对象的实际预留空间的大小时所述垃圾回收算法启动;Lowering a watermark parameter of the garbage collection algorithm, wherein the garbage collection algorithm is started when the value of the watermark parameter is greater than the size of the actual reserved space of the first object;
    提高所述垃圾回收算法的速度参数,所述速度参数指示所述存储系统执行所述垃圾回收算法时的垃圾回收速度;increasing a speed parameter of the garbage collection algorithm, the speed parameter indicating a garbage collection speed when the storage system executes the garbage collection algorithm;
    减小所述垃圾回收算法的启动时延。Reduce the startup delay of the garbage collection algorithm.
  9. 根据权利要求5-8中任一项所述的方法,其特征在于,在所述最佳配置方式下,所述第一对象的实际预留空间的大小增大,所述第二对象的实际预留空间的大小减小时,The method according to any one of claims 5 to 8, characterized in that, in the optimal configuration mode, when the size of the actual reserved space of the first object increases and the size of the actual reserved space of the second object decreases,
    所述根据所述最佳配置方式,调整所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小,包括以下至少其中之一:The adjusting the size of the actual reserved space of the first object and the size of the actual reserved space of the second object according to the optimal configuration mode includes at least one of the following:
    提高所述垃圾回收算法的水位线参数,所述水位线参数的数值大于所述第一对象的实际预留空间的大小时所述垃圾回收算法启动;Increasing a watermark parameter of the garbage collection algorithm, wherein the garbage collection algorithm is started when the value of the watermark parameter is greater than the size of the actual reserved space of the first object;
    降低所述垃圾回收算法的速度参数,所述速度参数指示所述存储系统执行所述垃圾回收算法时的垃圾回收速度;reducing a speed parameter of the garbage collection algorithm, the speed parameter indicating a garbage collection speed when the storage system executes the garbage collection algorithm;
    增大所述垃圾回收算法的启动时延。Increase the startup delay of the garbage collection algorithm.
  10. 一种资源分配装置,其特征在于,所述装置包括:A resource allocation device, characterized in that the device comprises:
    获取模块,用于获取第一对象的可用预留空间的大小和第二对象的可用预留空间的大小;An acquisition module, configured to acquire the size of the available reserved space of the first object and the size of the available reserved space of the second object;
    调整模块,用于根据用户负载的特性参数以及垃圾回收算法的类型参数调整所述第一对象的实际预留空间的大小和所述第二对象的实际预留空间的大小。The adjustment module is used to adjust the size of the actual reserved space of the first object and the size of the actual reserved space of the second object according to the characteristic parameters of the user load and the type parameters of the garbage collection algorithm.
  11. 一种资源分配装置,其特征在于,包括:A resource allocation device, characterized by comprising:
    处理器;processor;
    用于存储处理器可执行指令的存储器;a memory for storing processor-executable instructions;
    其中,所述处理器被配置为执行所述指令时实现权利要求1-9任意一项所述的方法。Wherein, the processor is configured to implement the method according to any one of claims 1 to 9 when executing the instructions.
  12. 一种非易失性计算机可读存储介质,其上存储有计算机程序指令,其特征在于,所述计算机程序指令被处理器执行时实现权利要求1-9中任意一项所述的方法。A non-volatile computer-readable storage medium having computer program instructions stored thereon, wherein the computer program instructions, when executed by a processor, implement the method of any one of claims 1 to 9.
  13. 一种计算机程序产品,包括计算机可读代码,或者承载有计算机可读代码的非易失性计算机可读存储介质,其特征在于,当所述计算机可读代码在电子设备中运行时,所述电子设备中的处理器执行权利要求1-9中任意一项所述的方法。 A computer program product, comprising a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code, characterized in that when the computer-readable code is executed in an electronic device, a processor in the electronic device executes the method described in any one of claims 1 to 9.
PCT/CN2023/100421 2022-10-14 2023-06-15 Resource allocation method and apparatus, storage medium, and program product WO2024077993A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211262519.8 2022-10-14
CN202211262519.8A CN117931416A (en) 2022-10-14 2022-10-14 Resource allocation method, device, storage medium and program product

Publications (1)

Publication Number Publication Date
WO2024077993A1 true WO2024077993A1 (en) 2024-04-18

Family

ID=90668635

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/100421 WO2024077993A1 (en) 2022-10-14 2023-06-15 Resource allocation method and apparatus, storage medium, and program product

Country Status (2)

Country Link
CN (1) CN117931416A (en)
WO (1) WO2024077993A1 (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140101379A1 (en) * 2011-04-26 2014-04-10 Lsi Corporation Variable Over-Provisioning For Non-Volatile Storage
US20170242592A1 (en) * 2016-02-19 2017-08-24 International Business Machines Corporation Techniques for dynamically adjusting over-provisioning space of a flash controller based on workload characteristics
US20200192738A1 (en) * 2018-12-17 2020-06-18 Western Digital Technologies, Inc. Data storage systems and methods for autonomously adapting data storage system performance, capacity and/or operational requirements
CN113093993A (en) * 2021-03-25 2021-07-09 深圳大普微电子科技有限公司 Flash memory space dynamic allocation method and solid state disk
CN113311992A (en) * 2020-08-31 2021-08-27 阿里巴巴集团控股有限公司 Dynamic adjustment method and device for reserved space of solid state disk
CN114020208A (en) * 2021-09-30 2022-02-08 苏州浪潮智能科技有限公司 Data garbage recovery method and device, computer equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140101379A1 (en) * 2011-04-26 2014-04-10 Lsi Corporation Variable Over-Provisioning For Non-Volatile Storage
US20170242592A1 (en) * 2016-02-19 2017-08-24 International Business Machines Corporation Techniques for dynamically adjusting over-provisioning space of a flash controller based on workload characteristics
US20200192738A1 (en) * 2018-12-17 2020-06-18 Western Digital Technologies, Inc. Data storage systems and methods for autonomously adapting data storage system performance, capacity and/or operational requirements
CN113311992A (en) * 2020-08-31 2021-08-27 阿里巴巴集团控股有限公司 Dynamic adjustment method and device for reserved space of solid state disk
CN113093993A (en) * 2021-03-25 2021-07-09 深圳大普微电子科技有限公司 Flash memory space dynamic allocation method and solid state disk
CN114020208A (en) * 2021-09-30 2022-02-08 苏州浪潮智能科技有限公司 Data garbage recovery method and device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN117931416A (en) 2024-04-26

Similar Documents

Publication Publication Date Title
US11960726B2 (en) Method and apparatus for SSD storage access
US20230418523A1 (en) Managing Operational State Data in Memory Module
US10416932B2 (en) Dirty data management for hybrid drives
US9058212B2 (en) Combining memory pages having identical content
US9626126B2 (en) Power saving mode hybrid drive access management
CN111506262A (en) Storage system, file storage and reading method and terminal equipment
US10862992B2 (en) Resource cache management method and system and apparatus
US11899580B2 (en) Cache space management method and apparatus
US20190370009A1 (en) Intelligent swap for fatigable storage mediums
US20210124496A1 (en) Computing device and operating method thereof
US20240070120A1 (en) Data processing method and apparatus
WO2024077993A1 (en) Resource allocation method and apparatus, storage medium, and program product
US8281091B2 (en) Automatic selection of storage volumes in a data storage system
US9747028B1 (en) Artificial memory pressure for low memory machine
WO2021120843A1 (en) Cloud host memory allocation method, cloud host, device, and storage medium
CN115151902A (en) Cluster capacity expansion method and device, storage medium and electronic equipment
US8078796B2 (en) Method for writing to and erasing a non-volatile memory
US20220229553A1 (en) Storage usage management system
CN114816216A (en) Method for adjusting capacity and related device
US20230168822A1 (en) Memory management method and semiconductor device adjusting size of contiguous memory allocation area
TWI553462B (en) Hard disk device and method for decreasing power consumption
US20160320972A1 (en) Adaptive compression-based paging
US20230342200A1 (en) System and method for resource management in dynamic systems
CN110809754B (en) System and method for dynamic buffer size setting in a computing device
CN111414127B (en) Computing cluster system, data acquisition method thereof and electronic equipment

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23876204

Country of ref document: EP

Kind code of ref document: A1