Summary of the invention
The embodiment of the present invention provides a kind of resource allocation method and device, to be embodied as operation system configurations match business
The server resource of system performance.
The embodiment of the present invention provides a kind of resource allocation method, comprising:
According to the resource information of server, resource load is generated;The resource load is for occupying server resource, to squeeze
Account for the server resource that operation system can utilize;
According under the action of the resource load, the performance information of the operation system operation is determined as the business
The server resource of system configuration.
Optionally, according to the resource information of server, resource load is generated, comprising:
According to the resource information of server, multiple sets of resources load is generated, wherein including at least one in every group of resource load
Resource load, difference organize the of different sizes of the resource load for the same type for including in resource load;
According under the action of the resource load, the performance information of the operation system operation is determined as the business
The server resource of system configuration, comprising:
According under the action of different groups of resource load, the performance information of the operation system operation determines the industry
Corresponding one group of occupancy server resource most resource load when the performance of business system operation is best;
According to the resource information of the server, and when performance of operation system operation that determines is best, is corresponding
The most resource load of one group of occupancy server resource is determined as the server resource of the operation system configuration.
Optionally, according to the resource information of server, multiple sets of resources load is generated, comprising:
It is described according to the resource information of server, and under the action of at least one set of resource load that nearest n times generate
The performance information of operation system operation determines the N+1 times one group of resource load for needing to generate;N is positive integer.
Optionally, according to the resource information of server, multiple sets of resources load is generated, comprising:
According to the resource information of server, the last one group of resource load and preset every kind of resource load generated
Adjusting step, determine that this needs the resource load that generates.
Optionally, the performance information of the operation system operation includes operation system concurrent user number and/or response time.
The embodiment of the present invention provides a kind of device for allocating resources, comprising:
Generation module generates resource load for the resource information according to server;The resource load is for occupying clothes
Business device resource, to tie up the server resource that operation system can utilize;
Determining module, for basis under the action of the resource load, the performance information of the operation system operation, really
It is set to the server resource of the operation system configuration.
The embodiment of the present invention generates the resource load for occupying server resource on the server, and the resource load is to clothes
Business device generates load pressure, so as to squeeze the server resource that operation system can utilize;In this way, can be with reference in resource
The performance information of collected operation system under the action of load is operation system configuration server resource.Due to of the invention real
It applies example to be showed according to the actual performance of operation system come for operation system configuration server resource, therefore can match for operation system
Set more reasonable server resource.
Specific embodiment
The basic thought of the embodiment of the present invention is: the resource load for occupying server resource is generated on the server,
The resource load generates load pressure to server, so as to squeeze the server resource that operation system can utilize;In this way,
It can be provided with reference to the performance information of collected operation system under the action of resource load for operation system configuration server
Source.Since the embodiment of the present invention is showed according to the actual performance of operation system come for operation system configuration server resource,
More reasonable server resource can be configured to for operation system.
In addition, the embodiment of the present invention squeezes the server that operation system can utilize by way of generating resource load
Resource can generate the algorithm of load pressure using a variety of pairs of servers to generate the resource load, pass through in actual implementation
These algorithms can apply lasting, controllable, stable load pressure for server, divide compared to operation system is constantly adjusted to
The mode for the server resource matched is easy to implement, the testing time is short, allocative efficiency is high.For example, if being adjusted to operation system distribution
Server resource, it is necessary to replace, test the configuration of a large amount of server resource, workload is very big, the testing time nor
It is often long;Such as central processing unit (Central Processing Unit, CPU) replacement or the increase and decrease of memory require to restart clothes
Business device, the increase and decrease of hard disk are possibly even needed to reset file system etc., can be taken considerable time;Although can be using virtual
Change technology flexibly to change the server resource of configuration, but at this stage, and the configuration adjustment under virtual machine technique can't be complete
Accomplish to carry out online entirely, also needs to restart virtual machine in some cases, in this way, also just can not expeditiously complete a variety of servers
The configuration of resource.
The embodiment of the present invention is described in further detail with reference to the accompanying drawings of the specification.
As shown in Figure 1, the resource allocation method flow chart provided for the embodiment of the present invention one, comprising the following steps:
S101: according to the resource information of server, resource load is generated;The resource load is for occupying server money
Source, to tie up the server resource that operation system can utilize.
In the specific implementation process, the resource information that can be possessed in total according to server generates multiple sets of resources load,
In in every group of resource load comprising at least one resource load, the resource loads for the same type for including in difference group resource loads
It is of different sizes, the resource size that every kind of resource load occupies is no more than the total size of such resource that server possesses.Here,
The type of resource load namely the type of server resource, such as cpu resource, memory source, hard disk resources, Internet resources etc. are each
The different resource type of kind.
In the specific implementation process, according to the resource information of server, there are many modes for generating multiple sets of resources load, can
It, can also be using based on former successively to determine resource load adjusted every time according to the adjusting step of every class resource load
The performance of the operation system of secondary test and used resource load, to determine the resource load of this test, to reach
More preferably performance.It is specifically described as follows:
Mode one, according to the resource information of server, and the effect of at least one set of resource load in the generation of nearest n times
Under, the performance information of the operation system operation determines the N+1 times one group of resource load for needing to generate;N is positive integer.
It in this mode, can be in conjunction with the performance that under the action of resource load that nearest n times generate, operation system is run
Information, to determine the N+1 times one group of resource load for needing to generate;For example, if preceding n times are according to being continuously increased resource load size
Mode generate resource load, in first N-1 time test, operation system performance is gradually increased for discovery, but when n-th is tested,
Operation system performance no longer changes, then the size that can configure the N+1 times resource load is negative between the resource of the N-1 times generation
It carries between the resource load size that size and n-th generate, for example the resource load size and N of the N-1 times generation can be taken
The average value of the resource load size of secondary generation, so circulation carry out, until adjusting step lower than setting step-length threshold value or until
Reach preset testing time, or until reaching preset operation system runing time etc..
Mode two, according to the resource information of server, the last one group of resource load generated and every kind preset
The adjusting step of resource load determines this resource load for needing to generate.
In this mode, the resource load size generated using the last time is generated plus adjusting step as this needs
The size of resource load, so circulation carry out, and transport until reaching preset testing time, or until reaching preset operation system
Row time etc..
In actual implementation, the algorithm of load pressure can be generated using a variety of pairs of servers to generate different types of money
Source load, for example, the network resource loads for occupying Internet resources can be generated using IPerf algorithm, it is raw using fio algorithm
At the hard disk resources load for occupying hard disk resources, it is negative that the cpu resource for occupying cpu resource is generated using Stress algorithm
It carries, for memory source load of committed memory resource etc..
S102: according under the action of the resource load, the performance information of the operation system operation is determined as described
The server resource of operation system configuration.
It in specific implementation, can be according to the performance that under the action of different groups of resource loads, the operation system is run
Information determines corresponding one group of occupancy server resource most resource load when the performance of the operation system operation is best;
According to the resource information of the server, and when performance of operation system operation that determines is best corresponding one group of occupancy
The most resource load of server resource is determined as the server resource of the operation system configuration, that is, making server list
The performance that position resource (cost) can be provided reaches an optimal value namely cost performance highest.For example, being provided for a kind of server
Source, the performance that using the total size for such resource that server possesses, can subtract determining operation system operation are best
When the most resource load of corresponding one group of occupancy server resource in such server resource size, by obtained difference make
For the size of such server resource of the operation system of configuration, which can make server unit resource that can mention
The best performance of confession.
In the specific implementation process, to certain operation systems, some simple, external fingers that can be directly observed can be passed through
Mark, such as occupied network bandwidth, the number that is written and read (namely input and output I/O operation) per second to disk
(Input/Output Operations Per Second, IOPS) current performance of Lai Fanying operation system.In addition to this, industry
The performance indicator of business system self record, such as current concurrent user number and response time are the most concerned performance indicators of user,
And in terms of being evaluated as the rational most important consideration of server resource of operation system configuration.
Inventive concept is described in further detail below by a specific embodiment.
As shown in Fig. 2, being resource allocation method flow chart provided by Embodiment 2 of the present invention, comprising the following steps:
S201: according to the resource information of server, multiple sets of resources load is generated, wherein comprising at least in every group of resource load
A kind of resource load, difference organize the of different sizes of the resource load for the same type for including in resource load.
S202: according under the action of different groups of resource load, the performance information of the operation system operation determines institute
State operation system operation performance it is best when the most resource load of corresponding one group of occupancy server resource;The operation system
The performance information of operation includes operation system concurrent user number and/or response time.
S203: according to the resource information of the server, and when the performance of operation system operation that determines is best
The most resource load of corresponding one group of occupancy server resource is determined as the server resource of the operation system configuration.
In the specific implementation process, can establish automatically configure modeling (ACMS) be responsible for the generation of resource load and
Control.As shown in figure 3, the resource configuration system schematic diagram established for the embodiment of the present invention.Specifically, ACMS can be a set of list
The software systems of machine operation;It can according to need and the ACMS is installed in server (can be with physical server or virtual machine) simultaneously certainly
Dynamic operation;When needing to match the resource distribution of certain operation system (applying App) and runnability, by the business system
System, which is deployed in a server, starts operation, while ACMS being also deployed in the server and is started.The deployment of ACMS and
Operation should not influence the operation system, and to meet this requirement, ACMS should detect the network port used by operation system
To avoid conflict.The ACMS can be made into the system for exempting from installation, directly from external memory such as USB flash disk starting operation, or
The ACMS is encapsulated into operation etc. in a container (Container).Server for test answers configuration with higher, than
Such as there is the network interface compared with the CPU of high primary frequency, the memory of larger capacity, hard disk and more high bandwidth, enable to adjust
Whole server resource wider range is matched to more reasonable server resource configuration for the operation system.
ACMS can specifically include load generation module (LGM) and load control module (LCM);
Wherein, LGM is responsible for generating the resource load, and different LGM is respectively to the CPU of server, memory, hard disk, net
The different resources such as network generate load pressure.Since the resource of server is shared between different applications, the resource occupied by LGM,
Also the operation system that cannot be tested again is used, therefore, by adjusting the resource occupied with control LGM, so that it may to industry
The available resources of business system generate squeezing action, to change the available resources size of operation system.This squeezing action with change
Become the effect that the resources such as CPU, memory, the network of server generate to be consistent, but it is more much higher than the latter to complete efficiency.
LCM is responsible for adjusting the configuration of load resource;In specific implementation, it is arranged one for LCM to be reported from operation system to it
Accuse the communication interface (Iop) of current performance information;The performance information that LCM is reported according to operation system, the configuration to resource load
It makes adjustment, determines the size of every kind of load resource adjusted, and indicate that LGM is generated based on load resource size adjusted
Load resource.LCM can be based on preset control strategy, boundary condition (such as operation system runing time, loop test
Number, the adjustment upper limit value of resource load size and lower limit value etc.) etc. complete the adjustment of load resource, control strategy can be base
In the simple correction of history deviation, it is also possible to the more complicated algorithm such as heuritic approach, machine learning algorithm.
The embodiment of the present invention can be applied to the configuration and type selecting of guide service device, for example, when needing new buying server
When, it determines that the server resource of matching business demand configures by ACMS, corresponding buying model is determined with this, clothes can be reduced
The buying of business device, O&M cost, improve resource utilization.It can also be applied to instruct the resource allocation in resource pool, for example,
It is concentrated towards multiple application systems in the systems such as " private clound " for reducing resource pool, it is generally desirable to more to be assigned to for business side
Resource, and resource pool operator then wishes to improve resource utilization and reduces cost, can help resource pool operation by ACMS
Side quickly configures reasonable resource for operation system.
Based on the same inventive concept, one kind resource corresponding with resource allocation method is additionally provided in the embodiment of the present invention to match
Device is set, since the principle that the device solves the problems, such as is similar to the resource allocation method of the embodiment of the present invention, the device
Implementation may refer to the implementation of method, and overlaps will not be repeated.
As shown in figure 4, being device for allocating resources structural schematic diagram provided in an embodiment of the present invention, comprising:
Generation module 41 generates resource load for the resource information according to server;The resource load is for occupying
Server resource, to tie up the server resource that operation system can utilize;
Determining module 42, for basis under the action of the resource load, the performance information of the operation system operation,
It is determined as the server resource of the operation system configuration.
Optionally, the generation module 41 is specifically used for: according to the resource information of server, multiple sets of resources load is generated,
Wherein comprising at least one resource load in every group of resource load, the resource that difference organizes the same type for including in resource load is negative
What is carried is of different sizes;
The determining module 42 is specifically used for: according under the action of different groups of resource load, the operation system is transported
Capable performance information determines corresponding one group of occupancy server resource most money when the performance of the operation system operation is best
Source load;According to the resource information of the server, and when performance of operation system operation that determines is best, is corresponding
The most resource load of one group of occupancy server resource is determined as the server resource of the operation system configuration.
Optionally, the generation module 41 is specifically used for:
It is described according to the resource information of server, and under the action of at least one set of resource load that nearest n times generate
The performance information of operation system operation determines the N+1 times one group of resource load for needing to generate;N is positive integer.
Optionally, the generation module 41 is specifically used for:
According to the resource information of server, the last one group of resource load and preset every kind of resource load generated
Adjusting step, determine that this needs the resource load that generates.
Optionally, the performance information of the operation system operation includes operation system concurrent user number and/or response time.
It should be understood by those skilled in the art that, the embodiment of the present invention can provide as method, system or computer program
Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the present invention
Apply the form of example.Moreover, it wherein includes the computer of computer usable program code that the present invention, which can be used in one or more,
The computer program implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) produces
The form of product.
The present invention be referring to according to the method for the embodiment of the present invention, the process of device (system) and computer program product
Figure and/or block diagram describe.It should be understood that every one stream in flowchart and/or the block diagram can be realized by computer program instructions
The combination of process and/or box in journey and/or box and flowchart and/or the block diagram.It can provide these computer programs
Instruct the processor of general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce
A raw machine, so that being generated by the instruction that computer or the processor of other programmable data processing devices execute for real
The device for the function of being specified in present one or more flows of the flowchart and/or one or more blocks of the block diagram.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates,
Enable the manufacture of device, the command device realize in one box of one or more flows of the flowchart and/or block diagram or
The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting
Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or
The instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram one
The step of function of being specified in a box or multiple boxes.
Although preferred embodiments of the present invention have been described, it is created once a person skilled in the art knows basic
Property concept, then additional changes and modifications may be made to these embodiments.So it includes excellent that the following claims are intended to be interpreted as
It selects embodiment and falls into all change and modification of the scope of the invention.
Obviously, various changes and modifications can be made to the invention without departing from essence of the invention by those skilled in the art
Mind and range.In this way, if these modifications and changes of the present invention belongs to the range of the claims in the present invention and its equivalent technologies
Within, then the present invention is also intended to include these modifications and variations.