Resource scheduling method and device
By obtaining task parameters and using the target model to determine the number of requests per second and the required CPU cores of a single-core CPU, resource scheduling is performed, and the problem of low efficiency in the current technology of concurrent request processing capability testing is solved, and more accurate resources are achieved Improve utilization and testing efficiency.
Patent Information
- Application Number
- CN202411378541.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-01-07
AI Technical Summary
The prior art is less efficient when testing the server's concurrent request processing capability, mainly due to the inaccurate measurement of the maximum number of requests of a single-core CPU, which leads to insufficient or excessive scheduling of the CPU cores, affecting the testing efficiency and resource utilization.
By obtaining the task parameters of the test task to be executed, enter the target model to determine the number of requests per second executed by a single-core CPU, and accurately calculate the required number of CPU cores based on this, and perform resource scheduling to perform test tasks using the target generator.
It improves the efficiency of testing the server-side concurrent request processing capability, ensures effective utilization of CPU resources, and avoids resource waste caused by misjudgment and problems of unachievable testing goals.
Smart Images

Figure CN119271409A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a resource scheduling method and device. Background Art
[0002] After the application is released, the user can install the application on the terminal device to experience the functions provided by the application. When the user performs corresponding operations on the application installed on his terminal device, the application can interact with the server corresponding to the application to realize the functions provided by the application.
[0003] When there are a large number of users using an application, the server may receive a large number of concurrent requests. In order to provide users with a better application experience, the server is required to have a good concurrent request processing capability. In some scenarios, the concurrent request processing capability of the server can be tested.
[0004] The current method of testing the concurrent request processing capability of the server has the problem of low efficiency. Therefore, a solution is urgently needed to solve the above problem. Summary of the invention
[0005] In order to solve or at least partially solve the above technical problems, the present application provides a resource scheduling method and device.
[0006] In a first aspect, the present application provides a resource scheduling method, the method comprising:
[0007] Obtaining task parameters of a test task to be executed, where the test task to be executed is used to test the concurrent request processing capability of the server;
[0008] Inputting the task parameters into the target model to obtain the number of requests per second that can be achieved by a single-core central processing unit to execute the test task to be executed;
[0009] Determine the number of CPU cores required to execute the test task to be executed based on the number of requests per second and the test target of the test task to be executed;
[0010] Resource scheduling is performed based on the number of CPU cores to determine a target compressor that meets the number of CPU cores, so as to utilize the target compressor to execute the test task to be executed.
[0011] In a second aspect, the present application provides a resource scheduling device, the device comprising:
[0012] An acquisition unit, used for acquiring task parameters of a test task to be executed, wherein the test task to be executed is used for testing the concurrent request processing capability of the server;
[0013] An input unit, used for inputting the task parameters into a target model to obtain the number of requests per second that can be achieved by a single-core central processing unit in executing the test task to be executed;
[0014] A first determining unit, configured to determine the number of CPU cores required to execute the test task to be executed based on the number of requests per second and the test target of the test task to be executed;
[0015] The second determining unit is used to perform resource scheduling based on the number of CPU cores to determine a target compressor that meets the number of CPU cores, so as to utilize the target compressor to execute the test task to be executed.
[0016] In a third aspect, an embodiment of the present application provides an electronic device, the electronic device comprising a processor and a memory;
[0017] The processor is used to execute instructions stored in the memory so that the electronic device executes the method described in the first aspect above.
[0018] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, comprising instructions, wherein the instructions instruct a device to execute the method described in the first aspect above.
[0019] In a fifth aspect, an embodiment of the present application provides a computer program product, which, when executed on a computer, enables the computer to execute the method described in the first aspect above.
[0020] Compared with the prior art, the embodiments of the present application have the following advantages:
[0021] The present application provides a resource scheduling method, which includes: for a test task to be executed that is used to test the concurrent request processing capability of a server, obtaining the task parameters of the test task to be executed, and inputting the task parameters of the test task to be executed into a target model. The target model is used to determine the number of requests per second (QPS) that can be achieved by a single-core central processing unit (Central Processing Unit, CPU) executing a task corresponding to the task parameters based on the input task parameters. Therefore, after inputting the task parameters of the test task to be executed into the target model, the QPS that can be achieved by a single-core CPU executing the test task to be executed can be obtained. Furthermore, the number of CPU cores required to execute the test task to be executed can be determined based on the QPS and the test target of the test task to be executed. After determining the number of CPU cores, resource scheduling can be performed based on the number of CPU cores to determine a target transmitter that meets the number of CPU cores, so as to use the target transmitter to execute the test task to be executed. It can be seen that, by using this solution, instead of subjectively judging the QPS that a single-core CPU can achieve by executing the test task to be executed based on user experience, the target model can be used to accurately determine the QPS that a single-core CPU can achieve by executing the test task to be executed, thereby accurately determining the number of CPU cores required to execute the test task to be executed, and further accurately determining the target compressor that meets the number of CPU cores, thereby improving the execution efficiency of the test task to be executed. That is, by using this solution, the efficiency of testing the concurrent request processing capability of the server can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0023] Figure 1 A schematic diagram of a resource scheduling method provided in an embodiment of the present application;
[0024] Figure 2 A process diagram of a concurrent request processing capability testing method provided in an embodiment of the present application;
[0025] Figure 3 A flowchart of a model training method provided in an embodiment of the present application;
[0026] Figure 4A schematic diagram showing an environment of an offline experimental system and an environment of an online testing platform;
[0027] Figure 5 A schematic diagram of the structure of a resource scheduling device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0028] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0029] At present, when evaluating the concurrent request processing capability of the server, the user (such as a tester) can evaluate the QPS upper limit that a single-core CPU can achieve based on experience, that is, evaluate how many request messages a single-core CPU can send to the server in one second. Then, based on the test goal and the QPS upper limit that a single-core CPU can achieve, determine the number of CPU cores required to test the concurrent request processing capability of the server, and further, based on the required number of CPU cores, schedule the compressor resources, so as to use the scheduled compressor resources to evaluate the concurrent request processing capability of the server. Among them, the test goal is generally used to indicate whether the concurrent request processing capability of the test server can reach a certain threshold.
[0030] For example:
[0031] The test goal is to test whether the concurrent request processing capability of the server can reach 100,000 QPS. Based on subjective experience, the tester estimates that the maximum QPS that a single-core CPU can achieve is about 2,000. It can be determined that the number of CPU cores required to test the aforementioned test goal is 100,000 / 2,000 = 50. Furthermore, the user can schedule the compressor resources according to the number of available CPU cores of each compressor, and use the scheduled compressor resources to evaluate the concurrent request processing capability of the server. For example, the number of CPU cores available for each of the 10 compressors from compressor 1 to compressor 10 is 5. Then, the 10 compressors from compressor 1 to compressor 10 can be used to execute requests to the server, thereby evaluating whether the concurrent request processing capability of the server can reach 100,000 QPS.
[0032] However, since the maximum QPS that a single-core CPU can achieve is evaluated by the user based on experience, and the accuracy of the aforementioned maximum QPS that is manually evaluated is not high, the efficiency of testing the concurrent request processing capability of the server is accordingly low. Specifically, if the aforementioned maximum QPS estimated by the user is greater than the actual QPS that a single-core CPU can achieve, then when determining the number of CPU cores required to test the test target based on the maximum QPS estimated by the user, the determined number of CPU cores is insufficient to complete the aforementioned test target, resulting in the user needing to reschedule resources to complete the aforementioned test target, which in turn results in a low efficiency in evaluating the concurrent request processing capability of the server.
[0033] In addition, if the maximum QPS estimated by the user is less than the actual QPS that can be achieved by a single-core CPU, the CPU resources cannot be effectively utilized, resulting in a waste of CPU resources.
[0034] In this application, the transmitter can be understood as a device for sending a request to the server. The device mentioned here can be a client, or a device or virtual machine integrated with client functions, etc., which is not limited in the embodiments of this application.
[0035] In order to solve the above-mentioned problem of "low efficiency in testing the concurrent request processing capability of the server", the present application provides a resource scheduling method and device.
[0036] Various non-limiting implementations of the present application are described in detail below in conjunction with the accompanying drawings.
[0037] Exemplary Methods
[0038] See also Figure 1 , which is a flow chart of a resource scheduling method provided in an embodiment of the present application. The method provided in an embodiment of the present application can be applied to a test system (or a test platform), which is used to test the concurrent request processing capability of the server. In a specific example, the method provided in an embodiment of the present application can be applied to a resource scheduling module in a test system (or a test platform).
[0039] In this embodiment, the method may include the following steps: S101-S104.
[0040] S101: Obtain task parameters of a test task to be executed, where the test task to be executed is used to test the concurrent request processing capability of the server.
[0041] In the present application, the test task to be executed is used to test the concurrent request processing capability of the server, and the embodiments of the present application do not specifically limit the server. In one example, the server may be a server corresponding to an application (APP). In another example, the server may also be a server corresponding to a specific function, for example, the server is a server corresponding to a video download function.
[0042] In one example, when S101 is implemented, the task parameters of the to-be-executed test task may be obtained by reading a configuration file, wherein the configuration file includes the task parameters of the to-be-tested task.
[0043] In another example, the test platform provides a test task information input interface, in which the user can input the task parameters of the test task to be executed. In this case, S101 can obtain the task parameters of the test task to be executed input by the user in the test platform during specific implementation.
[0044] The task parameters of the test task to be executed mentioned in the embodiment of the present application may include at least one parameter related to the test task to be executed. As a specific example, the task parameters of the task to be tested may include parameters that have a certain impact on the resource occupation of the CPU. The certain impact on the resource occupation of the CPU mentioned here refers to a certain impact on the CPU resources consumed by the transmitter and compressor to process the message corresponding to the task to be tested. The message corresponding to the task to be tested mentioned here may include a request message sent by the transmitter and compressor, and / or a response message received by the transmitter and compressor.
[0045] Regarding request messages and response messages, it should be noted that after the transmitter sends a request message to the server, the server can parse the request message and return a response message to the transmitter. For example, in the video download scenario, the transmitter sends a video download request to the server, and the server can obtain the corresponding video resource based on the video download request and return it to the transmitter in the aforementioned response message.
[0046] In one example, considering the request type adopted by the test task to be executed, it has a certain impact on the resource occupation of the CPU. Specifically: the request type mentioned here includes but is not limited to Hypertext Transfer Protocol (HTTP) or Hypertext Transfer Protocol Secure (HTTPS). Because HTTPS ensures the security of the transmission process through transmission encryption and identity authentication on the basis of HTTP. Therefore, sending a request message of the HTTPS type consumes more CPU resources than sending a request message of the HTTP type. Therefore, the task parameters of the aforementioned test task to be executed may include the request type adopted by the test task to be executed.
[0047] In another example, considering the connection reuse rate corresponding to the execution of the test task, it has a certain impact on the CPU resource occupancy. Specifically, the connection reuse rate refers to the degree of connection reuse between the compressor and the server. The compressor needs to rely on the connection between the compressor and the server to send a request to the server. If the link can be reused, it means that the compressor does not need to establish a connection between the compressor and the server every time it sends a request to the server, but can reuse the previously established connection. Establishing a connection between the compressor and the server requires a certain amount of CPU resources. Therefore, the aforementioned connection reuse rate affects the number of connections that the compressor needs to establish, and accordingly, it also affects the CPU resources that the compressor needs to consume. Therefore, the task parameters of the aforementioned test task to be executed may include the connection reuse rate corresponding to the test task to be executed.
[0048] In another example, considering the number of bytes included in a single request message corresponding to the test task to be executed, it has a certain impact on the resource usage of the CPU. Specifically: the more bytes a single request message includes, the more CPU resources are consumed to send the request message. Correspondingly, the fewer bytes a single request message includes, the fewer CPU resources are consumed to send the request message. Therefore, the task parameters of the aforementioned test task to be executed may include the number of bytes included in a single request message corresponding to the test task to be executed.
[0049] In another example, considering the number of bytes included in a single response message corresponding to the test task to be executed, it has a certain impact on the CPU resource usage. Specifically: the more bytes included in a single corresponding message, the more CPU resources consumed to receive the response message. Correspondingly, the fewer bytes included in a single response message, the fewer CPU resources consumed to receive the response message. Therefore, the task parameters of the aforementioned test task to be executed may include the number of bytes included in a single response message corresponding to the test task to be executed.
[0050] In another example, considering the processing time of a single request message corresponding to the test task to be executed, it has a certain impact on the resource occupation of the CPU. Among them, the processing time of the single request message is used to indicate the time from sending the request message to receiving the response message corresponding to the request message. In some scenarios, the processing time can be converted into the internal processing delay of the request message by the server. Specifically, if the aforementioned processing time is longer, the number of request messages that the CPU can send per unit time is smaller, and accordingly, the utilization rate of the CPU per unit time is lower. Correspondingly, if the aforementioned processing time is shorter, the number of request messages that the CPU can send per unit time is larger, and accordingly, the utilization rate of the CPU per unit time is higher. Therefore, the task parameters of the aforementioned test task to be executed may include the processing time of a single request message corresponding to the test task to be executed.
[0051] S102: Inputting the task parameters of the test task to be executed into a target model to obtain the QPS that can be achieved by a single-core CPU executing the test task to be executed.
[0052] After obtaining the task parameters of the test task to be executed, the target model can be used to predict the QPS that a single-core CPU can achieve when executing the test task to be executed. The QPS that a single-core CPU can achieve when executing the test task to be executed mentioned here can refer to the maximum QPS that a single-core CPU can achieve when executing the test task to be executed.
[0053] In the embodiment of the present application, the target model is a pre-trained model, which can predict the QPS that a single-core CPU can achieve by executing a task corresponding to the task parameters based on the input task parameters. Therefore, after obtaining the task parameters of the test task to be executed, the task parameters of the test task to be executed can be input into the target model, and accordingly, the target model will process the task parameters of the test task to be executed, thereby obtaining and outputting the QPS that a single-core CPU can achieve by executing the test task to be executed.
[0054] In one example, the target model can be abstracted as a function shown in formula (1):
[0055] QPS=f(x1,x2, …xn) Formula (1)
[0056] In formula (1):
[0057] QPS is the maximum QPS that a single-core CPU can achieve when executing the test task to be executed.
[0058] f is a function.
[0059] x1, x2, …xn represent n task parameters.
[0060] In an example, the value of n can be 5, x1 can be the request type adopted by the test task to be executed, x2 can be the connection multiplexing rate corresponding to the test task to be executed, x3 can be the number of bytes included in a single request message corresponding to the test task to be executed, x4 can be the number of bytes included in a single response message corresponding to the test task to be executed, and x5 can be the processing time of a single request message corresponding to the test task to be executed.
[0061] Regarding the training method of the target model, please refer to the following Figure 3 The description part is not described in detail here.
[0062] S103: Determine the number of CPU cores required to execute the test task to be executed based on the QPS and the test target of the test task to be executed.
[0063] After obtaining the QPS that can be achieved by a single-core CPU in executing the test task to be executed, the number of CPU cores required to execute the test task to be executed can be determined based on the determined QPS and the test target of the test task to be executed.
[0064] In the present application, the test target of the test task to be executed may be, for example, whether the concurrent request processing capability of the test server can reach the target QPS.
[0065] For the convenience of description, it is assumed that the QPS that can be achieved by the aforementioned single-core CPU to execute the test task to be executed is Q max , the target QPS is Q expected In one example, when S103 is implemented, the number of CPU cores C required to execute the test task to be executed can be calculated using the following formula (2): min .
[0066]
[0067] In formula (2), ceil is a rounding function.
[0068] S104: Perform resource scheduling based on the number of CPU cores to determine a target transmitter that meets the number of CPU cores, so as to utilize the target transmitter to execute the test task to be executed.
[0069] In the present application, the test platform can also obtain the compressor resources. After determining the number of CPU cores, the obtained compressor resources can be further scheduled to determine the target compressor that meets the number of CPU cores. As an example, the target compressor may include one or more compressors, and the sum of the available CPU cores C of the one or more compressors is greater than or equal to the aforementioned C min .
[0070] In one example, when using the target compressor to execute the to-be-executed test task, in a specific implementation, the test task may be allocated to each compressor according to the sum of the aforementioned available CPU core numbers and the actually available CPU core numbers of each compressor.
[0071] Assuming that the target generators include p generators, test tasks can be allocated to the p generators according to the following formulas (3) and (4).
[0072]
[0073] In formula (3) and formula (4):
[0074] Q i is the QPS that the i-th compressor needs to bear;
[0075] C i The number of CPU cores used by the i-th generator to execute the test task to be executed.
[0076] After the test tasks are assigned to the p transmitters, the p transmitters can send request messages to the server according to the QPS assigned to themselves, thereby testing the concurrent request processing capability of the server.
[0077] From the above description, it can be known that the solution provided by the embodiment of the present application does not subjectively judge the QPS that can be achieved by a single-core CPU to execute the test task to be executed based on user experience, but can use the target model to accurately determine the QPS that can be achieved by a single-core CPU to execute the test task to be executed, thereby accurately determining the number of CPU cores required to execute the test task to be executed, and further accurately determining the target compressor that meets the number of CPU cores, thereby improving the execution efficiency of the test task to be executed. That is, using this solution, the efficiency of testing the concurrent request processing capability of the server can be improved.
[0078] Next, combine Figure 2 The specific example shown introduces the method provided by the embodiment of the present application. Figure 2 A process diagram of a concurrent request processing capability testing method provided in an embodiment of the present application.
[0079] In an example, the operation and maintenance personnel of a social software want to verify the end-to-end QPS upper limit of the comment posting interface abcom / send-msg in region A. Then:
[0080] First, the operation and maintenance personnel can log in to the test platform and enter the information of the QPS verification task (corresponding to the aforementioned test task to be executed) on the test platform: {target URL: https: / / abcom / sendmsg, message type: HTTPS, request body: randomly generated 10-1000 bytes, upper limit of received bytes: 500 bytes, request processing time: 500 milliseconds, test target: whether the concurrent request processing capability can reach 1000k QPS, connection reuse rate: 66%}.
[0081] After the user enters the information of the QPS verification task, a confirmation operation is triggered based on the input information. Further, the test platform automatically completes the following operations:
[0082] a. Obtain the task parameters of the QPS verification task from the information entered by the user: {the request type is HTTPS, the connection reuse rate is 66%, the number of bytes included in a single request message is 1000, the number of bytes included in a single response message is 500, and the processing time of a single request message is 500 milliseconds}.
[0083] b. Input the task parameters of the QPS verification task into the target model, and obtain the maximum QPS that can be achieved by a single-core CPU to execute the QPS verification task, which is 5000.
[0084] c. Combined parameter Q expected =1000000, and the required Cmin=200 is obtained.
[0085] d. Match the resources in region A from the edge computing node management side and find a compressor that meets the CPU resource requirement of 200 CPU cores. You can select 25 compressors with 8-core CPUs.
[0086] e. Send to each compressor task and send test start instructions to 25 compressors at the same time.
[0087] After the transmitters and compressors received the test start instruction, 25 transmitters and compressors sent request messages to the server almost simultaneously.
[0088] In addition, after 25 compressors send request messages to the server, the operation and maintenance personnel can view the QPS of the requests sent by each compressor and the processing status of the received request messages by the server on the test platform.
[0089] Next, combine Figure 3 , the training method of the target model is introduced. Figure 3 A flowchart of a model training method provided in an embodiment of the present application.
[0090] Figure 3 The method shown may include the following S201-S203.
[0091] S201: Obtain task parameters of the training test task.
[0092] In one example, the training test task may be a test task that has been historically executed on an online test platform. In another example, an offline experimental system may be built to execute the training test task.
[0093] In one example, the task parameters of the training test task include one or more of the request type adopted by the training test task, the connection multiplexing rate corresponding to the training test task, the number of bytes included in a single request message corresponding to the training test task, the number of bytes included in a single response message corresponding to the training test task, and the processing time of a single request message corresponding to the training test task.
[0094] Regarding the task parameters of the training test task, the selection principle can refer to the description of the task parameters of the test task to be executed in the previous article, and will not be described in detail here.
[0095] S202: Obtain the maximum QPS that can be achieved by a single-core CPU when executing the test task to be executed.
[0096] In an embodiment of the present application, the limit QPS that can be achieved by a single-core CPU to execute the test task to be executed can be understood as the maximum QPS that can be achieved by a single-core CPU to execute the test task to be executed. In a specific example, the limit QPS can be the QPS that can be achieved by the single-core CPU to execute the training test task when the CPU usage consumed by the single-core CPU to execute the training test task is greater than a preset threshold. The preset threshold mentioned here can be a value close to 100%. For example, the preset threshold can be 90% or 95%. That is: if the CPU usage consumed by a single-core CPU when executing a training test task is close to 100%, then the QPS that can be achieved by the single-core CPU to execute the training test task at this time can be considered to be the maximum QPS that can be achieved by the single-core CPU to execute the training test task.
[0097] It is precisely because the limit QPS is the QPS that the single central CPU can achieve when executing the training test task when the CPU usage consumed by the single-core CPU is greater than the preset threshold, and for the test tasks executed by the online test platform, the CPU usage cannot be manually intervened. When the offline experimental system executes the training test task, the QPS of the compressor can be reasonably controlled, and accordingly, the CPU usage of the compressor can be controlled. Therefore, building an offline experimental system to execute the training test task can efficiently obtain the limit QPS that a single-core CPU can achieve when executing the test task to be executed, which is conducive to improving the training efficiency of the target model.
[0098] In order to ensure the accuracy of the test results obtained by executing the training test task in the offline experimental system. In one example, when the offline experimental system is installed, it can be ensured that the offline experimental system mirrors the actual online test platform as much as possible. In other words, the execution environment of the test task to be executed is consistent with the execution environment of the training test task. Among them, the execution environment of the test task to be executed refers to the execution environment of the online test platform. For example, you can refer to Figure 4 To understand, Figure 4 A schematic diagram of an offline experimental system environment and an online test platform environment is shown. Figure 4 As shown in the figure, the environment of the offline experimental system is almost the same as that of the online test platform.
[0099] Figure 4 The user platform shown is used to provide a visual interface for the user, so that the user can input relevant information of the task through the visual interface.
[0100] The task control plane is used to control the task. For example, the task control plane can send tasks and test start instructions to the generator. The task control plane can also receive information related to the generator's execution of tasks (such as task execution status and other information) from the generator.
[0101] When the task control is facing the task control, it can be combined with the information stored in the database, for example, querying the schedulable generator resources from the database to facilitate the scheduling of the generator resources.
[0102] In the offline experimental environment, the compressor can send a request message to server 1. In the online test platform, the compressor can send a request message to server 2. The server 1 corresponding to the offline experimental system and the server 2 corresponding to the online test platform can be different to ensure the stability of the online test platform.
[0103] In addition, the environment of the offline experimental system can be isolated from the environment of the online test platform to ensure the stability of the online test platform.
[0104] Moreover, the method of building an offline experimental system to perform training and testing tasks is conducive to monitoring the CPU utilization of the compressor, so as to accurately obtain the aforementioned extreme QPS.
[0105] S203: Training the target model based on the task parameters of the training test task and the limit QPS.
[0106] It should be noted that in order to ensure the accuracy of the target model obtained through training, multiple training and testing tasks can be performed to ensure that the training data of the target model is comprehensive. In addition, the values of the task parameters of the aforementioned training and testing tasks also need to be representative and cover the effective range of the task parameter value settings as much as possible. Specifically, the following principles can be used to obtain the task parameters of the training and testing tasks.
[0107] Principle 1: Cover boundary conditions. That is, clarify the range of task parameter values and ensure that the boundary values of task parameter values are covered when configuring training and testing tasks.
[0108] Principle 2: Representative features. That is, within the range of task parameter values, a certain step size is set to extract representative values of the feature continuous variable value.
[0109] Principle 3: Critical Value Selection. That is, the task parameters of the training and testing tasks need to be preprocessed. Continuous parameters are standardized to eliminate the influence of different dimensions and ensure that each parameter contributes relatively fairly to the model. For each continuous parameter x i , using the standardized formula: For processing. Among them: x′ is the standardized parameter value, μ is the mean of the parameter, and σ is the standard deviation of the parameter. Secondly, the One-Hot Encoding method is used for discrete parameters to eliminate the potential order relationship between categorical variables. For example, for the request type, if the request type is HTTP, it is represented by binary 0, and if the request type is HTTPS, it is represented by binary 1.
[0110] After obtaining the task parameters of the training test task and the limit QPS, the task parameters of the training test task and the limit QPS can be used as training data to train the target model. The model training process can be considered as an update and iteration process of the model parameters, for example, it can be a parameter determination process of the aforementioned function f. The update and iteration process of the model parameters is not specifically limited in the embodiments of the present application.
[0111] In one example, if the target model fails to converge after a certain period of time (or a certain number of iterations), it means that the model training has failed. In this scenario, the training data can be collected again and the target model can be retrained until a target model that meets the requirements is obtained.
[0112] In the scenario where the aforementioned training and testing tasks are executed in the offline experimental system, this solution can deploy the target model trained using the training data obtained from the offline experimental system on the online testing platform, so that when the user uses the online testing platform to execute the test tasks to be executed, the generator resources can be reasonably scheduled, thereby efficiently completing the test tasks to be executed, that is, efficiently evaluating the concurrent request processing capability of the server.
[0113] Exemplary Devices
[0114] Based on the method provided in the above embodiment, the embodiment of the present application further provides a device, which is described below in conjunction with the accompanying drawings.
[0115] See also Figure 5 , which is a structural diagram of a resource scheduling device provided in an embodiment of the present application. Figure 5 The resource scheduling device 500 shown can be used to execute the resource scheduling method provided by the above method embodiment. The device 500 can specifically include: an acquisition unit 501, an input unit 502, a first determination unit 503 and a second determination unit 504.
[0116] The acquisition unit 501 is used to acquire task parameters of a test task to be executed, where the test task to be executed is used to test the concurrent request processing capability of the server;
[0117] The input unit 502 is used to input the task parameters into the target model to obtain the number of requests per second that can be achieved by a single-core central processing unit executing the test task to be executed;
[0118] The first determining unit 503 is used to determine the number of CPU cores required to execute the test task to be executed based on the number of requests per second and the test target of the test task to be executed;
[0119] The second determining unit 504 is configured to perform resource scheduling based on the number of CPU cores to determine a target transmitter that meets the number of CPU cores, so as to utilize the target transmitter to execute the test task to be executed.
[0120] Optionally, the task parameters of the test task to be executed include at least one of the following:
[0121] The request type used by the test task to be executed, the connection multiplexing rate corresponding to the test task to be executed, the number of bytes included in a single request message corresponding to the test task to be executed, the number of bytes included in a single response message corresponding to the test task to be executed, and the processing time of a single request message corresponding to the test task to be executed; wherein:
[0122] The request type includes: Hypertext Transfer Protocol or Hypertext Transfer Protocol Secure;
[0123] The processing duration of the single request message is used to indicate the duration from sending the request message to receiving the response message corresponding to the request message.
[0124] Optionally, the acquiring unit 501 is used to:
[0125] Obtain the task parameters of the test task to be executed input by the user in the test platform.
[0126] Optionally, the target model is trained in the following manner:
[0127] Get the task parameters of the training and testing tasks;
[0128] Obtaining the maximum number of requests per second that can be achieved by a single-core central processing unit in executing the test task to be executed;
[0129] The target model is trained based on the task parameters of the training test task and the limit number of requests per second.
[0130] Optionally, the limit number of requests per second includes:
[0131] The number of requests per second that can be achieved by the single-core central processing unit in executing the training test task when the central processing unit usage consumed by the single-core central processing unit in executing the training test task is greater than a preset threshold.
[0132] Optionally, the task parameters of the training and testing task include at least one of the following:
[0133] The request type used by the training test task, the connection multiplexing rate corresponding to the training test task, the number of bytes included in a single request message corresponding to the training test task, the number of bytes included in a single response message corresponding to the training test task, and the processing time of a single request message corresponding to the training test task; wherein:
[0134] The request type includes: Hypertext Transfer Protocol or Hypertext Transfer Protocol Secure;
[0135] The processing duration of the single request message is used to indicate the duration from sending the request message to receiving the response message corresponding to the request message.
[0136] Optionally, the execution environment of the test task to be executed is consistent with the execution environment of the training test task.
[0137] Since the device 500 is a device corresponding to the method provided in the above method embodiment, the specific implementation of each unit of the device 500 is based on the same concept as the above method embodiment. Therefore, for the specific implementation of each unit of the device 500, reference can be made to the description part of the above method embodiment, which will not be repeated here.
[0138] The embodiment of the present application also provides an electronic device, the electronic device comprising a processor and a memory;
[0139] The processor is used to execute the instructions stored in the memory so that the electronic device executes the resource scheduling method described in any one of the above method embodiments. The embodiment of the present application provides a computer-readable storage medium, including instructions, the instructions instructing the device to execute the resource scheduling method described in any one of the above method embodiments.
[0140] An embodiment of the present application provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute the resource scheduling method described in any one of the above method embodiments.
[0141] Those skilled in the art will readily appreciate other embodiments of the present application after considering the description and practicing the contents disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0142] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
[0143] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.
Claims
1. A resource scheduling method, characterized in that: The method comprises: Obtaining task parameters of a test task to be executed, where the test task to be executed is used to test the concurrent request processing capability of the server; Inputting the task parameters into the target model to obtain the number of requests per second that can be achieved by a single-core central processing unit to execute the test task to be executed; Determine the number of CPU cores required to execute the test task to be executed based on the number of requests per second and the test target of the test task to be executed; Resource scheduling is performed based on the number of CPU cores to determine a target compressor that meets the number of CPU cores, so as to utilize the target compressor to execute the test task to be executed.
2. The method according to claim 1, characterized in that The task parameters of the test task to be executed include at least one of the following: The request type used by the test task to be executed, the connection multiplexing rate corresponding to the test task to be executed, the number of bytes included in a single request message corresponding to the test task to be executed, the number of bytes included in a single response message corresponding to the test task to be executed, and the processing time of a single request message corresponding to the test task to be executed; wherein: The request type includes: Hypertext Transfer Protocol or Hypertext Transfer Protocol Secure; The processing duration of the single request message is used to indicate the duration from sending the request message to receiving the response message corresponding to the request message.
3. The method according to claim 1, characterized in that Get the task parameters of the test task to be executed, including: Obtain the task parameters of the test task to be executed input by the user in the test platform.
4. The method according to any one of claims 1 to 3, characterized in that: The target model is trained in the following way: Get the task parameters of the training and testing tasks; Obtaining the maximum number of requests per second that can be achieved by a single-core central processing unit in executing the test task to be executed; The target model is trained based on the task parameters of the training test task and the limit number of requests per second.
5. The method according to claim 4, characterized in that The limit number of requests per second includes: The number of requests per second that can be achieved by the single-core central processing unit in executing the training test task when the central processing unit usage consumed by the single-core central processing unit in executing the training test task is greater than a preset threshold.
6. The method according to claim 4, characterized in that The task parameters of the training and testing task include at least one of the following: The request type used by the training test task, the connection multiplexing rate corresponding to the training test task, the number of bytes included in a single request message corresponding to the training test task, the number of bytes included in a single response message corresponding to the training test task, and the processing time of a single request message corresponding to the training test task; wherein: The request type includes: Hypertext Transfer Protocol or Hypertext Transfer Protocol Secure; The processing duration of the single request message is used to indicate the duration from sending the request message to receiving the response message corresponding to the request message.
7. The method according to claim 4, characterized in that The execution environment of the test task to be executed is consistent with the execution environment of the training test task.
8. A resource scheduling device, characterized in that: The device comprises: An acquisition unit, used for acquiring task parameters of a test task to be executed, wherein the test task to be executed is used for testing the concurrent request processing capability of the server; An input unit, used for inputting the task parameters into a target model to obtain the number of requests per second that can be achieved by a single-core central processing unit in executing the test task to be executed; A first determining unit, configured to determine the number of CPU cores required to execute the test task to be executed based on the number of requests per second and the test target of the test task to be executed; The second determining unit is used to perform resource scheduling based on the number of CPU cores to determine a target compressor that meets the number of CPU cores, so as to utilize the target compressor to execute the test task to be executed.
9. An electronic device, characterized in that: The electronic device comprises a processor and a memory; The processor is configured to execute instructions stored in the memory, so that the electronic device executes the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The method comprises instructions for instructing a device to execute the method according to any one of claims 1 to 7.