Nothing Special   »   [go: up one dir, main page]

CN111857992B - Method and device for allocating linear resources in Radosgw module - Google Patents

Method and device for allocating linear resources in Radosgw module Download PDF

Info

Publication number
CN111857992B
CN111857992B CN202010585943.0A CN202010585943A CN111857992B CN 111857992 B CN111857992 B CN 111857992B CN 202010585943 A CN202010585943 A CN 202010585943A CN 111857992 B CN111857992 B CN 111857992B
Authority
CN
China
Prior art keywords
thread
target
target cluster
access request
cluster
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN202010585943.0A
Other languages
Chinese (zh)
Other versions
CN111857992A (en
Inventor
常纪雄
孙细妹
陆兆新
刘太良
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xiamen Wangsu Co Ltd
Original Assignee
Xiamen Wangsu Co Ltd
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 Xiamen Wangsu Co Ltd filed Critical Xiamen Wangsu Co Ltd
Priority to CN202010585943.0A priority Critical patent/CN111857992B/en
Publication of CN111857992A publication Critical patent/CN111857992A/en
Application granted granted Critical
Publication of CN111857992B publication Critical patent/CN111857992B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • 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]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5022Mechanisms to release resources
    • 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]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/5011Pool
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/5018Thread allocation

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a linear resource allocation method in a Radosgw module, which comprises the following steps: acquiring request queue information, judging whether an access request exists in the request queue information, and if the access request exists, identifying a target cluster identifier carried by any one target access request in each access request; acquiring the current global thread used number, and inquiring the current thread used number of a target cluster and a target cluster thread threshold according to the target cluster identifier, wherein the target cluster identifier is bound with the target cluster; and judging whether to allocate thread resources to the target access request based on the current global thread used number, the current thread used number of the target cluster and the target cluster thread threshold. According to the technical scheme, the use efficiency of thread resources can be improved.

Description

Method and device for allocating linear resources in Radosgw module
Technical Field
The invention relates to the technical field of Internet, in particular to a method and a device for allocating line resources in a Radosgw module.
Background
CEPH (distributed file system) has advantages of high expandability, high performance, high reliability, etc., and at the same time, CEPH system can provide block storage service, object storage service, and file system storage service, so people are increasingly using CEPH system to store and manage data. With the rapid development of big data and cloud computing, people have put higher demands on data and storage, and a single CEPH cluster cannot meet the demands of people, so that combining a plurality of CEPH clusters together to provide better services has become a development trend.
The Radosgw module serves as a component of a CEPH system, and plays a role of an access gateway in the CEPH system, typically, one Radosgw module can only dock one CEPH cluster, if multiple CEPH clusters exist simultaneously, the Radosgw module in the CEPH cluster with low access quantity may be too idle, and the Radosgw module in the CEPH cluster with high access quantity may become a bottleneck of the system. Aiming at the problems, the partial CEPH system improves the Radosgw module, so that the Radosgw module can identify CEPH cluster ID numbers carried in the access request, different CEPH clusters can be accessed through one Radosgw module, and the problem of uneven pressure of the Radosgw module is solved. However, this improvement creates another problem in that when a large number of requests for access to a certain CEPH cluster arrive, the thread resources of the Radosgw module are gradually filled with requests for access to the CEPH cluster, and at this time, the requests for access to other CEPH clusters cannot be timely processed and responded to.
In view of the foregoing, it is desirable to provide a new method and apparatus for allocating line resources in a Radosgw module to solve the above-mentioned drawbacks.
Disclosure of Invention
The purpose of the application is to provide a method and a device for allocating thread resources in a Radosgw module, which can improve the use efficiency of the thread resources.
In order to achieve the above objective, an aspect of the present application provides a method for allocating line resources in a Radosgw module, where the method includes: acquiring request queue information, judging whether an access request exists in the request queue information, and if the access request exists, identifying a target cluster identifier carried by any one target access request in each access request; acquiring the current global thread used number, and inquiring the current thread used number of a target cluster and a target cluster thread threshold according to the target cluster identifier, wherein the target cluster identifier is bound with the target cluster; and judging whether to allocate thread resources to the target access request based on the current global thread used number, the current thread used number of the target cluster and the target cluster thread threshold.
In order to achieve the above objective, another aspect of the present application further provides a line resource allocation device in a Radosgw module, where the device includes: the queue information acquisition module is used for acquiring request queue information, judging whether access requests exist in the request queue information, and identifying a target cluster identifier carried by any one target access request in each access request if the access requests exist; the thread information acquisition module is used for acquiring the current global thread used number, inquiring the current thread used number of the target cluster and a target cluster thread threshold according to the target cluster identifier, wherein the target cluster identifier is bound with the target cluster; and the thread resource allocation module is used for judging whether to allocate thread resources to the target access request based on the current global thread used number, the current thread used number of the target cluster and the target cluster thread threshold value.
In order to achieve the above objective, another aspect of the present application further provides a thread resource allocation device in a Radosgw module, where the thread resource allocation device includes a memory and a processor, where the memory is configured to store a computer program, and when the computer program is executed by the processor, the method for implementing the thread resource allocation is described above.
Therefore, in the technical scheme provided by the application, when the thread resource is allocated to any one access request, the cluster identifier carried in the access request can be first identified, then the cluster to be accessed by the access request is queried through the cluster identifier, further the current thread used number of the cluster and the thread threshold of the cluster are obtained, and then the current global thread used number is combined to judge whether the thread resource is allocated to the access request. By setting a thread threshold for each cluster, each cluster may be provided with a minimum amount of thread resource allocation, thereby ensuring that each cluster has a minimum response capability. Meanwhile, when judging whether to allocate the thread resources to the access requests, the system determines based on the current thread resource use condition, and the use condition of the thread resources is continuously changed along with time, so that the system can dynamically allocate the thread resources for each access request by combining the latest thread resource use condition. By the method, on one hand, the situation that the thread resources are occupied by requests for accessing one cluster and requests for accessing other clusters cannot be responded is avoided, and on the other hand, the thread resources distributed to each cluster can be adjusted in time according to the actual use condition of the thread resources, so that the overall use efficiency of the thread resources is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of the architecture of a resource pool in an embodiment of the present application;
FIG. 2 is a flow chart of a linear resource allocation method according to an embodiment of the present application;
FIG. 3 is a flow chart of a method of linear resource allocation in a second embodiment of the present application;
FIG. 4 is a schematic diagram of functional blocks of a linear resource allocation device according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a linear resource allocation device according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
CEPH (distributed file system) has advantages of high expandability, high performance, high reliability, etc., and at the same time, CEPH system can provide block storage service, object storage service, and file system storage service, so people are increasingly using CEPH system to store and manage data. With the rapid development of big data and cloud computing, people have put higher demands on data and storage, and a single CEPH cluster cannot meet the demands of people, so that combining a plurality of CEPH clusters together to provide better services has become a development trend.
The Radosgw module is an object storage service interface that acts as a component of the CEPH system, acting as an access gateway in the CEPH system. In the original CEPH system, one Radosgw module can only dock one CEPH cluster, so when a plurality of CEPH clusters form a large resource pool, one or more Radosgw modules need to be set for each CEPH cluster respectively, which may cause that the Radosgw module in the CEPH cluster with low access quantity is too idle, and the Radosgw module in the CEPH cluster with high access quantity becomes a bottleneck of the system, which is not beneficial to exerting the performance of all CEPH clusters. Aiming at the problems, a part of CEPH system improves a Radosgw module so that the Radosgw module can identify CEPH cluster ID numbers carried in access requests, each CEPH cluster in a resource pool is marked, a unique ID number is allocated to each CEPH cluster, when a request needs to access a specific CEPH cluster, the request can carry the ID number of the specific CEPH cluster in a message, and therefore the Radosgw module can send the request to the specific CEPH cluster. With the improvement, different CEPH clusters can be accessed through one Radosgw module.
However, another problem may occur in the above manner, that is, when a large number of requests for accessing a specific CEPH cluster arrive, or when the processing speed of a specific CEPH cluster is slow or not responding, the Radosgw module may step by step be occupied by the requests for accessing the CEPH cluster after receiving the requests, and then the requests for accessing other CEPH clusters cannot be processed and responded in time. If the thread resources of the Radosgw module are fixedly allocated according to the clusters in order to avoid that the thread resources of the Radosgw module are occupied by the requests for accessing the single clusters, the thread resources of the clusters with large access amount are insufficient, the thread resources of the clusters with small access amount are idle, and the use efficiency of the thread resources is reduced.
Therefore, how to dynamically adjust the thread resources for the requests accessing different clusters to improve the use efficiency of the thread resources, and avoid the exhaustion of the thread resources by the requests of a single cluster is a problem to be solved in the art.
The technical scheme provided by the application can solve the defects.
To facilitate an understanding of the CEPH cluster content referred to in this application, a brief description thereof is provided below.
CEPH is designed to build large-scale, high availability, high scalability, high performance distributed storage systems using commodity hardware. The system can form a super-large cluster by a plurality of servers, integrate disk resources in the machines into one block, and then allocate the disk resources to the application for use as required. The CEPH can be divided into two parts in structure, namely a CEPH client and a CEPH node, wherein the CEPH client is used for accessing the underlying services or components of the CEPH, and simultaneously, various interfaces, such as an object storage interface, a block storage interface and a file-level storage interface, are provided for the outside; CEPH node is the underlying service provider of CEPH and can be understood as a storage cluster. The Radosgw module is a functional component in ceph clients, belongs to an object storage interface, can provide a swift and s3 interface type restful api to the outside, has a buffer function, and can buffer a great number of access requests into a waiting queue when the access requests arrive at the Radosgw module at the same time so as to wait for a system to allocate thread resources for the Radosgw module.
In practical applications, CEPH clients and CEPH nodes are usually deployed on different servers, and multiple servers are combined together to provide services to the outside, where the multiple servers form a CEPH cluster. With the rapid development of cloud computing and big data, the service capability of a single CEPH cluster cannot meet the needs of people, so people combine a plurality of CEPH clusters together to construct a resource pool with larger service capability.
Please refer to fig. 1, which is a schematic diagram of a resource pool architecture in an embodiment of the present application.
In this embodiment, the resource pool includes three CEPH clusters, namely, CEPH-C1, CEPH-C2 and CEPH-C3, each CEPH cluster is bound with a unique cluster identifier, namely, C1, C2 and C3, and the resource pool is provided with a Radosgw module, which is simultaneously connected to each CEPH cluster, so that a user can access each CEPH cluster in the resource pool through the Radosgw module. Meanwhile, the Radosgw module may identify a CEPH cluster identifier carried in an access request sent by a user, and in practical application, when a request needs to access a specific CEPH cluster, the request packet may carry the cluster identifier of the specific CEPH cluster, so that the Radosgw module may send the request to the specific CEPH cluster. For example, rec-C1 indicates a request to access a CEPH-C1 cluster, rec-C2 indicates a request to access a CEPH-C2 cluster, rec-C3 indicates a request to access a CEPH-C3 cluster, and by identifying a cluster identifier carried in the access request, the embodiment can access different CEPH clusters through one Radosgw module.
It should be noted that, in this embodiment, the number of CEPH clusters is set to three, the number of Radosgw modules is set to one, which is merely illustrative, and not limiting, and the number of CEPH clusters may be set to be more or less, and the number of Radosgw modules may be set to be plural in other embodiments based on the concepts of the present application. When a plurality of Radosgw modules are arranged in the resource pool, each Radosgw module is connected with each CEPH cluster in the resource pool, and each Radosgw module can identify CEPH cluster identifiers carried in the access requests. It is also illustrative to indicate Rec-C1, rec-C2 and Rec-C3 as being sent by three different users, in practical applications, the same user may also send requests to access different CEPH clusters.
For convenience of description, only one Radosgw module is set in the resource pool for illustration.
Please refer to fig. 2, which is a flowchart illustrating a linear resource allocation method according to an embodiment of the present application.
S101: acquiring request queue information, judging whether access requests exist in the request queue information, and if the access requests exist, identifying a target cluster identifier carried by any one target access request in each access request.
In one embodiment, when a large number of access requests arrive at a certain Radosgw module at the same time, a request receiving thread in the Radosgw module may cache each access request into a waiting queue, and the waiting queue may play a role in buffering, so that the request receiving thread does not need to wait for the completion of the request, thereby solving the problem that the access request cannot be received in time.
It should be noted that, if there are multiple Radosgw modules in the CEPH system, the service system in the CEPH system may first select a Radosgw module with a smaller pressure from the multiple Radosgw modules based on the pressure conditions of the multiple Radosgw modules, and then send each access request sent by the user to the Radosgw module with a smaller pressure, so as to access the target cluster through the Radosgw module with a smaller pressure. In practical application, the service system can judge the pressure condition of each Radosgw module by counting the request quantity sent to each Radosgw module, the response speed of each Radosgw module, or reading the load information of each Radosgw module. Further, as the access request is continuously sent to the Radosgw module with smaller pressure, the pressure of the Radosgw module is continuously increased, the Radosgw module may have a reduced processing speed and even does not respond, so that the service system can determine that the load of the Radosgw module is larger, and then send the subsequent access request to other Radosgw modules, that is, the service system can acquire the pressure condition of each Radosgw module in real time or periodically, and always send the access request sent by the user to the Radosgw module with the minimum pressure.
It should be noted that, in this embodiment, the message information of each access request carries the cluster identifier of the CEPH cluster to be accessed by the message information, and the Radosgw module may identify the cluster identifier carried by the access request.
When the access requests are placed in the waiting queue, the Radosgw module may generate request queue information based on information carried by each access request for later use. It should be noted that even if the Radosgw module does not receive any access request, the Radosgw module will create a waiting queue when initializing, except that no access request exists in the waiting queue at this time, i.e. the waiting queue is an empty queue. In practical application, a thread resource dynamic allocation plug-in can be added in the Radosgw module, and the thread resource dynamic allocation plug-in can communicate with the Radosgw module in a thread synchronization mode, so that request queue information generated by the Radosgw module is obtained.
After the thread resource dynamic allocation plug-in acquires the request queue information, the thread resource dynamic allocation plug-in can judge whether an access request exists in the request queue information, namely, the thread resource dynamic allocation plug-in can judge whether the request queue is an empty queue, if the thread resource dynamic allocation plug-in judges that the request queue is an empty queue, the condition that the Radosgw module does not receive any access request at this time is indicated, namely, no access request needs to be allocated to the thread resource, so that the thread resource dynamic allocation plug-in can end the processing process and wait for the system to trigger the starting of the next processing process; if the thread resource dynamic allocation plug-in judges that an access request exists in the request queue, the fact that an access request which needs to be processed by the Radosgw module exists at the moment means that the thread resource needs to be allocated to the access request, the thread resource dynamic allocation plug-in can identify any one access request (namely a target access request) in the request queue information based on the acquired request queue information, and then a target cluster identifier carried in a target access request message is acquired.
It should be noted that, when identifying the access request, the thread resource dynamic allocation plug-in may sequentially perform the steps according to the arrangement order of the access requests in the request queue information, or may randomly take out one access request from the request queue information for processing, which is not limited in this application.
S102: and acquiring the current global thread used number, and inquiring the current thread used number of the target cluster and a target cluster thread threshold according to the target cluster identifier, wherein the target cluster identifier is bound with the target cluster.
In one embodiment, after the thread resource dynamic allocation plug-in obtains the target cluster identifier carried by the target access request, the thread resource dynamic allocation plug-in can communicate with the main thread in the Radosgw module, and inquire the current thread used number of the target cluster bound with the target cluster identifier according to the target cluster identifier, and meanwhile, the thread resource dynamic allocation plug-in can also obtain the current global thread used number from the Radosgw module. The number of used threads of the target cluster is used for indicating the number of thread resources occupied by the request for accessing the target cluster at the current moment, the number of used threads of the global thread is used for indicating the sum of the number of thread resources occupied by the request for accessing each cluster at the current moment, for example, three CEPH clusters of C1, C2 and C3 exist in a resource pool, taking the C1 cluster as the target cluster as an example, assuming that the number of occupied thread resources of the request for accessing the C1 cluster at the current moment is 10, the number of occupied thread resources of the request for accessing the C2 cluster is 5, and the number of occupied thread resources of the request for accessing the C3 cluster is 21, the number of used threads of the target cluster is 10, and the number of used global threads is 36.
Furthermore, the thread resource dynamic allocation plug-in can also be used for inquiring the target cluster thread threshold value set by the system according to the target cluster identification. In one embodiment, before the thread resource dynamic allocation plug-in acquires the request queue information, the Radosgw module can create a thread resource pool in advance, and set the total number of thread resources and the high water level number of the thread resources in the thread resource pool, wherein the total number of the thread resources is used for indicating the maximum number of thread resources which can be provided by the Radosgw module, namely, indicating how many access requests can be simultaneously processed by the Radosgw module at most; the thread resource high water level number is used for indicating a performance warning value of the Radosgw module, and when the number of access requests simultaneously processed by the Radosgw module reaches the thread resource high water level number, the access requests need to be limited (for example, processing of new access requests is stopped) so as to avoid the Radosgw module from malfunctioning. In practical applications, the Radosgw module may set the total number of thread resources and the high level number of thread resources according to the hardware performance (such as CPU computing power, memory/hard disk read-write performance) of the server and the empirical value, and may generally set the high level number of thread resources to any value between 50% and 80% of the total number of thread resources.
It should be noted that, the operation of creating the thread resource pool may also be performed by a thread resource dynamic allocation plug-in, where the thread resource dynamic allocation plug-in is used as an operation controller, and the Radosgw module is used as a thread resource provider, and the Radosgw module may receive an instruction of the thread resource dynamic allocation plug-in, and generate the thread resource pool for the thread resource dynamic allocation plug-in to call.
After the Radosgw module completes the setting of the total number of thread resources and the high water level of the thread resources, the Radosgw module can set the thread threshold of each cluster according to the total number of thread resources, the high water level of the thread resources and the number of clusters, wherein the thread threshold comprises a thread resource upper limit value and a thread resource lower limit value. The thread resource upper limit value is used for indicating the maximum thread resource number which can be provided by the Radosgw module for a certain CEPH cluster, and when the thread resource number which is allocated by the Radosgw module for the certain CEPH cluster reaches the thread resource upper limit value, even if the Radosgw module receives a request for accessing the CEPH cluster again, the thread resource dynamic allocation plug-in unit can not allocate thread resources for the access request. The thread resource lower limit value is used for indicating the lowest thread resource number reserved by the Radosgw module for a certain CEPH cluster, and the thread resource lower limit value ensures that the Radosgw module can provide the lowest thread resource for the CEPH cluster through the thread resource dynamic allocation plug-in even if the thread resource use number of the Radosgw module reaches the performance guard value, so that the situation that the thread resource is occupied by requests for accessing other CEPH clusters, and the requests for accessing the CEPH cluster cannot be processed is avoided.
In practical applications, the thread resource upper limit value and the thread resource lower limit value may be set in combination with the thread resource total number, the thread resource high water level number and the cluster number, for example, the thread resource high water level number is represented by resource_total, the cluster number is represented by n, the thread resource upper limit value is represented by req_max, and the thread resource lower limit value is represented by req_min, and req_max may be set to any value between resource_water mark/(n×40) and resource_water mark/(n×20%), and req_min may be set to any value between (resource_total-resource_water mark)/(n×70%) and (resource_total-resource_water mark)/n.
It should be noted that, when specific values of req_min and req_max are set for a certain CEPH cluster, reference may be further made to the access frequency of the CEPH cluster and/or the hardware performance of the server, for example, for a CEPH cluster with stronger hardware performance of the server, the value of req_max may be set closer to the right end of the value interval, and for a CEPH cluster with weaker hardware performance of the server, the value of req_max may be set closer to the left end of the value interval, where the specific values of req_min and req_max are not limited in this application.
S103: and judging whether to allocate thread resources to the target access request based on the current global thread used number, the current thread used number of the target cluster and the target cluster thread threshold.
In one embodiment, after the thread resource dynamic allocation plug-in obtains the current global thread used number, the current thread used number of the target cluster and the target cluster thread threshold, the thread resource dynamic allocation plug-in can determine whether to allocate the thread resource to the target access request based on the obtained information and in combination with a preset thread resource allocation rule.
The determination of whether to allocate thread resources to a target access request based on the current global thread usage number, the current thread usage number of the target cluster, and the target cluster thread threshold is described in detail below in conjunction with fig. 3.
In one embodiment, the thread resource dynamic allocation plug-in may first determine whether the current global thread usage number is less than the thread resource high water level number, if the current global thread usage number is less than the thread resource high water level number, further determine whether the current thread usage number of the target cluster is less than the thread resource upper limit value of the target cluster, and if the current thread usage number of the target cluster is less than the thread resource upper limit value of the target cluster, the thread resource dynamic allocation plug-in may allocate the thread resource to the target access request.
In this embodiment, when there are more requests for accessing the target cluster and the current thread resource usage rate is low (i.e., the current global thread usage number is smaller than the thread resource high water level number), if the thread resource number occupied by the request for accessing the target cluster does not reach the thread resource upper limit value of the target cluster (i.e., the current thread usage number of the target cluster is smaller than the thread resource upper limit value of the target cluster), the thread resource dynamic allocation plug-in may continue to allocate the thread resource to the target access request, so that the target access request may access the target cluster.
In practical application, after the thread resource dynamic allocation plug-in judges that the thread resource is allocated to the target access request, the thread resource dynamic allocation plug-in can allocate the thread resource to the target access request through the thread resource pool. For example, the thread resource dynamic allocation plug-in may first determine whether a core thread pool in the thread resource pool is full, if the core thread Chi Weiman, the thread resource dynamic allocation plug-in may notify the Radosgw module to create a new work thread to perform the task of the target access request, and if the core thread pool is full, the thread resource dynamic allocation plug-in may place the target access request into a task queue of the thread resource pool to wait for execution. It should be noted that, the task queue in the thread resource pool is a blocking queue, so as to ensure that when no task exists in the task queue, the thread acquiring the task is blocked, so that the thread in the thread resource pool enters a waiting state, and the cpu resource is released.
The current global thread used number becomes larger in value after the thread resource dynamic allocation plug-in allocates the thread resource for the target access request, so that the thread resource dynamic allocation plug-in also needs to update the current global thread used number, and the latest current thread used number can be obtained when the thread resource dynamic allocation plug-in judges whether to allocate the thread resource for the next access request. Similarly, the thread resource dynamic allocation plug-in also needs to update the current thread used number of the target cluster, so that the thread resource dynamic allocation plug-in can acquire the latest current thread used number of the target cluster when processing the next request for accessing the target cluster. Correspondingly, after the thread resource dynamic allocation plug-in updates the current global thread used number and the current thread used number of the target cluster, the thread resource dynamic allocation plug-in also needs to delete the target access request from the request queue information so as to avoid repeatedly allocating the thread resource to the target access request.
In practical applications, the thread resources that can be provided by the Radosgw module are limited, so that the problem of recovering the thread resources needs to be considered. In one implementation manner, after the thread resource dynamic allocation plug-in deletes the target access request from the request queue information, the thread resource dynamic allocation plug-in may also obtain an execution state of the target access request, and after the thread resource dynamic allocation plug-in determines that the target access request has been executed, the thread resource dynamic allocation plug-in may reclaim the thread resource allocated to the target access request, i.e. reclaim the thread resource that is to process the target access request, and put the reclaimed thread resource into the thread resource pool again, so that the thread resource dynamic allocation plug-in allocates the thread resource to other access requests. Correspondingly, after the thread resource dynamic allocation plug-in re-places the thread resource into the thread resource pool, the current global thread used number and the current thread used number of the target cluster change, so that the thread resource dynamic allocation plug-in also needs to update the current global thread used number and the current thread used number of the target cluster.
In another embodiment, if the thread resource dynamic allocation plug-in determines that the current global thread usage number is smaller than the thread resource high-level number, and the current thread usage number of the target cluster is greater than or equal to the thread resource upper limit value of the target cluster, it indicates that the number of thread resources occupied by the current request for accessing the target cluster is already large, and at this time, the request for accessing the target cluster is already satisfied to a great extent, so as to avoid that the request for accessing other clusters cannot acquire the thread resources and result in a long-time failure, the thread resource dynamic allocation plug-in will not allocate the thread resources to the target access request any more, but will continue placing the target access request in the request queue information to wait for the next cycle to process.
In another embodiment, if the thread resource dynamic allocation plug-in determines that the current global thread usage number is greater than or equal to the thread resource high water level number, it may further determine whether the current thread usage number of the target cluster is less than the thread resource lower limit value of the target cluster, and if the current thread usage number of the target cluster is less than the thread resource lower limit value of the target cluster, the thread resource dynamic allocation plug-in may allocate the thread resource to the target access request.
In this embodiment, if the current global thread has used up to the high water level of the thread resource, it indicates that the current thread resource usage rate is higher, in order to avoid the occurrence of a failure due to exhaustion of the resources of the Radosgw module, a request for accessing the target cluster needs to be limited at this time, but in order to not interrupt the processing of the request for accessing the target cluster directly, the thread resource dynamic allocation plug-in needs to refer to the lower limit value of the thread resource of the target cluster, and if the current thread usage rate of the target cluster is less than the lower limit value of the thread resource of the target cluster, it indicates that the lowest thread resource reserved by the Radosgw module for the target cluster is not exhausted, so that the thread resource dynamic allocation plug-in can allocate the thread resource to the target access request to meet the minimum access requirement of the target cluster.
In another embodiment, if the thread resource dynamic allocation plug-in determines that the current global thread usage number is greater than or equal to the thread resource high water level number and the current thread usage number of the target cluster is greater than or equal to the thread resource lower limit value of the target cluster, it indicates that the current thread resource usage rate is higher, and the lowest thread resource reserved by the Radosgw module for the target cluster is exhausted, in order to avoid that the request for accessing other clusters cannot apply for the lowest thread resource, the thread resource dynamic allocation plug-in will not allocate the thread resource to the target access request any more, but will continue placing the target access request in the request queue information to wait for the next cycle to process the target access request.
It should be noted that the current global thread used count and the current thread used count of the target cluster are constantly changing over time. For example, when the target access request is processed, the current global thread usage will decrease as thread resources are reclaimed, as will the current thread usage of the target cluster. As the thread resource dynamic allocation plug-in continuously allocates thread resources for the request for accessing the target cluster, the current thread used number of the target cluster will be continuously increased, and the current global thread used number will be continuously increased. Therefore, each time a request for accessing a target cluster is processed, the thread resource dynamic allocation plug-in needs to determine whether to allocate thread resources for the target cluster according to the number of used threads and the number of used global threads of the target cluster at the current moment.
Because the Radosgw module continuously receives the external access request, the request queue information generated by the Radosgw module is continuously changed along with time, so in one embodiment, the thread resource dynamic allocation plug-in can also set a detection interval time, and periodically acquire the request queue information generated by the Radosgw module based on the detection interval time. Meanwhile, the thread resource dynamic allocation plug-in unit deletes the access request from the request queue information after allocating the thread resource for any access request, so that the access request contained in the request queue information generated by the Radosgw module is necessarily not allocated with the thread resource, and therefore, the thread resource dynamic allocation plug-in unit can process each access request based on the request queue information acquired in the latest period and judge whether to allocate the thread resource for the access request.
Referring to fig. 4, the present application further provides a thread resource allocation apparatus, where the apparatus includes:
the queue information acquisition module is used for acquiring request queue information, judging whether access requests exist in the request queue information, and identifying a target cluster identifier carried by any one target access request in each access request if the access requests exist;
the thread information acquisition module is used for acquiring the current global thread used number, inquiring the current thread used number of the target cluster and a target cluster thread threshold according to the target cluster identifier, wherein the target cluster identifier is bound with the target cluster;
and the thread resource allocation module is used for judging whether to allocate thread resources to the target access request based on the current global thread used number, the current thread used number of the target cluster and the target cluster thread threshold value.
In one embodiment, the apparatus further comprises:
the thread resource creating module is used for creating a thread resource pool, setting the total number of thread resources and the high water level of the thread resources in the thread resource pool, and setting the thread threshold value of each cluster according to the total number of thread resources, the high water level of the thread resources and the number of clusters, wherein the thread threshold value comprises a thread resource upper limit value and a thread resource lower limit value.
In one embodiment, the thread resource allocation module determining whether to allocate thread resources to the target access request based on the current global thread used number, the target cluster current thread used number, and the target cluster thread threshold comprises:
judging whether the current global thread used number is smaller than the thread resource high water level number, if so, judging whether the current thread used number of the target cluster is smaller than the thread resource upper limit value of the target cluster, and if so, distributing thread resources to the target access request;
and if the current thread usage number of the target cluster is greater than or equal to the thread resource upper limit value of the target cluster, not distributing thread resources to the target access request.
In one embodiment, the thread resource allocation module is further configured to determine whether the current thread used by the target cluster is less than the lower limit value of the thread resource of the target cluster if the current global thread used by the current thread is greater than or equal to the high water level of the thread resource, and allocate the thread resource to the target access request if the current thread used by the target cluster is less than the lower limit value of the thread resource of the target cluster;
And if the current thread usage number of the target cluster is greater than or equal to the thread resource lower limit value of the target cluster, not distributing thread resources to the target access request.
In one embodiment, the thread resource allocation module is further configured to allocate thread resources to the target access request through the thread resource pool, and update the current global thread used number and the current thread used number of the target cluster;
the queue information acquisition module is further configured to delete the target access request from the request queue information.
In one embodiment, the apparatus further comprises:
and the thread resource recovery module is used for acquiring the execution state of the target access request, recovering the thread resources allocated to the target access request when the target access request is executed, and updating the current global thread used number and the current thread used number of the target cluster.
In one embodiment, the queue information obtaining module is further configured to set a probe interval time, and obtain the request queue information periodically based on the probe interval time.
Referring to fig. 5, the present application further provides a thread resource allocation apparatus, where the thread resource allocation apparatus includes a memory and a processor, and the memory is configured to store a computer program, and when the computer program is executed by the processor, the thread resource allocation method described above may be implemented. In particular, at the hardware level, the model deployment device may include a processor, an internal bus, and a memory. The memory may include memory and non-volatile memory. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs. It will be appreciated by those of ordinary skill in the art that the configuration shown in FIG. 5 is merely illustrative and is not intended to limit the configuration of the thread resource allocation apparatus described above. For example, the thread resource allocation apparatus may also include more or fewer components than shown in FIG. 5, such as may include other processing hardware, such as a GPU (Graphics Processing Unit, image processor), or an external communication port, etc. Of course, in addition to software implementations, this application does not exclude other implementations, such as a logic device or a combination of hardware and software, etc.
In this embodiment, the processor may include a Central Processing Unit (CPU) or a Graphics Processing Unit (GPU), and of course, may also include other singlechips, logic gates, integrated circuits, etc. with logic processing capability, or a suitable combination thereof. The memory according to the present embodiment may be a memory device for storing information. In a digital system, the device capable of holding binary data may be a memory; in the integrated circuit, a circuit with a memory function without physical form can also be a memory, such as a RAM, a FIFO, etc.; in the system, a storage device having a physical form may also be called a memory or the like. When the method is implemented, the memory can also be implemented in a cloud memory mode, and the specific implementation mode is not limited in the specification.
It should be noted that, in the thread resource allocation device in the present specification, a specific implementation manner may refer to description of a method embodiment, which is not described herein in detail.
Therefore, in the technical scheme provided by the application, when the thread resource is allocated to any one access request, the cluster identifier carried in the access request can be first identified, then the cluster to be accessed by the access request is queried through the cluster identifier, further the current thread used number of the cluster and the thread threshold of the cluster are obtained, and then the current global thread used number is combined to judge whether the thread resource is allocated to the access request. By setting a thread threshold for each cluster, each cluster may be provided with a minimum amount of thread resource allocation, thereby ensuring that each cluster has a minimum response capability. Meanwhile, when judging whether to allocate the thread resources to the access requests, the system determines based on the current thread resource use condition, and the use condition of the thread resources is continuously changed along with time, so that the system can dynamically allocate the thread resources for each access request by combining the latest thread resource use condition. By the method, on one hand, the situation that the thread resources are occupied by requests for accessing one cluster and requests for accessing other clusters cannot be responded is avoided, and on the other hand, the thread resources distributed to each cluster can be adjusted in time according to the actual use condition of the thread resources, so that the overall use efficiency of the thread resources is improved.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or may be implemented by hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
The foregoing description of the preferred embodiments of the invention is not intended to limit the invention to the precise form disclosed, and any such modifications, equivalents, and alternatives falling within the spirit and scope of the invention are intended to be included within the scope of the invention.

Claims (15)

1. A method for allocating linear resources in a Radosgw module, the method comprising:
creating a thread resource pool, setting a thread resource high water level of the thread resource pool, acquiring request queue information, judging whether access requests exist in the request queue information, and if so, identifying a target cluster identifier carried by any one target access request in each access request;
Acquiring the current global thread used number, and inquiring the current thread used number of a target cluster and a target cluster thread threshold according to the target cluster identifier, wherein the target cluster identifier is bound with the target cluster;
and judging whether to allocate thread resources to the target access request based on the current global thread used number, the current thread used number of the target cluster and the target cluster thread threshold, wherein if the current global thread used number is smaller than the thread resource high water level number and the current thread used number of the target cluster is smaller than the target cluster thread threshold upper limit value, allocating thread resources to the target access request.
2. The method of claim 1, wherein prior to obtaining the request queue information, the method further comprises:
setting the total number of thread resources of the thread resource pool;
and setting a thread threshold value of each cluster according to the total number of the thread resources, the high water level number of the thread resources and the cluster number, wherein the thread threshold value comprises an upper limit value of the thread resources and a lower limit value of the thread resources.
3. The method of claim 2, wherein determining whether to allocate thread resources to the target access request based on the current global thread used number, the target cluster current thread used number, and the target cluster thread threshold comprises:
If the current global thread used number is smaller than the thread resource high water level number and the current thread used number of the target cluster is larger than or equal to the thread resource upper limit value of the target cluster, not distributing thread resources to the target access request.
4. A method according to claim 3, characterized in that the method further comprises:
if the current global thread used number is greater than or equal to the thread resource high water number, judging whether the current thread used number of the target cluster is smaller than the thread resource lower limit value of the target cluster, and if the current thread used number of the target cluster is smaller than the thread resource lower limit value of the target cluster, distributing thread resources to the target access request;
and if the current thread usage number of the target cluster is greater than or equal to the thread resource lower limit value of the target cluster, not distributing thread resources to the target access request.
5. The method of claim 2, wherein after determining to allocate thread resources to the target access request, the method further comprises:
distributing thread resources to the target access request through the thread resource pool, and updating the current global thread used number and the current thread used number of the target cluster;
And deleting the target access request from the request queue information.
6. The method of claim 5, wherein after deleting the target access request from the request queue information, the method further comprises:
and acquiring the execution state of the target access request, recovering thread resources allocated to the target access request when the target access request is executed, and updating the current global thread used number and the current thread used number of the target cluster.
7. The method according to claim 1, wherein the method further comprises:
and setting a detection interval time, and periodically acquiring the request queue information based on the detection interval time.
8. A linear resource allocation device in a Radosgw module, the device comprising:
the thread resource creation module is used for creating a thread resource pool and setting the thread resource high water level number of the thread resource pool;
the queue information acquisition module is used for acquiring request queue information, judging whether access requests exist in the request queue information, and identifying a target cluster identifier carried by any one target access request in each access request if the access requests exist;
The thread information acquisition module is used for acquiring the current global thread used number, inquiring the current thread used number of the target cluster and a target cluster thread threshold according to the target cluster identifier, wherein the target cluster identifier is bound with the target cluster;
and the thread resource allocation module is used for judging whether to allocate thread resources to the target access request based on the current global thread used number, the current thread used number of the target cluster and the target cluster thread threshold value, wherein if the current global thread used number is smaller than the thread resource high water level number and the current thread used number of the target cluster is smaller than the target cluster thread threshold value upper limit value, the thread resources are allocated to the target access request.
9. The apparatus of claim 8, wherein the apparatus further comprises:
the thread resource creation module is used for setting the total number of thread resources in the thread resource pool and setting the thread threshold value of each cluster according to the total number of thread resources, the high water level number of the thread resources and the number of clusters, wherein the thread threshold value comprises a thread resource upper limit value and a thread resource lower limit value.
10. The apparatus of claim 9, wherein the thread resource allocation module determining whether to allocate thread resources to the target access request based on the current global thread used number, the target cluster current thread used number, and the target cluster thread threshold comprises:
if the current global thread used number is smaller than the thread resource high water level number and the current thread used number of the target cluster is larger than or equal to the thread resource upper limit value of the target cluster, not distributing thread resources to the target access request.
11. The apparatus of claim 10, wherein the device comprises a plurality of sensors,
the thread resource allocation module is further configured to determine whether the current thread used number of the target cluster is smaller than a thread resource lower limit value of the target cluster if the current global thread used number is greater than or equal to the thread resource high water number, and allocate thread resources to the target access request if the current thread used number of the target cluster is smaller than the thread resource lower limit value of the target cluster;
and if the current thread usage number of the target cluster is greater than or equal to the thread resource lower limit value of the target cluster, not distributing thread resources to the target access request.
12. The apparatus of claim 9, wherein the device comprises a plurality of sensors,
the thread resource allocation module is further configured to allocate thread resources to the target access request through the thread resource pool, and update the current global thread used number and the current thread used number of the target cluster;
the queue information acquisition module is further configured to delete the target access request from the request queue information.
13. The apparatus of claim 12, wherein the apparatus further comprises:
and the thread resource recovery module is used for acquiring the execution state of the target access request, recovering the thread resources allocated to the target access request when the target access request is executed, and updating the current global thread used number and the current thread used number of the target cluster.
14. The apparatus of claim 8, wherein the device comprises a plurality of sensors,
the queue information acquisition module is further configured to set a probe interval time, and periodically acquire the request queue information based on the probe interval time.
15. A thread resource allocation device in a Radosgw module, characterized in that the thread resource allocation device comprises a memory and a processor, the memory being for storing a computer program which, when executed by the processor, implements the method of any of claims 1 to 7.
CN202010585943.0A 2020-06-24 2020-06-24 Method and device for allocating linear resources in Radosgw module Active CN111857992B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010585943.0A CN111857992B (en) 2020-06-24 2020-06-24 Method and device for allocating linear resources in Radosgw module

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010585943.0A CN111857992B (en) 2020-06-24 2020-06-24 Method and device for allocating linear resources in Radosgw module

Publications (2)

Publication Number Publication Date
CN111857992A CN111857992A (en) 2020-10-30
CN111857992B true CN111857992B (en) 2024-04-16

Family

ID=72988074

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010585943.0A Active CN111857992B (en) 2020-06-24 2020-06-24 Method and device for allocating linear resources in Radosgw module

Country Status (1)

Country Link
CN (1) CN111857992B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114327899A (en) * 2021-12-29 2022-04-12 中国电信股份有限公司 Method and device for responding to access request, nonvolatile storage medium and processor
CN115080201B (en) * 2022-05-07 2024-05-14 北京控制工程研究所 Emergency task-oriented high-reliability satellite autonomous task planning method and system
CN115643309A (en) * 2022-10-27 2023-01-24 极道科技(北京)有限公司 Dynamic flow control method and system based on request scheduling queue length
CN118051346B (en) * 2024-04-11 2024-07-12 恒生电子股份有限公司 Method, device, electronic equipment and readable storage medium for requesting dynamic current limiting

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103649932A (en) * 2011-05-20 2014-03-19 索夫特机械公司 Decentralized allocation of resources and interconnect structures to support the execution of instruction sequences by a plurality of engines
CN106470169A (en) * 2015-08-19 2017-03-01 阿里巴巴集团控股有限公司 A kind of service request method of adjustment and equipment
CN107153653A (en) * 2016-03-03 2017-09-12 阿里巴巴集团控股有限公司 The poll access method and device of table are divided in a kind of point of storehouse
CN109710402A (en) * 2018-12-17 2019-05-03 平安普惠企业管理有限公司 Method, apparatus, computer equipment and the storage medium of process resource acquisition request

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10108364B2 (en) * 2015-06-26 2018-10-23 Nxp Usa, Inc. IC module and method of decoding resource access requests

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103649932A (en) * 2011-05-20 2014-03-19 索夫特机械公司 Decentralized allocation of resources and interconnect structures to support the execution of instruction sequences by a plurality of engines
CN106470169A (en) * 2015-08-19 2017-03-01 阿里巴巴集团控股有限公司 A kind of service request method of adjustment and equipment
CN107153653A (en) * 2016-03-03 2017-09-12 阿里巴巴集团控股有限公司 The poll access method and device of table are divided in a kind of point of storehouse
CN109710402A (en) * 2018-12-17 2019-05-03 平安普惠企业管理有限公司 Method, apparatus, computer equipment and the storage medium of process resource acquisition request

Also Published As

Publication number Publication date
CN111857992A (en) 2020-10-30

Similar Documents

Publication Publication Date Title
CN111857992B (en) Method and device for allocating linear resources in Radosgw module
JP5510556B2 (en) Method and system for managing virtual machine storage space and physical hosts
US20160306680A1 (en) Thread creation method, service request processing method, and related device
CN109564528B (en) System and method for computing resource allocation in distributed computing
CN113037794B (en) Method, device and system for computing resource allocation scheduling
CN110196770B (en) Cloud system memory data processing method, device, equipment and storage medium
CN111309644B (en) Memory allocation method and device and computer readable storage medium
CN113485822A (en) Memory management method, system, client, server and storage medium
CN111190745A (en) Data processing method and device and computer readable storage medium
CN112398945B (en) Service processing method and device based on backpressure
CN106385377B (en) Information processing method and system
WO2016202154A1 (en) Gpu resource allocation method and system
CN112860387A (en) Distributed task scheduling method and device, computer equipment and storage medium
CN110647392A (en) Intelligent elastic expansion method based on container cluster
CN114785739B (en) Control method, device, equipment and medium for service quality of logical volume
CN113010453A (en) Memory management method, system, equipment and readable storage medium
CN109819674B (en) Computer storage medium, embedded scheduling method and system
CN118069575A (en) Storage space management method and management equipment
CN115378885B (en) Virtual machine service network bandwidth management method and device under super fusion architecture
CN112559115A (en) Method, device and equipment for deleting container mirror image
CN110046040B (en) Distributed task processing method and system and storage medium
CN113986458A (en) Container set scheduling method, device, equipment and storage medium
CN114860334B (en) Processing method, device, equipment and medium for virtual machine starting storm
CN113762954B (en) Hot account transaction processing method and device, electronic equipment and storage medium
CN118349336B (en) Method, device, equipment, medium and product for task processing in cloud computing platform

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant