CN109614305A - Occupancy acquisition methods, device and the computer readable storage medium of processor - Google Patents
Occupancy acquisition methods, device and the computer readable storage medium of processor Download PDFInfo
- Publication number
- CN109614305A CN109614305A CN201811515643.4A CN201811515643A CN109614305A CN 109614305 A CN109614305 A CN 109614305A CN 201811515643 A CN201811515643 A CN 201811515643A CN 109614305 A CN109614305 A CN 109614305A
- Authority
- CN
- China
- Prior art keywords
- occupancy
- processor
- message processing
- baseline
- message
- 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
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/34—Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
- G06F11/3409—Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment
- G06F11/3419—Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment by assessing time
- G06F11/3423—Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment by assessing time where the assessed time is active or idle time
-
- 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/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
-
- 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/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/45591—Monitoring or debugging support
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention discloses a kind of occupancy acquisition methods of processor, the occupancy acquisition methods of the processor include: to obtain baseline Message processing duration;Baseline Message processing amount in the calculating cycle is obtained according to the baseline Message processing duration;Obtain total business Message processing amount in the calculating cycle;The occupancy of the processor is obtained according to the baseline Message processing amount and the total business Message processing amount.The invention also discloses the occupancy acquisition device and computer readable storage medium of a kind of processor.The service message treating capacity of actual treatment in calculating cycle is converted to the quantity (total business Message processing amount) of processing baseline message, to according to the quantity of the baseline message of actual treatment in calculating cycle and the theoretical baseline Message processing amount being capable of handling, the occupancy of processor can be accurately calculated, efficiency and accuracy that processor occupancy calculates are improved.
Description
Technical field
The present invention relates to occupancy acquisition methods, device and the computers of communication technique field more particularly to processor can
Read storage medium.
Background technique
Network function, which virtualizes (Network Fuction Virtualization), to be passed through in x86 generic server
The technology of network function is realized in virtualization.In order to improve the forwarding performance of virtual machine, by multiple virtual processors in virtual machine
(virtual Central Processing Unit, abbreviation vCPU) using tie up core, it is exclusive by the way of, monopolize physical cpu money
Source is used alone for multiple forwarding processes.Forwarding process abandons the asynchronous signalling mechanism based on interruption, cuts for avoidance breakout
The overhead for causing forwarding is changed, using while1 endless loop mode poll packet receiving queue, packet receiving queue is stood if having message
Quarter does forward process.
The vCPU as bound in forwarding process is worked using endless loop polling mode, whether zero load or fully loaded rank
Section, the vCPU occupancy of display is all 100%, and user can not know the practical occupancy of vCPU.
In the prior art, by every statistical data (the virtual machine handling capacity, packet loss of manpower detection network function virtual machine
Etc. statistical informations), in conjunction with the practical occupancy of the maximum throughput capacity calculation virtual machine processor of typical scene lower network virtual machine
Rate.The occupancy of virtual machine processor is obtained by the way of manually calculating, subjective impact is larger, causes to calculate virtual processor
Occupancy low efficiency, accuracy is poor.
Summary of the invention
The main purpose of the present invention is to provide a kind of occupancy acquisition methods of processor, device and computer-readable deposit
Storage media, it is intended to solve the occupancy for obtaining virtual machine processor by the way of manually calculating in the prior art, subjective impact
It is larger, lead to the low efficiency for calculating the occupancy of virtual processor, the technical problem of accuracy difference.
To achieve the above object, the present invention provides a kind of occupancy acquisition methods of processor, the occupancy of the processor
Rate acquisition methods the following steps are included:
Obtain baseline Message processing duration;
Baseline Message processing amount in the calculating cycle is obtained according to the baseline Message processing duration;
Obtain total business Message processing amount in the calculating cycle;
The occupancy of the processor is obtained according to the baseline Message processing amount and the total business Message processing amount.
Optionally, described the step of obtaining total business Message processing amount in the calculating cycle, includes:
Obtain the type of service of service message in the calculating cycle, the weight of the type of service and each service class
The corresponding service message treating capacity of type;
According to the type of service, the weight of the type of service and the corresponding service message of each type of service
Treating capacity obtains the total business Message processing amount.
Optionally, the step of acquisition baseline Message processing duration includes:
Baseline message is created, and the baseline message is sent to processor;
The processor is handled into the handling duration of the baseline message as the baseline Message processing duration.
Optionally, the occupancy acquisition methods of the processor further include:
Timing executes the creation baseline message, and the step of baseline message is sent to processor.
Optionally, described that the processor is obtained according to the baseline Message processing amount and the total business Message processing amount
Occupancy the step of after, further includes:
Judge whether the occupancy is greater than the first preset threshold;
When the occupancy is greater than first preset threshold, prompt information is generated, to prompt processor occupancy super
Load.
Optionally, the generation prompt information, the step of to prompt processor occupancy excess load after, further includes:
Judge the occupancy of the processor in the calculating cycle whether less than the second preset threshold, wherein described
Two preset thresholds are less than first preset threshold;
When the occupancy of the processor is less than second preset threshold, the prompt information is eliminated.
Optionally, before the step of elimination prompt information, further includes:
When the occupancy of the processor is less than second preset threshold, the occupancy is updated less than described second
The number of preset threshold;
When the number be greater than preset times when, execute the elimination prompt information the step of.
In addition, to achieve the above object, the present invention also provides a kind of occupancy acquisition device of processor, feature exists
In the occupancy acquisition device of the processor includes:
Crystal oscillator clock, for obtaining baseline Message processing duration and the beginning and ending time in monitoring calculation period point;
Scheduler module is forwarded, is used for forward process baseline message, and obtain at the service message in the calculating cycle
Reason amount;
Occupancy computing module, for triggering baseline message and the baseline message being sent to the forwarding process mould
Block obtains baseline Message processing amount in the calculating cycle according to the baseline Message processing duration, and obtains the calculating
Total business Message processing amount in period obtains the place according to the total business Message processing amount and the baseline Message processing amount
Manage the occupancy of device.
Optionally, the occupancy acquisition device of the processor further include:
Weight preset module is sent to described account for for the weight of each type of service to be arranged, and by the weight
With rate computing module, so that the occupancy computing module is according to the service message treating capacity and each type of service
Weight calculation described in total business Message processing amount in calculating cycle.
In addition, to achieve the above object, the present invention also provides a kind of computer readable storage mediums, which is characterized in that institute
The occupancy acquisition program that processor is stored on computer readable storage medium is stated, the occupancy of the processor obtains program
The step of occupancy acquisition methods of processor as described above are realized when being executed by processor.
A kind of occupancy acquisition methods for processor that the embodiment of the present invention proposes handle baseline report using the processor
Text obtains baseline Message processing duration, and then obtains the baseline message in a calculating cycle according to baseline Message processing duration
Treating capacity;In processor course of normal operation, the total business Message processing amount handled in calculating cycle is obtained, using total industry
Business Message processing amount combination baseline Message processing amount, calculates the occupancy of the processor in calculating cycle.By calculating cycle
The service message treating capacity of interior actual treatment is converted to the quantity (total business Message processing amount) of processing baseline message, thus according to
The quantity of the baseline message of actual treatment and the theoretical baseline Message processing amount being capable of handling, can accurately count in calculating cycle
The occupancy of processor is calculated, efficiency and accuracy that processor occupancy calculates are improved.
Detailed description of the invention
Fig. 1 is the flow diagram of the occupancy acquisition methods first embodiment of processor of the present invention;
Fig. 2 is the flow diagram of the occupancy acquisition methods 3rd embodiment of processor of the present invention;
Fig. 3 is the flow diagram of the occupancy acquisition methods fourth embodiment of processor of the present invention;
Fig. 4 is a structural schematic diagram of the occupancy acquisition device of processor of the present invention;
Fig. 5 is another structural schematic diagram of the occupancy acquisition device of processor of the present invention.
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Specific embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
The primary solutions of the embodiment of the present invention are:
Obtain baseline Message processing duration;
Baseline Message processing amount in the calculating cycle is obtained according to the baseline Message processing duration;
Obtain total business Message processing amount in the calculating cycle;
The occupancy of the processor is obtained according to the baseline Message processing amount and the total business Message processing amount.
Due to multiple vCPU using tie up core, it is exclusive by the way of, monopolize physical cpu resource, individually make for multiple forwarding processes
With.VCPU bound in forwarding process is worked using endless loop polling mode, no matter therefore vCPU is unloaded or the full-load period, show
The vCPU occupancy shown all is 100%, and user can not know the practical occupancy of vCPU.Use manually calculates in the prior art
Mode obtains the occupancy of virtual machine processor, and subjective impact is larger, leads to the low efficiency for calculating the occupancy of virtual processor,
The technical problem of accuracy difference.
The present invention provides a kind of occupancy acquisition methods of processor, and the occupancy acquisition methods of the processor are for obtaining
The occupancy for taking any kind of processor is particularly suitable for calculating forwarding process binding vCPU using endless loop polling mode work
The occupancy of the vCPU of work.
Solution provided by the invention is to handle baseline message using the processor, obtain baseline Message processing duration,
And then the treating capacity of the baseline message in a calculating cycle is obtained according to baseline Message processing duration;It is worked normally in processor
In the process, the total business Message processing amount handled in calculating cycle is obtained, using total business Message processing amount combination baseline message
Treating capacity calculates the occupancy of the processor in calculating cycle.By the service message processing of actual treatment in calculating cycle
Amount is converted to the quantity (total business Message processing amount) of processing baseline message, thus according to the baseline of actual treatment in calculating cycle
The quantity of message and the theoretical baseline Message processing amount being capable of handling, can accurately calculate the occupancy of processor, improve
The efficiency and accuracy that processor occupancy calculates.
Referring to Fig.1, the occupancy of the occupancy acquisition methods first embodiment of processor of the present invention, the processor obtains
Method includes:
Step S10 obtains baseline Message processing duration.
Simulator creates baseline message, and baseline message is sent to the forwarding scheduler module in processor, in processor
Forwarding scheduler module processing baseline message handling duration be baseline Message processing duration.
Use the handling duration that baseline message is obtained using the crystal oscillator clock in physical processor as benchmark clock.Specifically,
Start timing (T when simulator triggers out baseline message1), after the completion of the processing of the forwarding process of baseline message, terminate timing
(T2), T1With T2Between time difference be baseline message handling duration.That is, baseline Message processing duration Tstd=T2-T1.Wherein, may be used
Select the service messages such as IPV4 message (Internet protocol fourth edition), IPV6 message (Internet protocol sixth version) as baseline report
Text.
Step S20 obtains baseline Message processing amount in the calculating cycle according to the baseline Message processing duration.
The crystal oscillator clock is used to determine the beginning and ending time point of calculating cycle simultaneously.According to the duration (T of calculating cycleload)
With baseline Message processing duration (Tstd), the treating capacity that baseline message is capable of handling in a calculating cycle can be calculated, i.e.,
Baseline Message processing amount N in calculating cycleumtotal=Tload/Tstd.Due to handling industry when server process works normally
Business message be it is coherent, each calculating cycle is closely coupled, therefore, the baseline Message processing amount that will acquire as reference quantity,
The occupancy in each calculating cycle is calculated for server.
Step S30 obtains total business Message processing amount in the calculating cycle.
Step S40 obtains the processor according to the baseline Message processing amount and the total business Message processing amount
Occupancy.
For server in processing business message, the type of service message is different, required for processing business message when processing
It is long different.Therefore, the total business Message processing amount of calculating cycle server actual treatment can obtain in the following way:
Firstly, the service message quantity that forwarding scheduler module is handled in one calculating cycle of statistics, and obtain these business
The type of service of message;Secondly, obtaining the weight of each type of service according to type of service;Finally, by each type of service
The sum of products of service message quantity and weight is as total business Message processing amount.It adopts and is formulated as: Counterstd,i=
∑ Counter (k) * β (k), wherein Counterstd,iFor total business Message processing amount, i indicated for the i-th period, and Counter (k) is
The service message treating capacity of k type service message, β (k) be k type service message weight (wherein, k be different types of industry
Business message, such as: ipsec, nat).
The Message processing amount of various businesses type is converted to using weight treating capacity when being equivalent to processing baseline message.
And the treating capacity that baseline message is handled in calculating cycle is certain, therefore, the occupancy of the processor is equal to the total business report
Literary treating capacity accounts for the ratio of the baseline Message processing amount.That is Loadi=Counterstd,i/Numtotal,i* 100%, wherein
LoadiFor the occupancy of i-th of calculating cycle, Counterstd,iFor the middle service message treating capacity in i-th of calculating cycle,
Numtotal,iFor the baseline Message processing amount in i-th of calculating cycle.
The service message treating capacity of actual treatment in calculating cycle is converted to quantity (the total business report of processing baseline message
Literary treating capacity), thus according to the quantity of the baseline message of actual treatment in calculating cycle and the theoretical baseline report being capable of handling
Literary treating capacity can accurately calculate the occupancy of processor, improve efficiency and accuracy that processor occupancy calculates.
For example, presetting as baseline message using IPV4 message and calculating cycle TloadIt is 1 second.When VM is powered on, at physics
The crystal oscillator clock of device is managed as reference clock source.It triggers simulator and sends IPV4 message, record moment T1;It forwards at scheduler module
After the completion of managing the IPV4 message, simulator is sent back, records moment T2;According to formula Tstd=T2-T1Obtain baseline Message processing
Shi Changwei 5*10-7Second.Then, baseline Message processing amount is Num in calculating cycletotal=Tload/Tstd=1/5*10-7=2*106
It is a, i.e. 2*10 is capable of handling in a calculating cycle6A baseline message.
Weighted value β (ipsec)=10, nat business weighted value β (nat)=2, IPV4 message of default ipsec business
Weighted value is β (IPV4)=1.In server course of normal operation, gets and forward scheduler module coprocessing in calculating cycle
10000 IPV4 messages, 8000 ipsec messages, 5000 nat messages.It can be obtained calculating week according to different business weight
Total business Message processing amount in phase are as follows:
Counterstd,i=10000*1+8000*10+5000*2=105It is a.
Therefore, the occupancy of processor are as follows:
Loadi=Counterstd,i/Numtotal,i* 100%=105/(2*106) * 100%=5%.
In the present embodiment, baseline message is handled using the processor, obtains baseline Message processing duration, and then according to base
Report from a liner text handling duration obtains the treating capacity of the baseline message in a calculating cycle;In processor course of normal operation, obtain
The total business Message processing amount handled in calculating cycle is taken, using total business Message processing amount combination baseline Message processing amount, meter
Calculate the occupancy of the processor in calculating cycle.The service message treating capacity of actual treatment in calculating cycle is converted to place
The quantity (total business Message processing amount) for managing baseline message, thus according to the quantity of the baseline message of actual treatment in calculating cycle
And the theoretical baseline Message processing amount being capable of handling, the occupancy of processor can be accurately calculated, processor is improved and occupies
The efficiency and accuracy that rate calculates.
Further, the occupancy acquisition methods second embodiment of processor of the present invention is based on above-mentioned first embodiment, more
New baseline Message processing duration.
In virtualized environment, the hardware money such as the physical processor (CPU) of server, fast cache storage area (CACHE)
Source is shared to be used, and when handling different business message, the handling duration of baseline message may become virtual processor
Change, in the embodiment of the present application, when the processor for needing to calculate occupancy is virtual processor, timing updates at baseline message
Duration is managed, to ensure that calculated occupancy is more accurate.
Specifically, using the crystal oscillator clock of the physical processor of server as reference clock, in virtual server run mode
Shi Qiyong timer arrangement, timing cycle arrive, and control simulator creates baseline message, and the baseline message is sent to processing
Device obtains the handling duration that virtual processor handles the baseline message.It, can root by timing adjustment baseline Message processing duration
Reflect the more true processing capacity of virtual server according to the service condition of server physical resource, so that virtual server accounts for
It is calculated with rate more accurate.
For example, setting handling duration of the timing cycle of timer to update a baseline message after 10 seconds, 10 seconds, use
The occupancy of the new subsequent calculating cycle inner treater of baseline Message processing duration calculation.
In the present embodiment, tested virtual processor is avoided in use, it is each in virtual machine virtual shared to make
It is limited with the hardware resource of physical cpu, cause the handling duration of virtual processor processing baseline message unstable, timing updates base
Report from a liner text handling duration improves the accuracy that the occupancy of virtual processor calculates.
Further, referring to Fig. 2, the occupancy acquisition methods 3rd embodiment of processor of the present invention is based on above-mentioned first
Or second embodiment, after the step S40, further includes:
Step S50, judges whether the occupancy is greater than the first preset threshold.
Step S60 generates prompt information, when the occupancy is greater than first preset threshold to prompt processor
Occupancy excess load.
In order to ensure the normal processing of data message, operation maintenance personnel is appropriate right when the practical occupancy of processor is excessive
Processor carries out dilatation.Therefore, when occupancy is greater than certain first threshold, prompt information is generated, client server is prompted to account for
With rate excess load.Specifically, alarm module is arranged in the processor, the first preset threshold is preset, is greater than the first threshold in occupancy
When value, alarm module will be prompted to information and be sent to network management device, be somebody's turn to do so that network management device is shown in display interface
Prompt information is convenient for the timely Risk-warning of operation maintenance personnel, after user knows the prompt, is the processing such as dilatation behaviour to the processor
Make.
In addition, the information such as the title of the processor, address and information on load are reported together with prompt information, for
Targetedly improve the performance of processor in family.
In addition, after continuing to test the occupancy of processor, when the occupancy of calculating cycle inner treater is pre- less than second
If when threshold value, sending control instruction to network management device, eliminating the prompt information.Wherein, second preset threshold is less than
First preset threshold.
For example, presetting the first preset threshold in alarm module takes 80%, the second preset threshold takes 65%.It is counted at i-th
When the occupancy for calculating processor in the calculation period is 85% (being greater than 80%), the prompt information of occupancy excess load is generated.?
The occupancy of jth (j > i) a calculating cycle is 50% (less than 65%), then eliminates the prompt information.
In the present embodiment, it when the occupancy for calculating calculating cycle inner treater is greater than the first preset threshold, generates
Prompt information prompts user processor occupancy excess load, the load condition of processor is presented to operation maintenance personnel, operation maintenance personnel
Treatment measures can be taken in time, ensure the normal processing and forwarding of data message.
Further, referring to Fig. 3, the occupancy acquisition methods fourth embodiment of processor of the present invention is based on above-mentioned first
To three any embodiments, after the step S60, further includes:
Step S70, judge the occupancy of the processor in the calculating cycle whether less than the second preset threshold,
In, second preset threshold is less than first preset threshold.
Step S80 updates the occupancy and is less than when the occupancy of the processor is less than second preset threshold
The number of second preset threshold.
Step S90, judges whether the number is greater than preset times
Step S100 eliminates the prompt information when the number is greater than preset times.
Prompt information is being generated, after prompting processor occupancy excess load, is being detected in next calculating cycle
When occupancy in processor calculating cycle is less than the second preset threshold, number is recorded, when number is greater than preset times, is shown
For the occupancy of multiple period inner treaters less than the second preset threshold, the occupancy of server is lower, without expanding processor
Appearance processing, which is eliminated.
For example, when preset times are set as 3 times, after detecting that occupancy is greater than the first preset threshold within the i-th period, the
When the occupancy that i+2, i+3, i+4 continuously detect in three calculating cycles is respectively less than the second preset threshold, prompt information is eliminated.
For the timely notice for realizing alarm, the gentle occupancy restored, detected in continuous multiple calculating cycles is alerted
When respectively less than the second preset threshold, the prompt information of excess load is just eliminated.
After prompt information generation, monitor that continuous 3 server occupancies calculating cycle (3 seconds i.e. continuous) is calculated
Occupancy is 63%, 64%, 61% respectively, respectively less than the second preset threshold of alarm clearing, and alarm module report and alarm restores
And respective processor information and load value information etc. are reported together.
In the present embodiment, prompt information is being generated, after prompting processor occupancy excess load, in next calculating
When detecting the occupancy in processor calculating cycle in the period less than the second preset threshold, number is recorded, when number is greater than in advance
If when number, showing the occupancy of multiple period inner treaters less than the second preset threshold, the occupancy of server is lower, without pair
Processor carries out dilatation processing, which is eliminated.
In addition, the embodiment of the present invention also proposes a kind of occupancy acquisition methods device of processor, as shown in figure 4, described
The occupancy acquisition device of processor includes: crystal oscillator clock 10, forwards scheduler module 20, occupancy computing module 30.
The handling duration of baseline message is obtained as reference clock using crystal oscillator clock 10, and detects rising for calculating cycle
Only time point determines a calculating cycle.Specifically, timing (the T since when triggering out baseline message of crystal oscillator clock 101),
After the completion of the forwarding process processing of baseline message, terminate timing (T2), T1With T2Between time difference be baseline message processing when
It is long.That is, baseline Message processing duration Tstd=T2-T1.Wherein, IPV4 message (Internet protocol fourth edition), IPV6 report can be selected
Service messages such as literary (Internet protocol sixth versions) are as baseline message.
Forwarding scheduler module 20 is the processing module of service message in processor, is mainly used for obtaining baseline Message processing
When duration in forward process baseline message and processor course of normal operation, the industry of calculating cycle inner treater processing is obtained
The treating capacity of business message.
Using occupancy of 30 computation processor of occupancy computing module in calculating cycle.Using occupancy computing module
The baseline message is simultaneously sent to forwarding scheduler module 20 by 30 triggering baseline messages, and forwarding scheduler module 20 handles baseline report
Text, crystal oscillator clock 10 record the handling duration of baseline message, and baseline Message processing duration is fed back to occupancy computing module
30.Occupancy computing module 30 is capable of handling in a calculating cycle inner treater out according to baseline Message processing duration calculation
Baseline Message processing amount.Also, the service message of each type is handled in the calculating cycle reported according to forwarding scheduler module 20
Amount obtains the total business Message processing amount in the calculating cycle.Finally, according to the total business Message processing amount and baseline report
Literary treating capacity obtains the occupancy of the processor.
In addition, server, in processing business message, the type of service message is different, place required for processing business message
It is different to manage duration.Therefore, the occupancy acquisition device of the processor further includes weight preset module 40, weight preset module 40
Occupancy computing module 30, occupancy meter are sent to for the weight of each type of service to be arranged, and by the weighted value set
Module 30 is calculated according to the weight of each type of service and in the service message treating capacity for calculating each type of service in mid-term, meter
Calculate total business Message processing amount.
Wherein, in calculating cycle baseline Message processing amount acquisition methods are as follows: according to the duration (T of calculating cycleload) and
Baseline Message processing duration (Tstd), the treating capacity for being capable of handling baseline message in a calculating cycle can be calculated, that is, is counted
Calculate the baseline Message processing amount N in the periodumtotal=Tload/Tstd。
The acquisition methods of the total business Message processing amount of calculating cycle server actual treatment are as follows:
Firstly, the service message quantity that forwarding scheduler module is handled in one calculating cycle of statistics, and obtain these business
The type of service of message;Secondly, obtaining the weight of each type of service according to type of service;Finally, by each type of service
The sum of products of service message quantity and weight is as total business Message processing amount.It adopts and is formulated as: Counterstd,i=
∑ Counter (k) * β (k), wherein Counterstd,iFor total business Message processing amount, i indicated for the i-th period, and Counter (k) is
The service message treating capacity of k type service message, β (k) be k type service message weight (wherein, k be different types of industry
Business message, such as: ipsec, nat).
The Message processing amount of various businesses type is converted to using weight treating capacity when being equivalent to processing baseline message.
And the treating capacity that baseline message is handled in calculating cycle is certain, therefore, the occupancy of the processor is equal to the total business report
Literary treating capacity accounts for the ratio of the baseline Message processing amount.That is Loadi=Counterstd,i/Numtotal,i* 100%, wherein
LoadiFor the occupancy of i-th of calculating cycle, Counterstd,iFor the middle service message treating capacity in i-th of calculating cycle,
Numtotal,iFor the baseline Message processing amount in i-th of calculating cycle.
The service message treating capacity of actual treatment in calculating cycle is converted to quantity (the total business report of processing baseline message
Literary treating capacity), thus according to the quantity of the baseline message of actual treatment in calculating cycle and the theoretical baseline report being capable of handling
Literary treating capacity can accurately calculate the occupancy of processor, improve efficiency and accuracy that processor occupancy calculates.
For example, presetting as baseline message using IPV4 message and calculating cycle TloadIt is 1 second.When VM is powered on, at physics
The crystal oscillator clock of device is managed as reference clock source.It triggers simulator and sends IPV4 message, record moment T1;It forwards at scheduler module
After the completion of managing the IPV4 message, simulator is sent back, records moment T2;According to formula Tstd=T2-T1Obtain baseline Message processing
Shi Changwei 5*10-7Second.Then, baseline Message processing amount is Num in calculating cycletotal=Tload/Tstd=1/5*10-7=2*106
It is a, i.e. 2*10 is capable of handling in a calculating cycle6A baseline message.
Weighted value β (ipsec)=10, nat business weighted value β (nat)=2, IPV4 message of default ipsec business
Weighted value is β (IPV4)=1.In server course of normal operation, gets and forward scheduler module coprocessing in calculating cycle
10000 IPV4 messages, 8000 ipsec messages, 5000 nat messages.It can be obtained calculating week according to different business weight
Total business Message processing amount in phase are as follows:
Counterstd,i=10000*1+8000*10+5000*2=105It is a.
Therefore, the occupancy of processor are as follows:
Loadi=Counterstd,i/Numtotal,i* 100%=105/(2*106) * 100%=5%.
Further, referring to Fig. 5, the occupancy acquisition device of processor further includes timer module 50.In virtualization ring
In border, the hardware resources such as the physical processor (CPU) of server, fast cache storage area (CACHE) are shared to be used, virtually
When handling different business message, the handling duration of baseline message may change processor.Therefore in the occupancy of processor
Timer module 50 is added in rate acquisition device, when the processor for needing to calculate occupancy is virtual processor, passes through timing
50 timing controlled processor of device module reacquires baseline Message processing duration, to ensure that calculated occupancy is more accurate.
Specifically, it using the crystal oscillator clock of physical processor 10 as reference clock, is enabled in virtual server run mode
Timer module 50, timing cycle arrives, and control simulator creates baseline message, and the baseline message is sent to forwarding process
Module 20 obtains the handling duration that virtual processor handles the baseline message.By timing adjustment baseline Message processing duration,
It can reflect the more true processing capacity of virtual server according to the service condition of server physical resource, so that virtual server
Occupancy calculate it is more accurate.For example, setting the timing cycle of timer module to update a baseline report after 10 seconds, 10 seconds
The handling duration of text, using the occupancy of the new subsequent calculating cycle inner treater of baseline Message processing duration calculation.
Further, in the occupancy acquisition device of processor, alarm modules (not shown) is set, in processor
Occupancy be greater than certain predetermined threshold value when, the prompt information of processor excess load is reported by alarm modules, and report together
The processor information (title of such as processor, address) and information on load (such as occupancy specific value) of excess load, just
The processing such as dilatation is carried out in the timely Risk-warning of operation maintenance personnel and to processor, ensures the normal processing and forwarding of data message.
In addition, after continuing to test the occupancy of processor, when the occupancy of calculating cycle inner treater is pre- less than second
If when threshold value, eliminating the prompt information.Wherein, second preset threshold is less than first preset threshold.Further, it is
It realizes the timely notice of alarm, alerts gentle recovery, the occupancy detected in continuous multiple calculating cycles is respectively less than second
When preset threshold, the prompt information of excess load is just eliminated.
For example, presetting the first preset threshold in alarm module takes 80%, the second preset threshold takes 65%, and preset times are set
It is set to 3 times.When the occupancy for calculating processor in i-th of calculating cycle is 85% (being greater than 80%), it is super to generate occupancy
The prompt information of load.After detecting that occupancy is greater than the first preset threshold within the i-th period, i-th+2, i+3, i+4 continuously examine
The occupancy surveyed in three calculating cycles is 63%, 64%, 61% respectively, respectively less than the second preset threshold of alarm clearing, is disappeared
Except prompt information, alarm module report and alarm restores and reports respective processor information and load value information etc. together.
In the present embodiment, the handling duration of baseline message is obtained as reference clock using crystal oscillator clock 10, and is examined
The beginning and ending time point for surveying calculating cycle, determines a calculating cycle.Forward scheduler module 20 as service message in processor
Processing module is mainly used for forward process baseline message and processor when obtaining baseline Message processing duration and works normally
In the process, the treating capacity of the service message of calculating cycle inner treater processing is obtained.At 30 calculating of occupancy computing module
Manage occupancy of the device in calculating cycle.Baseline message is triggered using occupancy computing module 30 and sends the baseline message
To forwarding scheduler module 20, forwarding scheduler module 20 handles baseline message, and crystal oscillator clock 10 records the handling duration of baseline message,
And baseline Message processing duration is fed back into occupancy computing module 30.When occupancy computing module 30 is according to baseline Message processing
Length calculates the baseline Message processing amount being capable of handling in a calculating cycle inner treater.Also, according to forwarding scheduler module
The service message treating capacity of each type in 20 calculating cycles reported obtains the total business Message processing in the calculating cycle
Amount.Finally, the occupancy of the processor is obtained according to the total business Message processing amount and baseline Message processing amount.It solves
Low, the problem of accuracy difference using the artificial occupancy bring computational efficiency that calculates.
In addition, the embodiment of the present invention also proposes a kind of computer readable storage medium, the computer readable storage medium
On be stored with the occupancy of processor and obtain program, the occupancy of the processor is obtained when program is executed by processor and is realized such as
The step of occupancy acquisition methods of processor described in upper each embodiment.
It should be noted that, in this document, the terms "include", "comprise" or its any other variant are intended to non-row
His property includes, so that the process, method, article or the system that include a series of elements not only include those elements, and
And further include other elements that are not explicitly listed, or further include for this process, method, article or system institute it is intrinsic
Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including being somebody's turn to do
There is also other identical elements in the process, method of element, article or system.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side
Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases
The former is more preferably embodiment.Based on this understanding, technical solution of the present invention substantially in other words does the prior art
The part contributed out can be embodied in the form of software products, which is stored in one as described above
In storage medium (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that terminal device (it can be mobile phone,
Computer, server, air conditioner or network equipment etc.) execute method described in each embodiment of the present invention.
The above is only a preferred embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hair
Equivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skills
Art field, is included within the scope of the present invention.
Claims (10)
1. a kind of occupancy acquisition methods of processor, which is characterized in that the occupancy acquisition methods of the processor include with
Lower step:
Obtain baseline Message processing duration;
Baseline Message processing amount in the calculating cycle is obtained according to the baseline Message processing duration;
Obtain total business Message processing amount in the calculating cycle;
The occupancy of the processor is obtained according to the baseline Message processing amount and the total business Message processing amount.
2. the occupancy acquisition methods of processor as described in claim 1, which is characterized in that described to obtain the calculating cycle
The step of interior total business Message processing amount includes:
Obtain the type of service of service message in the calculating cycle, the weight of the type of service and each type of service pair
The service message treating capacity answered;
According to the type of service, the weight of the type of service and the corresponding service message processing of each type of service
Amount obtains the total business Message processing amount.
3. the occupancy acquisition methods of processor as described in claim 1, which is characterized in that the acquisition baseline Message processing
The step of duration includes:
Baseline message is created, and the baseline message is sent to processor;
The processor is handled into the handling duration of the baseline message as the baseline Message processing duration.
4. the occupancy acquisition methods of processor as claimed in claim 3, which is characterized in that the occupancy of the processor obtains
Take method further include:
Timing executes the creation baseline message, and the step of baseline message is sent to processor.
5. the occupancy acquisition methods of the processor as described in claim 1-4 is any, which is characterized in that described according to the base
After the step of report from a liner text treating capacity and the total business Message processing amount obtain the occupancy of the processor, further includes:
Judge whether the occupancy is greater than the first preset threshold;
When the occupancy is greater than first preset threshold, prompt information is generated, to prompt processor occupancy excess load.
6. the occupancy acquisition methods of processor as claimed in claim 5, which is characterized in that the generation prompt information, with
After the step of prompting processor occupancy excess load, further includes:
Judge the occupancy of the processor in the calculating cycle whether less than the second preset threshold, wherein described second is pre-
If threshold value is less than first preset threshold;
When the occupancy of the processor is less than second preset threshold, the prompt information is eliminated.
7. the occupancy acquisition methods of processor as claimed in claim 6, which is characterized in that described to eliminate the prompt information
The step of before, further includes:
When the occupancy of the processor is less than second preset threshold, it is default less than described second to update the occupancy
The number of threshold value;
When the number be greater than preset times when, execute the elimination prompt information the step of.
8. a kind of occupancy acquisition device of processor, which is characterized in that the occupancy acquisition device of the processor includes:
Crystal oscillator clock, for obtaining baseline Message processing duration and the beginning and ending time in monitoring calculation period point;
Scheduler module is forwarded, is used for forward process baseline message, and obtain the service message treating capacity in the calculating cycle;
Occupancy computing module, for triggering baseline message and the baseline message being sent to the forwarding scheduler module, root
Baseline Message processing amount in the calculating cycle is obtained according to the baseline Message processing duration, and is obtained in the calculating cycle
Total business Message processing amount obtains the processor according to the total business Message processing amount and the baseline Message processing amount
Occupancy.
9. the occupancy acquisition device of processor as claimed in claim 8, which is characterized in that the occupancy of the processor obtains
Take device further include:
Weight preset module is sent to the occupancy for the weight of each type of service to be arranged, and by the weight
Computing module, so that the occupancy computing module is according to the service message treating capacity and the power of each type of service
Total business Message processing amount in calculating cycle described in re-computation.
10. a kind of computer readable storage medium, which is characterized in that be stored with processor on the computer readable storage medium
Occupancy obtain program, the occupancy of the processor, which obtains, to be realized when program is executed by processor as in claim 1 to 7
The step of occupancy acquisition methods of described in any item processors.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811515643.4A CN109614305A (en) | 2018-12-11 | 2018-12-11 | Occupancy acquisition methods, device and the computer readable storage medium of processor |
PCT/CN2019/127149 WO2020119826A1 (en) | 2018-12-11 | 2019-12-20 | Method for acquiring processor utilization rate, device, and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811515643.4A CN109614305A (en) | 2018-12-11 | 2018-12-11 | Occupancy acquisition methods, device and the computer readable storage medium of processor |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109614305A true CN109614305A (en) | 2019-04-12 |
Family
ID=66008818
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811515643.4A Pending CN109614305A (en) | 2018-12-11 | 2018-12-11 | Occupancy acquisition methods, device and the computer readable storage medium of processor |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN109614305A (en) |
WO (1) | WO2020119826A1 (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2020119826A1 (en) * | 2018-12-11 | 2020-06-18 | 广东省新一代通信与网络创新研究院 | Method for acquiring processor utilization rate, device, and computer readable storage medium |
CN112162901A (en) * | 2020-09-21 | 2021-01-01 | 东软集团股份有限公司 | Method, system, storage medium and electronic device for determining CPU utilization rate |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1917478A (en) * | 2006-09-14 | 2007-02-21 | 杭州华为三康技术有限公司 | Method for processing forwarding message, and process module |
US7844726B2 (en) * | 2008-07-28 | 2010-11-30 | Trading Technologies International, Inc. | System and method for dynamically managing message flow |
CN105159763A (en) * | 2015-08-05 | 2015-12-16 | 瑞斯康达科技发展股份有限公司 | CPU utilization rate control method and apparatus |
CN106708709A (en) * | 2015-07-30 | 2017-05-24 | 中兴通讯股份有限公司 | CPU occupancy rate detection method and device |
CN108512727A (en) * | 2018-04-02 | 2018-09-07 | 北京天融信网络安全技术有限公司 | A kind of determination method and device of central processing unit utilization rate |
CN108681498A (en) * | 2018-03-23 | 2018-10-19 | 维沃移动通信有限公司 | A kind of monitoring method of CPU usage, device and mobile terminal |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2016046575A (en) * | 2014-08-20 | 2016-04-04 | 株式会社日立製作所 | Traffic management device and wireless network system |
CN109614305A (en) * | 2018-12-11 | 2019-04-12 | 广东省新代通信与网络创新研究院 | Occupancy acquisition methods, device and the computer readable storage medium of processor |
-
2018
- 2018-12-11 CN CN201811515643.4A patent/CN109614305A/en active Pending
-
2019
- 2019-12-20 WO PCT/CN2019/127149 patent/WO2020119826A1/en active Application Filing
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1917478A (en) * | 2006-09-14 | 2007-02-21 | 杭州华为三康技术有限公司 | Method for processing forwarding message, and process module |
US7844726B2 (en) * | 2008-07-28 | 2010-11-30 | Trading Technologies International, Inc. | System and method for dynamically managing message flow |
CN106708709A (en) * | 2015-07-30 | 2017-05-24 | 中兴通讯股份有限公司 | CPU occupancy rate detection method and device |
CN105159763A (en) * | 2015-08-05 | 2015-12-16 | 瑞斯康达科技发展股份有限公司 | CPU utilization rate control method and apparatus |
CN108681498A (en) * | 2018-03-23 | 2018-10-19 | 维沃移动通信有限公司 | A kind of monitoring method of CPU usage, device and mobile terminal |
CN108512727A (en) * | 2018-04-02 | 2018-09-07 | 北京天融信网络安全技术有限公司 | A kind of determination method and device of central processing unit utilization rate |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2020119826A1 (en) * | 2018-12-11 | 2020-06-18 | 广东省新一代通信与网络创新研究院 | Method for acquiring processor utilization rate, device, and computer readable storage medium |
CN112162901A (en) * | 2020-09-21 | 2021-01-01 | 东软集团股份有限公司 | Method, system, storage medium and electronic device for determining CPU utilization rate |
Also Published As
Publication number | Publication date |
---|---|
WO2020119826A1 (en) | 2020-06-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8935395B2 (en) | Correlation of distributed business transactions | |
US10594562B1 (en) | Intelligent autoscale of services | |
CN106130816B (en) | A kind of content distributing network monitoring method, monitoring server and system | |
US9473374B2 (en) | Integrated metering of service usage for hybrid clouds | |
US6609083B2 (en) | Adaptive performance data measurement and collections | |
US10095598B2 (en) | Transaction server performance monitoring using component performance data | |
EP3860052A1 (en) | Method and device for monitoring bandwidth state | |
WO2017052935A1 (en) | Out-of-band platform tuning and configuration | |
US9811356B2 (en) | Automated software configuration management | |
EP3449205A1 (en) | Predictive rollup and caching for application performance data | |
US20150149554A1 (en) | Automatic capture of detailed analysis information based on remote server analysis | |
CN104657215A (en) | Virtualization energy-saving system in Cloud computing | |
CN109146381A (en) | Logistics data monitoring method, device, electronic equipment and computer storage medium | |
CN111355622A (en) | Container traffic monitoring method, system and computer readable storage medium | |
US9015731B2 (en) | Event handling system and method | |
CN109614305A (en) | Occupancy acquisition methods, device and the computer readable storage medium of processor | |
US20170078049A1 (en) | Freshness-sensitive message delivery | |
CN110751458A (en) | Business approval method, device and system | |
CN110471769A (en) | A kind of method for managing resource and device of virtual machine | |
US20150277892A1 (en) | Multi-phase software delivery | |
EP3011456B1 (en) | Sorted event monitoring by context partition | |
CN116107913B (en) | Test control method, device and system of single-node server | |
KR101968575B1 (en) | Method for automatic real-time analysis for bottleneck and apparatus for using the same | |
CN110007940B (en) | Gray scale release verification method, system, server and readable storage medium | |
CN112001116A (en) | Cloud resource capacity prediction method and device |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190412 |
|
RJ01 | Rejection of invention patent application after publication |