CN117539625A - Server resource allocation method, device, computer equipment and storage medium - Google Patents
Server resource allocation method, device, computer equipment and storage medium Download PDFInfo
- Publication number
- CN117539625A CN117539625A CN202311505768.XA CN202311505768A CN117539625A CN 117539625 A CN117539625 A CN 117539625A CN 202311505768 A CN202311505768 A CN 202311505768A CN 117539625 A CN117539625 A CN 117539625A
- Authority
- CN
- China
- Prior art keywords
- server
- initial
- actual
- node
- per
- 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.)
- Pending
Links
- 238000013468 resource allocation Methods 0.000 title claims abstract description 68
- 238000000034 method Methods 0.000 title claims abstract description 43
- 238000013507 mapping Methods 0.000 claims abstract description 86
- 238000004590 computer program Methods 0.000 claims abstract description 40
- 230000006870 function Effects 0.000 claims description 63
- 238000012545 processing Methods 0.000 claims description 42
- 238000004364 calculation method Methods 0.000 claims description 14
- 230000004044 response Effects 0.000 claims description 14
- 230000008859 change Effects 0.000 claims description 5
- 238000012360 testing method Methods 0.000 description 10
- 238000011056 performance test Methods 0.000 description 9
- 230000008569 process Effects 0.000 description 9
- 238000010586 diagram Methods 0.000 description 6
- 238000004891 communication Methods 0.000 description 3
- 238000013500 data storage Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000012886 linear function Methods 0.000 description 2
- 238000004519 manufacturing process Methods 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- OKTJSMMVPCPJKN-UHFFFAOYSA-N Carbon Chemical compound [C] OKTJSMMVPCPJKN-UHFFFAOYSA-N 0.000 description 1
- 230000003247 decreasing effect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000007667 floating Methods 0.000 description 1
- 229910021389 graphene Inorganic materials 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5061—Partitioning or combining of resources
- G06F9/5066—Algorithms for mapping a plurality of inter-dependent sub-tasks onto a plurality of physical CPUs
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The application relates to a server resource allocation method, a server resource allocation device, a computer device, a storage medium and a computer program product. The method comprises the following steps: acquiring resource configuration data of a server, and acquiring the initial node number and the initial transaction number per second of the server under the resource configuration data of the server; obtaining an initial concurrency user number according to the initial node number of the server and the initial transaction number per second; according to the initial concurrent user number and the initial node number of the server, obtaining a mapping relation between the actual node number of the server and the actual transaction number per second; determining the target node number of the server according to the mapping relation and the target transaction number per second; and determining the target resource allocation quantity of the server according to the target node quantity of the server and the resource allocation data of the server. By adopting the method, the accuracy of the server resource allocation quantity can be improved, and meanwhile, the multi-node performance bottleneck problem of the application system can be found out in time.
Description
Technical Field
The present invention relates to the field of computer technology, and in particular, to a server resource allocation method, an apparatus, a computer device, a storage medium, and a computer program product.
Background
For software application systems, especially newly built application systems, when in online deployment, how many hardware resources are required to be allocated, and how many application nodes are started, so that service requirements can be met without wasting resources.
In the conventional technology, performance test is performed on an application node, and according to the test result, the target value required by the service is combined to divide, and then a certain expansion coefficient is multiplied to obtain a final result.
However, a certain loss is caused by the combination of multiple servers, and the expansion coefficient is difficult to determine, so that the quantity of resources of the physical servers finally required by the software application system is not accurate enough.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a server resource allocation method, apparatus, computer device, computer readable storage medium, and computer program product that can improve the accuracy of the number of server resource allocation.
In a first aspect, the present application provides a server resource allocation method, including:
acquiring resource configuration data of a server, and acquiring the initial node number and the initial transaction number per second of the server under the resource configuration data of the server;
obtaining an initial concurrency user number according to the initial node number of the server and the initial transaction number per second;
According to the initial concurrent user number and the initial node number of the server, obtaining a mapping relation between the actual node number of the server and the actual transaction number per second;
determining the target node number of the server according to the mapping relation and the target transaction number per second;
and determining the target resource allocation quantity of the server according to the target node quantity of the server and the resource allocation data of the server.
In one embodiment, obtaining an initial number of nodes of a server and an initial number of transactions per second under resource configuration data of the server includes:
an initial node of the server and an initial transaction per second are obtained in the case that the resource configuration data utilization rate of the server meets a preset threshold.
In one embodiment, obtaining the initial number of concurrent users according to the initial node number of the server and the initial transaction number per second includes:
acquiring a history mapping relation between the historical transaction number per second of an initial node of a server and the historical concurrent user number;
and calculating according to the historical mapping relation and the initial transaction number per second to obtain the initial concurrent user number.
In one embodiment, according to the initial concurrency user number and the initial node number of the server, obtaining a mapping relationship between the actual node number of the server and the actual transaction number per second includes:
Under the condition that initial concurrent user data is unchanged, acquiring the actual node number and the actual transaction number per second of a server;
matching the actual node number of the server with the actual transaction number per second to obtain a target value group; wherein the target value groups are at least three groups;
generating a functional relationship between the actual node number of the server and the actual transaction number per second based on the set of target values;
and obtaining the mapping relation between the actual node number of the server and the actual transaction number per second according to the functional relation.
In one embodiment, obtaining the actual node number and the actual transaction number per second of the server without changing the initial concurrent user data includes:
under the condition that the initial concurrency user number is unchanged, the initial node number of the server is adjusted to serve as the actual node number of the server;
and obtaining the actual transaction number per second according to the actual node number of the server, the initial concurrency user number and the response time of the transaction.
In one embodiment, the method further comprises:
when the function relation does not meet the preset function range, the actual node number and the actual transaction number per second of the server are adjusted, the actual node number and the actual transaction number per second of the server are subjected to matching processing, a new target value group is obtained, the function relation between the actual node number and the actual transaction number per second of the server is generated based on the target value group again, and the process is finished when the function relation meets the preset function range.
In a second aspect, the present application further provides a server resource allocation apparatus, including:
the acquisition module is used for acquiring the resource configuration data of the server, and acquiring the initial node number and the initial transaction number per second of the server under the resource configuration data of the server;
the first calculation module is used for obtaining an initial concurrency user number according to the initial node number of the server and the initial transaction number per second;
the mapping relation acquisition module is used for acquiring the mapping relation between the actual node number of the server and the actual transaction number per second according to the initial concurrent user number and the initial node number of the server;
the second calculation module is used for determining the target node number of the server according to the mapping relation and the target transaction number per second;
and the third calculation module is used for determining the target resource allocation quantity of the server according to the target node quantity of the server and the resource allocation data of the server.
In a third aspect, the present application also provides a computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
acquiring resource configuration data of a server, and acquiring the initial node number and the initial transaction number per second of the server under the resource configuration data of the server;
Obtaining an initial concurrency user number according to the initial node number of the server and the initial transaction number per second;
according to the initial concurrent user number and the initial node number of the server, obtaining a mapping relation between the actual node number of the server and the actual transaction number per second;
determining the target node number of the server according to the mapping relation and the target transaction number per second;
and determining the target resource allocation quantity of the server according to the target node quantity of the server and the resource allocation data of the server.
In a fourth aspect, the present application also provides a computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of:
acquiring resource configuration data of a server, and acquiring the initial node number and the initial transaction number per second of the server under the resource configuration data of the server;
obtaining an initial concurrency user number according to the initial node number of the server and the initial transaction number per second;
according to the initial concurrent user number and the initial node number of the server, obtaining a mapping relation between the actual node number of the server and the actual transaction number per second;
determining the target node number of the server according to the mapping relation and the target transaction number per second;
And determining the target resource allocation quantity of the server according to the target node quantity of the server and the resource allocation data of the server.
In a fifth aspect, the present application also provides a computer program product comprising a computer program which, when executed by a processor, performs the steps of:
acquiring resource configuration data of a server, and acquiring the initial node number and the initial transaction number per second of the server under the resource configuration data of the server;
obtaining an initial concurrency user number according to the initial node number of the server and the initial transaction number per second;
according to the initial concurrent user number and the initial node number of the server, obtaining a mapping relation between the actual node number of the server and the actual transaction number per second;
determining the target node number of the server according to the mapping relation and the target transaction number per second;
and determining the target resource allocation quantity of the server according to the target node quantity of the server and the resource allocation data of the server.
The server resource allocation method, the device, the computer equipment, the storage medium and the computer program product are realized by firstly acquiring the resource allocation data of the server and acquiring the initial node number and the initial transaction number per second of the server under the resource allocation data of the server; obtaining an initial concurrency user number according to the initial node number of the server and the initial transaction number per second; then, according to the initial concurrency user number and the initial node number of the server, an accurate mapping relation between the actual node number of the server and the actual transaction number per second can be obtained; the target node number of the server can be accurately calculated according to the mapping relation and the target transaction number per second; and finally, determining the target resource allocation quantity of the server according to the target node quantity of the server and the resource allocation data of the server, so that the accuracy of the resource allocation quantity of the server can be improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the related art, the drawings that are required to be used in the embodiments or the related technical descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to the drawings without inventive effort for a person having ordinary skill in the art.
FIG. 1 is an application environment diagram of a server resource allocation method in one embodiment;
FIG. 2 is a flow chart of a method for server resource allocation in one embodiment;
FIG. 3 is a flow chart of obtaining an initial number of concurrent users according to an initial node number of a server and an initial transaction number per second in one embodiment;
FIG. 4 is a flow diagram of a process for obtaining a mapping relationship between actual node numbers and actual transactions per second for a server in one embodiment;
FIG. 5 is a flow diagram of an embodiment for obtaining the actual number of nodes and the actual number of transactions per second for a server;
FIG. 6 is a block diagram of a server resource allocation apparatus in one embodiment;
fig. 7 is an internal structural diagram of a computer device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
The server resource allocation method provided by the embodiment of the application can be applied to an application environment shown in fig. 1. Wherein the test server 102 communicates with the processing server 104 via a network. The data storage system may store data that the processing server 104 needs to process. The data storage system may be integrated on the processing server 104 or may be located on a cloud or other network server. The processing server acquires resource configuration data of the server, and acquires the initial node number of the server and the initial transaction number per second under the resource configuration data of the server; obtaining an initial concurrency user number according to the initial node number of the server and the initial transaction number per second; according to the initial concurrent user number and the initial node number of the server, obtaining a mapping relation between the actual node number of the server and the actual transaction number per second; determining the target node number of the server according to the mapping relation and the target transaction number per second; and determining the target resource allocation quantity of the server according to the target node quantity of the server and the resource allocation data of the server. Test server 102 is implemented as a server cluster of multiple servers.
In an exemplary embodiment, as shown in fig. 2, a server resource allocation method is provided, and an example of application of the method to the processing server in fig. 1 is described, which includes the following steps S202 to S210. Wherein:
step S202, obtaining the resource configuration data of the server, and obtaining the initial node number of the server and the initial transaction number per second under the resource configuration data of the server.
The resource configuration data refers to server hardware resource configuration data, and includes configuration data such as a central processing unit, an internal memory of a computer and the like. Transaction number per second (TPS, transactions Per Second) is one of the indicators of performance testing, and refers to the number of transactions an application system can process per second. The number of server nodes refers to the number of application nodes that the application system tests on the server. Servers tested as different application nodes are cloned from servers providing resource configuration data.
Optionally, designing a mixed test scene according to the service volume ratio according to the common functions or interfaces of the application system; the application system to be tested is deployed on a server, at the moment, a processing server obtains hardware resource configuration data for deploying the application system in the server, and configuration data of a CPU (central processing unit) of the server hardware resource and a memory (M) in the computer can refer to the configuration of a common production machine, for example, the configuration of the CPU is 8 cores; the configuration of the memory in the computer is 16G. The number of server initial nodes may be one or more and the resource configuration data is completely consistent. Performing multi-round performance test on the application system in the initial node of the server according to the designed mixed application scene, so as to obtain the initial transaction number per second of the application system in the initial node of the server; the initial node number of the server and the initial transaction number per second of the corresponding system application under the initial node of the server are obtained.
Step S204, obtaining the initial concurrency user number according to the initial node number of the server and the initial transaction number per second.
The number of concurrent users refers to the number of requests processed by an application system at the same time. If the concurrency processing capability of the application system is higher, that means that it can handle more user requests at the same time. The initial number of concurrent users can be the number of concurrent users under the condition that the test performance of the application system is optimal.
Optionally, performing multiple rounds of performance test on the application system in the initial node of the server according to the designed mixed application scene, so as to obtain the initial transaction number per second of the application system in the initial node of the server, and finding out the corresponding initial concurrent user number according to the initial transaction number per second and the response time by the processing server.
Step S206, according to the initial concurrency user number and the initial node number of the server, the mapping relation between the actual node number of the server and the actual transaction number per second is obtained.
Wherein the mapping relationship is a linear variation relationship between the number of server nodes and the number of transactions processed per second.
Optionally, the initial number of concurrent users is unchanged, the number of initial nodes of the server increases and changes, and the change of the number of initial nodes of the server serves as the number of actual nodes of the server. And the processing server acquires the mapping relation between the actual node number of the server and the actual transaction number per second according to the unchanged initial concurrency user number and the changed initial node number of the server. After the processing server obtains the mapping relation, detecting the mapping relation, and when the obtained mapping relation between the actual node number of the server and the actual transaction number per second is a linear relation, performing the subsequent steps; when the obtained mapping relation between the actual node number of the server and the actual transaction number per second is not a linear relation, the application system has bottleneck restriction of performance such as node and transaction number per second under the condition that the mapping relation is not a linear relation, and the problem of manual intervention positioning is needed to be solved.
Step S208, the target node number of the server is determined according to the mapping relation and the target transaction number per second.
Optionally, the processing server obtains the target number of transactions per second, where the target number of transactions per second may be set according to the target expected to be reached by the application system, or may be set according to the time when the application system can achieve the best performance effect. The processing server combines the mapping relation between the actual node number of the server and the actual transaction number per second, and substitutes the target transaction number per second into the mapping relation to obtain the accurate target node number of the server.
Step S210, determining the target resource allocation quantity of the server according to the target node quantity of the server and the resource allocation data of the server.
Optionally, the processing server determines a server target resource allocation number according to the server target node number and the resource allocation data of the server. The resource configuration data comprises central processor configuration data and in-computer memory configuration data, and the target configuration data of the central processor of the server is determined based on the target point number of the node of the server and the central processor configuration data of the server; the in-computer memory target configuration data for the server is determined based on the server target node number and the in-computer memory target configuration data for the server.
In the server resource allocation method, firstly, the resource allocation data of a server is acquired, and the initial node number and the initial transaction number per second of the server under the resource allocation data of the server are acquired; obtaining an initial concurrency user number according to the initial node number of the server and the initial transaction number per second; then, according to the initial concurrency user number and the initial node number of the server, an accurate mapping relation between the actual node number of the server and the actual transaction number per second can be obtained; the target node number of the server can be accurately calculated according to the mapping relation and the target transaction number per second; and finally, determining the target resource allocation quantity of the server according to the target node quantity of the server and the resource allocation data of the server, so that the accuracy of the resource allocation quantity of the server can be improved.
In one exemplary embodiment, obtaining the initial number of nodes of the server and the initial number of transactions per second under the resource configuration data of the server includes:
an initial node of the server and an initial transaction per second are obtained in the case that the resource configuration data utilization rate of the server meets a preset threshold.
Optionally, the processing server obtains a performance test value under the condition that the utilization rate of the resource configuration data of the server meets a preset threshold, and the preset threshold of the utilization rate of the resource configuration data can meet the actual requirement of the application system without causing resource waste, and can be adjusted according to the actual situation, which is not limited herein. For convenience, the description will be given taking the case where the threshold value is 70%, and the application system is tested when the threshold value is 70%, and the obtained performance test data is the optimal performance data. The resource configuration data comprises the preset use rates of the CPU C and the memory M in the computer, wherein the use rates of the CPU C and the memory M in the computer are not more than 70%, and performance test data are obtained according to the use rates under the condition of 70%; when either the cpu C or the memory M of the computer exceeds 70%, performance test data is acquired at 70% according to the use rate as well.
In this embodiment, by acquiring the initial transaction number per second when the initial node of one server satisfies that the usage rate of the resource configuration data reaches the preset threshold, the acquired initial transaction number per second can be ensured to be a value in the best performance state.
In an exemplary embodiment, as shown in fig. 3, the initial number of concurrent users is obtained according to the initial node number of the server and the initial transaction number per second, including the following steps 302 to 304. Wherein:
step S302, a history mapping relation between the history transaction number per second and the history concurrent user number of an initial node of the server is obtained.
The history mapping relation is a linear change relation between the number of historical transactions per second and the number of historical concurrent users.
Optionally, before the processing server obtains a history mapping relationship between the number of transactions processed per second and the number of concurrent users of the history of one initial node of the server, a linear history mapping relationship is generated by the number of transactions processed per second and the number of concurrent users of the history.
And step S304, calculating to obtain the initial concurrency user number according to the history mapping relation and the initial transaction number per second.
Optionally, in this embodiment, the initial transaction number per second is a value in the best performance state, before the processing server calculates the initial concurrency user number according to the historical mapping relationship and the initial transaction number per second, the processing server obtains the initial transaction number per second, substitutes the initial transaction number per second into the historical mapping relationship, and obtains the initial concurrency user number through calculation, so that the obtained initial concurrency user number is also the concurrency user number in the best performance state of the application system.
In this embodiment, the optimal initial concurrency user number can be obtained by the optimal number of transactions processed per second under one initial application node of the server.
In an exemplary embodiment, as shown in fig. 4, the mapping relationship between the actual node number of the server and the actual transaction number per second is obtained according to the initial concurrency user number and the initial node number of the server, which includes the following steps S402 to S408. Wherein:
step S402, under the condition that initial concurrent user data is unchanged, the actual point number of the server node and the actual transaction number per second are acquired.
Alternatively, the processing server obtains the value of the actual node number of the server node and the value of the actual transaction number per second with the initial concurrent user data and response time fixed. For example, when the initial concurrency user number is 100, the response time is 5 seconds, the actual node number of the server is one node, and the application system is tested under one node to obtain the actual transaction number per second 20; increasing the actual node number of the server to two nodes, and testing an application system under the two nodes to obtain the actual transaction number per second 10; and continuously increasing the actual node number of the server to four nodes, and testing the application system under the four nodes to obtain the actual transaction number per second of 2.5.
Step S404, matching the actual node number of the server and the actual transaction number per second to obtain a target value group; wherein the target value sets are at least three sets.
Wherein the set of target values may be expressed in the form of two-dimensional coordinates.
Optionally, the number of actual nodes of the server is plural, and the number of actual transactions per second is plural. The processing server performs matching processing on the actual node number of the server and the actual transaction number per second under the condition that the same initial concurrent user number and the same response time are adopted for the actual node number of the server and the actual transaction number per second, so as to obtain at least three target value groups, for example, the target value groups (X, Y) are formed in a two-dimensional form, wherein X represents one of the actual node number of the server and the actual transaction number per second, and Y represents the other; it may also be { [ initial number of concurrent users, response time ], [ X1, Y1] }.
Step S406, a functional relationship between the actual node number of the server and the actual transaction number per second is generated based on the target value group.
Optionally, the processing server generates a functional relationship between the server's actual node number and the actual transaction number per second based on the set of target values. The functional relationship may be a linear function; a quadratic linear function is also possible. The function relation is generated according to the actually obtained numerical value, and the number of times of the function is not limited.
Step S408, according to the functional relation, the mapping relation between the actual node number of the server and the actual transaction number per second is obtained.
Optionally, the processing server uses a functional relationship between the actual node number of the server and the actual transaction number per second as a mapping relationship between the actual node number of the server and the actual transaction number per second.
In this embodiment, by using a functional relationship constructed according to the actual node number of the server and the actual transaction number per second as the mapping relationship, an accurate mapping relationship between the actual node number of the server and the actual transaction number per second can be obtained.
In an exemplary embodiment, as shown in fig. 5, the actual node number of the server and the actual transaction number per second are acquired without changing the initial concurrent user data, including the following steps S502 to S504. Wherein:
in step S502, when the number of initial concurrent users is unchanged, the initial node number of the server is adjusted as the actual node number of the server.
Optionally, the processing server uses the initial concurrency user number as an actual concurrency user number, that is, the initial concurrency number is not changed, and adjusts the number of actual nodes of the initial node of the server as the server. If one node is added to one initial node of the server, 2 nodes are obtained as the actual node number of the server. The initial node number and the actual node number of the server are not limited herein.
Step S504, obtaining the actual transaction number per second according to the actual node number of the server, the initial concurrency user number and the response time of the transaction.
Optionally, under the condition that the initial concurrency user number and the response time of the transaction are fixed, the application system is tested according to the actual node number of the server, and the processing server obtains the actual transaction number per second.
In this embodiment, the actual node number of the server and the actual transaction number per second can be obtained according to the actual node number of the server and the time parameter under the condition that the initial concurrency user number is unchanged.
In an exemplary embodiment, the server resource allocation method further includes:
when the function relation does not meet the preset function range, the actual node number and the actual transaction number per second of the server are adjusted, the actual node number and the actual transaction number per second of the server are subjected to matching processing, a new target value group is obtained, the function relation between the actual node number and the actual transaction number per second of the server is generated based on the target value group again, and the process is finished when the function relation meets the preset function range.
Optionally, the processing server determines whether the functional relationship satisfies a preset functional range, where the preset functional range is a threshold value based on an increased value of the function value or a threshold value based on a decreased value of the function value. The threshold value of the increase value and the threshold value of the decrease value may be equal or different. The threshold is not limited, for convenience, the threshold is taken as 10% of the function value for illustration, the threshold of the added value is equal to the threshold of the reduced value, the threshold is set to be 10% of the function value, and the added value and the reduced value of the function are within 10% of the function value and belong to the preset function range; and if the function relation exceeds the range, the preset function relation is not satisfied. When the function relation meets the preset function range, continuing to determine the target node number of the server according to the mapping relation and the target transaction number per second; and determining the target resource allocation quantity of the server according to the target node quantity of the server and the resource allocation data of the server.
When the function relationship does not meet the preset function range, namely the function relationship is not a linear relationship or the function has larger up-down floating, the system application has bottleneck restriction on multi-node processing. At this time, the actual node number and the actual transaction number per second of the server need to be adjusted, the actual node number and the actual transaction number per second of the server are subjected to matching processing, a new target value set is obtained, and the function relationship between the actual node number and the actual transaction number per second of the server generated based on the target value set is re-executed until the function relationship accords with a preset function range.
In this embodiment, by judging the range of the function relationship and the preset function, and adjusting the function relationship that does not satisfy the preset function range, the influence of the application system itself on the multi-node processing can be found out, and the performance bottleneck problem of the application system can be found out and solved in time.
In one exemplary embodiment, the hybrid test scenario is designed according to the traffic duty cycle according to the application system common functions or interfaces; the application system to be tested is deployed on the server, at this time, the processing server obtains the configuration data of the hardware resource for deploying the application system in the server, and the configuration data of the cpu C and the memory M in the computer can refer to the configuration of the common machine for production, such as 8c+16g. The cpu and memory usage rate is set to be within 70%, and the transaction number per second at the time when the usage rate is 70% is set as the optimal value of the application software performance. Performing multi-round performance test on the application system in an initial node of the server according to the designed mixed application scene, so as to obtain the initial transaction number per second of the application system in the initial node of the server; the initial node number of the server and the initial optimal transaction number per second of the corresponding system application under the initial node of the server are obtained.
Acquiring a history mapping relation between the historical transaction number per second of an initial node of a server and the historical concurrent user number; and calculating according to the historical mapping relation and the initial optimal transaction number per second to obtain the initial optimal concurrent user number.
Under the condition that the initial optimal concurrency user number is unchanged, the initial node number of the server is adjusted to serve as the actual node number of the server; and performing performance test according to the actual node number of the server, the initial concurrent user number and the response time of the transaction to obtain the actual transaction number processed per second.
Matching the actual node number of the server with the actual transaction number per second to obtain a target value group; wherein the target value groups are at least three groups; generating a functional relationship y=f (X) between the actual number of nodes of the server and the actual number of transactions per second based on the set of target values; when the function relation does not meet the preset function range, the actual node number and the actual transaction number per second of the server are adjusted, the actual node number and the actual transaction number per second of the server are subjected to matching processing, a new target value group is obtained, the function relation between the actual node number and the actual transaction number per second of the server is generated based on the target value group again, and the process is finished when the function relation meets the preset function range. And obtaining the mapping relation between the actual node number of the server and the actual transaction number per second according to the functional relation.
Determining the target point number of the server node according to the mapping relation and the target transaction number per second set according to the requirement of the application system; and multiplying the number of the target nodes of the server by the resource configuration data of the server, thereby determining the target resource configuration number of the server.
It should be understood that, although the steps in the flowcharts related to the embodiments described above are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described in the above embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least some of the other steps or stages.
Based on the same inventive concept, the embodiment of the application also provides a server resource allocation device for realizing the above related server resource allocation method. The implementation of the solution provided by the device is similar to the implementation described in the above method, so the specific limitation in the embodiments of the server resource allocation device or devices provided below may refer to the limitation of the server resource allocation method hereinabove, and will not be repeated herein.
In an exemplary embodiment, as shown in fig. 6, there is provided a server resource allocation apparatus, including: an acquisition module 601, a first calculation module 602, a mapping relationship acquisition 603, a second calculation module 604, and a third calculation module 605, wherein:
an obtaining module 601, configured to obtain resource configuration data of a server, and obtain an initial node number of the server and an initial transaction number per second under the resource configuration data of the server.
The first calculation module 602 is configured to obtain an initial number of concurrent users according to an initial node number of the server and an initial transaction number per second.
The mapping relationship obtaining module 603 is configured to obtain, according to the initial concurrency user number and the initial node number of the server, a mapping relationship between the actual node number of the server and the actual transaction number per second.
A second calculation module 604, configured to determine a target node number of the server according to the mapping relationship and the target transaction number per second.
The third calculation module 605 is configured to determine a target number of resource configurations of the server according to the target number of nodes of the server and the resource configuration data of the server.
In one exemplary embodiment, the acquisition module 601 includes:
an acquisition unit, configured to acquire an initial node and an initial transaction number per second of the server in a case where a resource configuration data usage rate of the server satisfies a preset threshold.
In one exemplary embodiment, the first computing module 602 includes:
the history mapping relation acquisition unit is used for acquiring a history mapping relation between the number of transactions processed per second and the number of concurrent users of the history of one initial node of the server;
and the first calculation unit is used for calculating the initial concurrency user number according to the historical mapping relation and the initial transaction number per second.
In an exemplary embodiment, the mapping relationship obtaining module 603 includes:
the actual data acquisition unit is used for acquiring the actual node number and the actual transaction number per second of the server under the condition that the initial concurrent user data is unchanged;
the matching unit is used for carrying out matching processing on the actual node number of the server and the actual transaction number per second to obtain a target value group; wherein the target value groups are at least three groups;
a function generating unit for generating a function relationship between the actual node number of the server and the actual transaction number per second based on the target value group;
and the mapping relation generating unit is used for obtaining the mapping relation between the actual node number of the server and the actual transaction number per second according to the functional relation.
In an exemplary embodiment, the actual data acquisition unit includes:
The actual server node number acquisition subunit is used for adjusting the initial node number of the server as the actual node number of the server under the condition that the initial concurrency user number is unchanged;
the actual transaction number per second obtaining subunit is configured to obtain an actual transaction number per second according to the actual node number of the server, the initial concurrency user number and the response time of the transaction.
In an exemplary embodiment, the server resource allocation apparatus further includes:
and the adjusting module is used for adjusting the actual node number of the server and the actual transaction number per second when the functional relation does not meet the preset functional range, carrying out matching processing on the actual node number of the server and the actual transaction number per second to obtain a new target value group, and re-executing the functional relation between the actual node number of the server and the actual transaction number per second generated based on the target value group until the functional relation accords with the preset functional range.
The respective modules in the above-described server resource allocation apparatus may be implemented in whole or in part by software, hardware, and a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one exemplary embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 7. The computer device includes a processor, a memory, an Input/Output interface (I/O) and a communication interface. The processor, the memory and the input/output interface are connected through a system bus, and the communication interface is connected to the system bus through the input/output interface. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is for storing server resource configuration data. The input/output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a server resource allocation method.
It will be appreciated by those skilled in the art that the structure shown in fig. 7 is merely a block diagram of some of the structures associated with the present application and is not limiting of the computer device to which the present application may be applied, and that a particular computer device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In one exemplary embodiment, a computer device is provided comprising a memory and a processor, the memory having stored therein a computer program, the processor when executing the computer program performing the steps of:
acquiring resource configuration data of a server, and acquiring the initial node number and the initial transaction number per second of the server under the resource configuration data of the server;
obtaining an initial concurrency user number according to the initial node number of the server and the initial transaction number per second;
according to the initial concurrent user number and the initial node number of the server, obtaining a mapping relation between the actual node number of the server and the actual transaction number per second;
determining the target node number of the server according to the mapping relation and the target transaction number per second;
and determining the target resource allocation quantity of the server according to the target node quantity of the server and the resource allocation data of the server.
In one embodiment, the processor when executing the computer program further performs the steps of:
an initial node of the server and an initial transaction per second are obtained in the case that the resource configuration data utilization rate of the server meets a preset threshold.
In one embodiment, the processor when executing the computer program further performs the steps of:
acquiring a history mapping relation between the historical transaction number per second of an initial node of a server and the historical concurrent user number; and calculating according to the historical mapping relation and the initial transaction number per second to obtain the initial concurrent user number.
In one embodiment, the processor when executing the computer program further performs the steps of:
under the condition that initial concurrent user data is unchanged, acquiring the actual node number and the actual transaction number per second of a server; matching the actual node number of the server with the actual transaction number per second to obtain a target value group; wherein the target value groups are at least three groups; generating a functional relationship between the actual node number of the server and the actual transaction number per second based on the set of target values; and obtaining the mapping relation between the actual node number of the server and the actual transaction number per second according to the functional relation.
In one embodiment, the processor when executing the computer program further performs the steps of:
under the condition that the initial concurrency user number is unchanged, the initial node number of the server is adjusted to serve as the actual node number of the server; and obtaining the actual transaction number per second according to the actual node number of the server, the initial concurrency user number and the response time of the transaction.
In one embodiment, the processor when executing the computer program further performs the steps of:
when the function relation does not meet the preset function range, the actual node number and the actual transaction number per second of the server are adjusted, the actual node number and the actual transaction number per second of the server are subjected to matching processing, a new target value group is obtained, the function relation between the actual node number and the actual transaction number per second of the server is generated based on the target value group again, and the process is finished when the function relation meets the preset function range.
In one embodiment, a computer readable storage medium is provided having a computer program stored thereon, which when executed by a processor, performs the steps of:
acquiring resource configuration data of a server, and acquiring the initial node number and the initial transaction number per second of the server under the resource configuration data of the server;
Obtaining an initial concurrency user number according to the initial node number of the server and the initial transaction number per second;
according to the initial concurrent user number and the initial node number of the server, obtaining a mapping relation between the actual node number of the server and the actual transaction number per second;
determining the target node number of the server according to the mapping relation and the target transaction number per second;
and determining the target resource allocation quantity of the server according to the target node quantity of the server and the resource allocation data of the server.
In one embodiment, the computer program when executed by the processor further performs the steps of:
an initial node of the server and an initial transaction per second are obtained in the case that the resource configuration data utilization rate of the server meets a preset threshold.
In one embodiment, the computer program when executed by the processor further performs the steps of:
acquiring a history mapping relation between the historical transaction number per second of an initial node of a server and the historical concurrent user number; and calculating according to the historical mapping relation and the initial transaction number per second to obtain the initial concurrent user number.
In one embodiment, the computer program when executed by the processor further performs the steps of:
Under the condition that initial concurrent user data is unchanged, acquiring the actual node number and the actual transaction number per second of a server; matching the actual node number of the server with the actual transaction number per second to obtain a target value group; wherein the target value groups are at least three groups; generating a functional relationship between the actual node number of the server and the actual transaction number per second based on the set of target values; and obtaining the mapping relation between the actual node number of the server and the actual transaction number per second according to the functional relation.
In one embodiment, the computer program when executed by the processor further performs the steps of:
under the condition that the initial concurrency user number is unchanged, the initial node number of the server is adjusted to serve as the actual node number of the server; and obtaining the actual transaction number per second according to the actual node number of the server, the initial concurrency user number and the response time of the transaction.
In one embodiment, the computer program when executed by the processor further performs the steps of:
when the function relation does not meet the preset function range, the actual node number and the actual transaction number per second of the server are adjusted, the actual node number and the actual transaction number per second of the server are subjected to matching processing, a new target value group is obtained, the function relation between the actual node number and the actual transaction number per second of the server is generated based on the target value group again, and the process is finished when the function relation meets the preset function range.
In one embodiment, a computer program product is provided comprising a computer program which, when executed by a processor, performs the steps of:
acquiring resource configuration data of a server, and acquiring the initial node number and the initial transaction number per second of the server under the resource configuration data of the server;
obtaining an initial concurrency user number according to the initial node number of the server and the initial transaction number per second;
according to the initial concurrent user number and the initial node number of the server, obtaining a mapping relation between the actual node number of the server and the actual transaction number per second;
determining the target node number of the server according to the mapping relation and the target transaction number per second;
and determining the target resource allocation quantity of the server according to the target node quantity of the server and the resource allocation data of the server.
In one embodiment, the computer program when executed by the processor further performs the steps of:
an initial node of the server and an initial transaction per second are obtained in the case that the resource configuration data utilization rate of the server meets a preset threshold.
In one embodiment, the computer program when executed by the processor further performs the steps of:
Acquiring a history mapping relation between the historical transaction number per second of an initial node of a server and the historical concurrent user number; and calculating according to the historical mapping relation and the initial transaction number per second to obtain the initial concurrent user number.
In one embodiment, the computer program when executed by the processor further performs the steps of:
under the condition that initial concurrent user data is unchanged, acquiring the actual node number and the actual transaction number per second of a server; matching the actual node number of the server with the actual transaction number per second to obtain a target value group; wherein the target value groups are at least three groups; generating a functional relationship between the actual node number of the server and the actual transaction number per second based on the set of target values; and obtaining the mapping relation between the actual node number of the server and the actual transaction number per second according to the functional relation.
In one embodiment, the computer program when executed by the processor further performs the steps of:
under the condition that the initial concurrency user number is unchanged, the initial node number of the server is adjusted to serve as the actual node number of the server; and obtaining the actual transaction number per second according to the actual node number of the server, the initial concurrency user number and the response time of the transaction.
In one embodiment, the computer program when executed by the processor further performs the steps of:
when the function relation does not meet the preset function range, the actual node number and the actual transaction number per second of the server are adjusted, the actual node number and the actual transaction number per second of the server are subjected to matching processing, a new target value group is obtained, the function relation between the actual node number and the actual transaction number per second of the server is generated based on the target value group again, and the process is finished when the function relation meets the preset function range.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, database, or other medium used in the various embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high density embedded nonvolatile Memory, resistive random access Memory (ReRAM), magnetic random access Memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric Memory (Ferroelectric Random Access Memory, FRAM), phase change Memory (Phase Change Memory, PCM), graphene Memory, and the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, and the like. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like. The databases referred to in the various embodiments provided herein may include at least one of relational databases and non-relational databases. The non-relational database may include, but is not limited to, a blockchain-based distributed database, and the like. The processors referred to in the embodiments provided herein may be general purpose processors, central processing units, graphics processors, digital signal processors, programmable logic units, quantum computing-based data processing logic units, etc., without being limited thereto.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples only represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the present application. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application shall be subject to the appended claims.
Claims (10)
1. A method for server resource allocation, the method comprising:
acquiring resource configuration data of a server, and acquiring the initial node number and the initial transaction number per second of the server under the resource configuration data of the server;
obtaining an initial concurrency user number according to the initial node number of the server and the initial transaction number per second;
According to the initial concurrency user number and the initial node number of the server, obtaining a mapping relation between the actual node number of the server and the actual transaction number per second;
determining the target node number of the server according to the mapping relation and the target transaction number per second;
and determining the target resource allocation quantity of the server according to the target node quantity of the server and the resource allocation data of the server.
2. The method of claim 1, wherein the obtaining the initial number of nodes of the server and the initial number of transactions per second under the resource configuration data of the server comprises:
and acquiring an initial node and initial transaction number per second of the server under the condition that the utilization rate of the resource configuration data of the server meets a preset threshold value.
3. The method of claim 2, wherein the deriving an initial number of concurrent users based on the number of server initial nodes and the initial number of transactions per second comprises:
acquiring a history mapping relation between the historical transaction number per second of an initial node of the server and the historical concurrent user number;
and calculating according to the history mapping relation and the initial transaction number per second to obtain the initial concurrency user number.
4. The method according to claim 1, wherein the obtaining a mapping relationship between an actual node number of the server and an actual transaction number per second according to the initial number of concurrent users and the initial node number of the server includes:
under the condition that the initial concurrent user data is unchanged, acquiring the actual node number of the server and the actual transaction number per second;
matching the actual node number of the server with the actual transaction number per second to obtain a target value group; wherein the target value groups are at least three groups;
generating a functional relationship between the actual number of nodes of the server and the actual number of transactions per second based on the set of target values;
and obtaining the mapping relation between the actual node number of the server and the actual transaction number per second according to the functional relation.
5. The method of claim 4, wherein said obtaining the actual number of nodes of the server and the actual number of transactions per second without change of the initial concurrent user data comprises:
under the condition that the initial concurrency user number is unchanged, the initial node number of the server is adjusted to serve as the actual node number of the server;
And obtaining the actual transaction number per second according to the actual node number of the server, the initial concurrency user number and the response time of the transaction.
6. The method according to claim 4, wherein the method further comprises:
when the function relation does not meet a preset function range, the actual node number of the server and the actual transaction number per second are adjusted, matching processing is carried out on the actual node number of the server and the actual transaction number per second to obtain a new target value group, and the function relation between the actual node number of the server and the actual transaction number per second generated based on the target value group is re-executed until the function relation meets the preset function range.
7. A server resource allocation apparatus, the apparatus comprising:
the acquisition module is used for acquiring the resource configuration data of the server, and acquiring the initial node number and the initial transaction number per second of the server under the resource configuration data of the server;
the first calculation module is used for obtaining an initial concurrency user number according to the initial node number of the server and the initial transaction number per second;
The mapping relation acquisition module is used for acquiring the mapping relation between the actual node number of the server and the actual transaction number per second according to the initial concurrency user number and the initial node number of the server;
the second calculation module is used for determining the target node number of the server according to the mapping relation and the target transaction number per second;
and the third calculation module is used for determining the target resource allocation quantity of the server according to the target node quantity of the server and the resource allocation data of the server.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 6 when the computer program is executed.
9. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311505768.XA CN117539625A (en) | 2023-11-13 | 2023-11-13 | Server resource allocation method, device, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311505768.XA CN117539625A (en) | 2023-11-13 | 2023-11-13 | Server resource allocation method, device, computer equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117539625A true CN117539625A (en) | 2024-02-09 |
Family
ID=89781880
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311505768.XA Pending CN117539625A (en) | 2023-11-13 | 2023-11-13 | Server resource allocation method, device, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117539625A (en) |
-
2023
- 2023-11-13 CN CN202311505768.XA patent/CN117539625A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109408590B (en) | Method, device and equipment for expanding distributed database and storage medium | |
CN110287332B (en) | Method and device for selecting simulation model in cloud environment | |
CN115334082A (en) | Load balancing method, device, computer equipment, storage medium and product | |
CN111160385B (en) | Method, device, equipment and storage medium for aggregating mass location points | |
CN117435129A (en) | Storage cluster expansion method and device, computer equipment and storage medium | |
CN117539625A (en) | Server resource allocation method, device, computer equipment and storage medium | |
CN114860460B (en) | Database acceleration method and device and computer equipment | |
CN116700955A (en) | Job processing method, apparatus, computer device, and readable storage medium | |
CN114780250A (en) | Method, device, computer equipment, storage medium and product for allocating function memory | |
CN114461390A (en) | Evaluation method combining multi-dimensional analysis and critical path method and related device | |
CN111984510A (en) | Performance test method and device of scheduling system | |
CN114706687B (en) | Distribution method and device of computing tasks, computer equipment and storage medium | |
CN118055018A (en) | Method, device, computer equipment and storage medium for estimating server configuration quantity | |
CN118503259B (en) | Service data tracing method, system, device, computer equipment and storage medium | |
CN117112145B (en) | Training model distribution method, training model distribution device, computer equipment and storage medium | |
CN118034885A (en) | Task processing method, device, computer equipment and storage medium | |
CN117611425B (en) | Method, apparatus, computer device and storage medium for configuring computing power of graphic processor | |
CN117172839A (en) | Resource data processing method, device, computer equipment and storage medium | |
CN117348987A (en) | Task scheduling method, device, computer equipment, storage medium and program product | |
CN117539587A (en) | Resource scheduling method, apparatus, computer device, storage medium and program product | |
CN117041161A (en) | Service request processing method, device, computer equipment and storage medium | |
CN116339976A (en) | Container quota adjusting method and device | |
CN115220657A (en) | Method and device for acquiring hierarchical data relationship and computer equipment thereof | |
CN117648310A (en) | Data degradation processing method, device, equipment and medium | |
CN117745446A (en) | Resource data processing method, device, computer equipment and storage medium |
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 |