CN108512727A - A kind of determination method and device of central processing unit utilization rate - Google Patents
A kind of determination method and device of central processing unit utilization rate Download PDFInfo
- Publication number
- CN108512727A CN108512727A CN201810283921.1A CN201810283921A CN108512727A CN 108512727 A CN108512727 A CN 108512727A CN 201810283921 A CN201810283921 A CN 201810283921A CN 108512727 A CN108512727 A CN 108512727A
- Authority
- CN
- China
- Prior art keywords
- processing unit
- central processing
- message
- time
- handling capacity
- 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
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
- H04L43/0805—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
- H04L43/0817—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking functioning
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
- H04L43/0876—Network utilisation, e.g. volume of load or congestion level
- H04L43/0888—Throughput
Landscapes
- Engineering & Computer Science (AREA)
- Environmental & Geological Engineering (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The determination method and device of central processing unit utilization rate provided by the invention, method include:Calculate the maximum value that central processing unit forwards the handling capacity of predetermined length message within a predetermined period of time, the quantitative value for the predetermined length message that statistics central processing unit forwards within a predetermined period of time, the utilization rate of central processing unit is determined according to the maximum value of handling capacity all in predetermined amount of time and all quantitative values.This method determines the utilization rate of CPU by determining the quantitative value of maximum values and each length message actually forwarded of the CPU under 100% load condition to the handling capacity of each length message.This method is from the statistics practical quantitative value angles to E-Packet of CPU, and in conjunction with the handling capacity maximum value of CPU, calculated cpu busy percentage can effectively reflect the actual conditions that CPU is used, and method simple practical, calculate accurately, solve problem of the prior art.
Description
Technical field
The present invention relates to network communication technology fields, a kind of determination method more particularly to central processing unit utilization rate and
Device.
Background technology
Data forwarding is the basic function of security gateway, with the increasingly complexity of network environment and business, to security gateway
Handling capacity require it is higher and higher, it is various improve security gateway handling capacities technologies also occur therewith, CPU (Central
Processing Unit, central processing unit) poll processing packet technology be typical technology therein.It is handled using CPU polls
Packet technology can start a unique thread on specified CPU, cycle is gone to execute a task.Specified CPU at this time
Core does not receive scheduling, and the process that message is collected, handles and sent is carried out with polling mode.This kind of specified core cpu I
Be commonly called as fast core, the unique thread run on fast core, we are known as fast core thread.The utilization rate of fast core is in above-mentioned technology
One important indicator, the utilization rate for calculating fast core are an important needs in above-mentioned technology.
The determination method of the existing utilization rate to fast core is calculated using the distribution of timeslice, is obtained fast in a period of time
The timeslice that core is polled carrys out computation-free rate, to be utilized rate.But due to only carrying out a task on fast core, do not have
Process scheduling, also without interrupt response.Fast core thread occupies always fast core and is polled timeslice, in this case, uses
The existing method for calculating fast core utilization rate, calculated utilization rate usually approach or reach 100%, therefore can not calculate true
The numerical value of real reflection cpu busy percentage.
Invention content
The present invention provides a kind of determination method and device of central processing unit utilization rate, to solve the as follows of the prior art
Problem:It can not determine the numerical value of true reflection cpu busy percentage.
In order to solve the above technical problems, the present invention provides a kind of determination method of central processing unit utilization rate, including:It calculates
Central processing unit forwards the maximum value of the handling capacity of predetermined length message within a predetermined period of time, wherein the predetermined length report
The length of text includes at least following one:64 bytes, 128 bytes, 256 bytes, 512 bytes, 1024 bytes and 1500 bytes;
Count the quantitative value for the predetermined length message that the central processing unit forwards in the predetermined amount of time;According to described pre-
The maximum value of all handling capacities and all quantitative values determine the utilization rate of central processing unit in section of fixing time.
Optionally, calculate central processing unit forward within a predetermined period of time predetermined length message handling capacity maximum value it
Before, further include:Calculate the maximum value that central processing unit forwards the handling capacity of the predetermined length message unit time.
Optionally, the maximum value that central processing unit forwards the handling capacity of the predetermined length message unit time, packet are calculated
It includes:The unit is determined according to the dominant frequency value of the corresponding default estimation factor of the preset length message and the central processing unit
The maximum value of the handling capacity of time.
Optionally, the number for the predetermined length message that the central processing unit forwards in the predetermined amount of time is counted
Magnitude, including:Count the message total amount that the central processing unit forwards in the predetermined amount of time;By the message total
Amount carries out statistic of classification according to the length of the predetermined length message, obtains the central processing unit in the predetermined amount of time and turns
The quantitative value of the predetermined length message of each length of hair.
Optionally, according to the maximum value of the handling capacity all in the predetermined amount of time and all quantitative values
Determine the utilization rate of central processing unit, including:The maximum value of the quantitative value divided by the handling capacity obtains the predetermined length
The occupancy of message;All occupancies in the predetermined amount of time are added, the utilization rate of the central processing unit is obtained.
In addition, to achieve the above object, the present invention also provides a kind of determining devices of central processing unit utilization rate, including:
First computing module, the maximum for forwarding the handling capacity of predetermined length message within a predetermined period of time for calculating central processing unit
Value, wherein the length of the predetermined length message includes at least following one:64 bytes, 128 bytes, 256 bytes, 512 words
Section, 1024 bytes and 1500 bytes;Statistical module is forwarded for counting the central processing unit in the predetermined amount of time
The predetermined length message quantitative value;Determining module, for according to the handling capacity all in the predetermined amount of time
Maximum value and all quantitative values determine the utilization rate of central processing unit.
Optionally, described device further includes:Second computing module forwards the predetermined length for calculating central processing unit
The maximum value of the handling capacity of message unit time.
Optionally, second computing module, is specifically used for:According to the corresponding default estimation of the preset length message because
The dominant frequency value of the sub and described central processing unit determines the maximum value of the handling capacity of the unit interval.
Optionally, the statistical module, is specifically used for:The central processing unit is counted to forward in the predetermined amount of time
Message total amount;The message total amount is subjected to statistic of classification according to the length of the predetermined length message, is obtained described
The quantitative value of the predetermined length message of each length of the central processing unit forwarding in predetermined amount of time.
Optionally, the determining module, is specifically used for:The maximum value of the quantitative value divided by the handling capacity obtains institute
State the occupancy of predetermined length message;All occupancies in the predetermined amount of time are added, the central processing unit is obtained
Utilization rate.
The determination method of central processing unit utilization rate provided by the invention can be by determining CPU in 100% load condition
Under to the maximum value of the handling capacity of each length message and the quantitative value of each length message actually forwarded, and then determine
The utilization rate of CPU.For this method from the statistics practical quantitative value angles to E-Packet of CPU, the handling capacity in conjunction with CPU is maximum
Value, calculated cpu busy percentage can reflect the actual conditions that CPU is used, and method simple practical, calculate accurate, solution
The following problem of the prior art:It can not determine the numerical value of true reflection cpu busy percentage.
Description of the drawings
Fig. 1 is the flow chart of the determination method of cpu busy percentage in first embodiment of the invention;
Fig. 2 is the structural schematic diagram of the determining device of cpu busy percentage in second embodiment of the invention;
Fig. 3 is the flow chart of the determination method of cpu busy percentage in third embodiment of the invention.
Specific implementation mode
In order to solve the problems, such as the as follows of the prior art:The determination method of existing cpu busy percentage can not determine true reflection
The numerical value of cpu busy percentage.Present embodiments provide a kind of determination method of cpu busy percentage, flow chart such as Fig. 1 institutes of this method
Show, including step S102 to S106:
S102 calculates the maximum value that CPU forwards the handling capacity of predetermined length message within a predetermined period of time.
CPU in the present embodiment refers to carrying out the fast core of message forwarding, and the sole task of fast core is exactly to handle message
Forwarding cannot successfully forwarded more messages when reaching the maximum processing capability of CPU.Determination in the present embodiment
Method is exactly on this basis, to assess the utilization rate of this CPU using the load factor of processing message on current fast core, and at this
In embodiment, message is existing in the form of data packet.For example, when fast core does not have data processing, cpu busy percentage 0%,
Reflect currently without progress Message processing;When fast core reaches the maximum capacity to E-Packet, cpu busy percentage is at this time
100%, more message data packets can not be handled by reflecting current CPU, and CPU is in full load condition, corresponds at this time
CPU forwards the maximum value of the handling capacity of predetermined length message within a predetermined period of time.
Also, the maximum value of the data packet that CPU processing is made of the message of different byte lengths, handling capacity is different
, in the method for this implementation, the corresponding handling capacity maximum value of each length message will carry out calculation processing, in addition, in order to
So that calculating accurately, the length of predetermined length message includes in the present embodiment:64 bytes, 128 bytes, 256 bytes, 512 bytes,
1024 bytes and 1500 bytes, the data packet that the message of above-mentioned each byte length is formed, are forwarded by CPU.
S104, the quantitative value for the predetermined length message that statistics central processing unit forwards within a predetermined period of time.
In the present embodiment, due to being the practical efficiency of CPU to be determined, the practical progress messages of CPU will be counted and turned
When sending out work, the quantitative value of the message of each length forwarded within a certain period of time, in the present embodiment, the message of predetermined length
The number of the data packet that value is made of message is weighed.Also, it is accurate in order to count, in the predetermined amount of time and S102 of the step
Predetermined amount of time length it is identical.
S106 determines central processing unit according to the maximum value of handling capacity all in predetermined amount of time and all quantitative values
Utilization rate.
By S102 it is found that cpu busy percentage corresponds to the maximum value for generating handling capacity when being 100% the case where, i.e., CPU can
The maximum number magnitude to E-Packet, therefore, the step is according to the quantitative value actually to E-Packet and the maximum value of handling capacity, just
It can determine the practical efficiency of the CPU.If the above-mentioned predetermined length message being related to is the length of multiple types,
After the maximum value and quantitative value of the corresponding handling capacity of predetermined length message of each type obtain, then calculate central processing unit
Utilization rate.
Determining method provided in this embodiment calculates central processing unit and forwards predetermined length report within a predetermined period of time first
The maximum value of the handling capacity of text, and then count the quantity for the predetermined length message that central processing unit forwards within a predetermined period of time
Value, finally determines the utilization of central processing unit according to the maximum value of handling capacity all in predetermined amount of time and all quantitative values
Rate.This method is by determining maximum values and practical turn of the CPU under 100% load condition to the handling capacity of each length message
The quantitative value of each length message of hair, and then determine the utilization rate of CPU.This method from statistics the practical numbers to E-Packet of CPU
Magnitude angle is set out, and in conjunction with the handling capacity maximum value of CPU, calculated cpu busy percentage can reflect the practical feelings that CPU is used
Condition, and method simple practical calculate accurately, solve the problems, such as the as follows of the prior art:Existing method can not determine true anti-
Reflect the numerical value of cpu busy percentage.
In the present embodiment, the handling capacity of predetermined length message is forwarded within a predetermined period of time in order to facilitate calculating CPU
Maximum value can calculate the maximum value that CPU forwards the handling capacity of predetermined length message in the unit interval before this step, then
It is calculated in conjunction with the specific length of predetermined amount of time, obtains CPU and forward handling up for predetermined length message within a predetermined period of time
The maximum value of amount.
In the present embodiment, in order to increase versatility, the maximum value that its handling capacity will be tested out per a CPU is avoided,
Handling capacity maximum can be summed up by testing maximum values of more money typical case CPU for the handling capacity of each preset length message
The relationship of value and CPU frequency value (HZ), and then obtain the estimation factor.For the data packet that different length message is formed, also have not
The same estimation factor.After the CPU for testing a few money difference dominant frequency, it is found that the CPU of different dominant frequency forwards same length message
When data packet, the difference for the estimation factor values being calculated, which can consider, ignores.Therefore, according to the message of each length
The test result being forwarded by the CPU of different dominant frequency can obtain an average value and be corresponded to as each length message first
The estimation factor, and then be multiplied by specific CPU's according to each corresponding default estimation factor of each preset length message
Dominant frequency value determines the maximum value of the handling capacity of its unit interval.
In addition, in the present embodiment, the mistake of the quantitative value for the predetermined length message that statistics CPU is forwarded within a predetermined period of time
Journey specifically includes:The message total amount that statistics CPU is forwarded within a predetermined period of time;By message total amount according to predetermined length message
Length carry out statistic of classification, obtain the quantitative value of the predetermined length message for each length that CPU in predetermined amount of time is forwarded.
In actual count, the length actually to E-Packet may be not limited only to the byte length of standard, for convenience of calculation, carry out
When statistics, following dividing mode may be used:The data packet of 100 bytes message below composition all incorporates 64 bytes this shelves into
The data packet of statistics, the message composition of 100 bytes to 200 byte lengths all incorporates this grade of statistics of 128 bytes into, and 200 bytes are extremely
The data packet of the message composition of 400 byte lengths all incorporates this grade of statistics of 256 bytes, the report of 400 bytes to 800 byte lengths into
The data packet of text composition all incorporates this grade of statistics of 512 bytes, the data packet of the message composition of 800 bytes to 1300 byte lengths into
All incorporate this grade of statistics of 1024 bytes into, the data packet of the message composition of 1300 bytes and the above length all incorporate into 1500 bytes this
One grade is counted.It is of course also possible to which according to actual needs and statistics computing capability carries out the divisions of other modes, stepping gets over
More, the result of identified cpu busy percentage more tallies with the actual situation.
Finally, in the present embodiment, according to the maximum value of handling capacity all in predetermined amount of time and all numbers
Magnitude determine central processing unit utilization rate, in particular to:The maximum value of quantitative value divided by handling capacity obtains predetermined length message
Occupancy;All occupancies in predetermined amount of time are added, the utilization rate of central processing unit is obtained.Due to the report of each length
Text all corresponds to the maximum value of a handling capacity, is actually forwarded in the given time to CPU according to message length again in above-mentioned steps
Message be classified statistics, therefore the calculating of occupancy will be carried out respectively, then will calculate according to the stepping of message length
Obtained each occupancy is added, so that it is determined that the utilization rate of CPU.
Second embodiment of the invention provides a kind of determining device of cpu busy percentage, the apparatus structure schematic diagram such as Fig. 2 institutes
Show, including:First computing module 10 calculates the maximum value that CPU forwards the handling capacity of predetermined length message within a predetermined period of time;
Statistical module 20 is coupled with the first computing module 10, for counting predetermined length message that CPU is forwarded within a predetermined period of time
Quantitative value;Determining module 30 is coupled with statistical module 20, for according to the maximum value of handling capacity all in predetermined amount of time and
All quantitative values determine the utilization rate of central processing unit.
CPU in the present embodiment refers to carrying out the fast core of message forwarding, and the sole task of fast core is exactly to handle message
Forwarding.For the quantitative value that successfully forwarded message in the unit interval, different CPU can have its limiting value.When reaching CPU's
When maximum processing capability, more messages cannot be successfully forwarded.Determination method in the present embodiment be exactly on this basis,
The utilization rate of this CPU is assessed using the load factor of processing message on current fast core, and in the present embodiment, message is with number
Existing for form according to packet.For example, when fast core does not have data processing, cpu busy percentage 0% reflects currently without progress
Message processing;When fast core reaches the maximum capacity to E-Packet, cpu busy percentage is 100% at this time, has reflected current CPU
The data packet formed through that can not handle more messages, i.e. CPU are in full load condition.At this point, will be by the first computing module
Calculate the maximum value that CPU forwards the handling capacity of predetermined length message within a predetermined period of time.
Also, the maximum value of the data packet that CPU processing is made of the message of different byte lengths, handling capacity is different
, in the method for this implementation, the corresponding handling capacity maximum value of each length message will carry out calculation processing, in the present embodiment
The length of predetermined length message is identical with first embodiment.
In the present embodiment, due to being the practical efficiency of CPU to be determined, will CPU realities be counted by statistical module
When border carries out message forwarding work, the quantitative value of the message of each length forwarded within a certain period of time, the message of predetermined length
The number of the data packet that value is made of message is weighed.
Due to cpu busy percentage be 100% when correspond to generate handling capacity maximum value the case where, i.e. CPU can forward report
The maximum number magnitude of text, therefore, according to the maximum value of the quantitative value and handling capacity that actually E-Packet, determining module
Determine the practical efficiency of the CPU.
CPU forwards the maximum value of the handling capacity of predetermined length message, Ke Yiji within a predetermined period of time for ease of calculation
The maximum value that CPU forwards the handling capacity of predetermined length message in the unit interval is calculated, therefore, the determining device in the present embodiment is also wrapped
It includes:Second computing module 40 is coupled with the first computing module 10, and the predetermined length message unit time is forwarded for calculating CPU
The maximum value of handling capacity.Thereafter, it is calculated in conjunction with the specific length of predetermined amount of time, CPU can be obtained in the predetermined time
The maximum value of the handling capacity of forwarding predetermined length message in section.
In the present embodiment, above-mentioned second computing module specifically can be used for:It is corresponding default according to preset length message
The estimation factor and the dominant frequency value of central processing unit determine the maximum value of the handling capacity of unit interval.
In order to increase versatility, avoids that the maximum value that test determines its handling capacity will be carried out per a CPU, can pass through
More money typical case CPU are tested for the maximum value of the handling capacity of each preset length message, sum up handling capacity maximum value and CPU master
The relationship of frequency value, and then obtain the estimation factor.Data similar with the maximum value of handling capacity, being formed for different length message
Packet, also there is the different estimation factors.
After the CPU for testing a few money difference dominant frequency, it is found that the CPU of different dominant frequency forwards the data packet of same length message
When, the difference for the estimation factor values being calculated, which can consider, ignores.Therefore, according to the message of each length by difference
The test result that the CPU of dominant frequency is forwarded can obtain an average value as each corresponding estimation of length message first
The factor, and then the second computing module can be multiplied by tool according to each corresponding default estimation factor of each preset length message
The dominant frequency value of the CPU of body determines the maximum value of the handling capacity of its unit interval.
In addition, in the present embodiment, statistical module is specifically used for:The message that statistics CPU is forwarded within a predetermined period of time is total
Quantity;Message total amount is subjected to statistic of classification according to the length of predetermined length message, obtains what CPU in predetermined amount of time was forwarded
The quantitative value of the predetermined length message of each length.In actual count, the length actually to E-Packet may be not limited only to
For convenience of calculation, when being counted, following dividing mode may be used in the byte length of standard:100 bytes are below
The data packet of message composition all incorporates this grade of statistics of 64 bytes, the data packet of the message composition of 100 bytes to 200 byte lengths into
All incorporate into 128 bytes this grade statistics, 200 bytes to 400 byte lengths message composition data packet all incorporate into 256 bytes this
The data packet of one grade of statistics, the message composition of 400 bytes to 800 byte lengths all incorporates this grade of statistics of 512 bytes, 800 words into
It saves the data packet formed to the message of 1300 byte lengths and all incorporates this grade of statistics of 1024 bytes, 1300 bytes and the above length into
The data packet of message composition all incorporate 1500 bytes this shelves into and counted.It is of course also possible to according to actual needs and system
The division that computing capability carries out other modes is counted, stepping is more, and the result of identified cpu busy percentage more tallies with the actual situation.
Finally, in the present embodiment, determining module is specifically used for:The maximum value of quantitative value divided by handling capacity, is made a reservation for
The occupancy of length message;All occupancies in predetermined amount of time are added, the utilization rate of central processing unit is obtained.Due to each
The message of length all corresponds to the maximum value of a handling capacity, in above-mentioned steps again according to message length to CPU in the given time
The message actually forwarded is classified statistics, therefore will carry out the calculating of occupancy respectively according to the stepping of message length,
The each occupancy being calculated is added again, so that it is determined that the utilization rate of CPU.
Determining device provided in this embodiment calculates central processing unit in predetermined amount of time by the first computing module first
The maximum value of the handling capacity of interior forwarding predetermined length message, and then within a predetermined period of time by statistical module counts central processing unit
The quantitative value of the predetermined length message of forwarding, finally by determining module according to the maximum value of handling capacity all in predetermined amount of time
The utilization rate of central processing unit is determined with all quantitative values.The device is by determining CPU under 100% load condition to each
The quantitative value of the maximum value of the handling capacity of length message and each length message actually forwarded, and then determine the utilization of CPU
Rate.The device is determined from the statistics practical quantitative value angles to E-Packet of CPU in conjunction with the maximum value of the handling capacity of CPU
Cpu busy percentage can reflect the actual conditions that CPU is used, and simple and practical, calculate accurately, solve the as follows of the prior art
Problem:It can not determine the numerical value of true reflection cpu busy percentage.
Third embodiment of the invention provides a kind of determination method of cpu busy percentage, flow chart such as Fig. 3 institutes of this method
Show, is as follows:
S302 calculates the maximum value and the estimation factor of the handling capacities of CPU within a certain period of time.
Referred to as fast core when CPU is forwarded the packet as sole task, the maximum message segment processing capacity of a fast core, uses unit
The number-of-packet magnitude that the message of time-triggered protocol is formed is weighed, and is known as the maximum of the handling capacity of unit interval in the present embodiment
Value.In fact, for the data packet that the message of different byte lengths is formed, the maximum value of the handling capacity of unit interval is different
's.It is accurate in order to calculate, to determine respectively CPU to the length unit of message byte be 64 bytes, 128 bytes, 256 bytes,
The maximum value of the handling capacity of the data packet corresponding unit interval of 512 bytes, 1024 bytes, 1500 bytes, in the present embodiment,
The maximum value of the handling capacity of the message corresponding data packet unit interval of each length is denoted as max respectively64、max128、max256、max512、
max1024、max1500。
Also, in order to avoid every a CPU of increase will be determined by the maximum value of its handling capacity.In the present embodiment
In can by testing the maximum value of more money typical case CPU for the handling capacity of the unit interval of the data packet of different length message,
The relationship for counting the maximum value and CPU frequency value of CPU handling capacities, obtains the estimation factor.Estimate the factor also with the length of message
It is related, after the CPU for testing a few money difference dominant frequency, find the CPU of different dominant frequency for the estimation obtained by identical message length
The difference of the factor is little, it is possible to according to test result of each message length when different CPU handle message, obtain one
Average value, as the corresponding estimation factor of each message length.Unit interval if necessary to determination a new CPU handles up
The maximum value of amount, the dominant frequency value that only need to the corresponding estimation factor of each message length be multiplied by CPU can be obtained by each message
The maximum value of the handling capacity of length corresponding unit interval.In the present embodiment, the corresponding estimation Factor minute of each message length
α is not denoted as it64、α128、α256、α512、α1024、α1500.In the maximum for the handling capacity for determining each message length corresponding unit interval
After value, so that it may according to actual conditions, to determine the maximum value of the handling capacities of CPU within a certain period of time.
S304, the quantitative value for the data packet that statistics CPU is handled within a certain period of time.
Data packet will carry out statistic of classification according to message length.Size takes 64 bytes, 128 bytes, 256 bytes, 512 words
Section, 1024 bytes, 1500 bytes.In specific implementation, for convenience of calculation, the data packet of 100 bytes message composition below
All incorporate into 64 bytes this grade statistics, 100 bytes to 200 byte lengths message composition data packet all incorporate into 128 bytes this
The data packet of one grade of statistics, the message composition of 200 bytes to 400 byte lengths all incorporates this grade of statistics of 256 bytes, 400 words into
It saves the data packet formed to the message of 800 byte lengths and all incorporates this grade of statistics of 512 bytes, 800 bytes to 1300 byte longs into
The data packet of the message composition of degree all incorporates this grade of statistics of 1024 bytes, the number of the message composition of 1300 bytes and the above length into
1500 bytes this shelves are all incorporated into according to packet to be counted.It is of course also possible to according to actual needs and statistics computing capability carry out
The division of other modes, stepping is more, and the result of identified cpu busy percentage more tallies with the actual situation.In specific implementation, with
N seconds are the period, and the time span is identical as the time span in S301.Record the quantity for the data packet that CPU is handled in this N seconds
Value classifies by the length of message in data packet, is denoted as PN respectively64、PN128、PN256、PN512、PN1024、PN1500。
S306 determines the utilization rate of CPU.
In the present embodiment, which specifically includes:
S1, the handling capacity maximum value and statistics being incorporated in N seconds CPU processing data packet quantitative value, calculate separately
The CPU usage of each length message can be expressed as in the present embodiment:
Rate64=PN64/max64×N;
Rate128=PN128/max128×N;
Rate256=PN256/max256×N;
Rate512=PN512/max512×N;
Rate1024=PN1024/max1024×N;
Rate1500=PN1500/max1500×N。
For example, being directed to a CPU, the maximum value max of unit interval handling capacity64=1000, max128=800, max256
=600, max512=500, max1024=400, max1500=300, by the number for counting CPU actual treatment data packets in 5s
Magnitude, PN64=500, PN128=400, PN256=300, PN512=0, PN1024=0, PN1500=0, then Rate64=0.1,
Rate128=0.1, Rate256=0.1, Rate512=0, Rate1024=0, Rate1500=0.
S2, it is denoted as in the present embodiment according to the occupancy of each length message to determine total cpu busy percentage
Ratecore。
Ratecore=Rate64+Rate128+Rate256+Rate512+Rate1024+Rate1500
For example, according to the numerical value of the example above, Rate is calculatedcore=0.1+0.1+0.1+0+0+0=0.3.
Determining method provided in this embodiment calculates central processing unit and forwards predetermined length report within a predetermined period of time first
The maximum value of the handling capacity of text, and then count the quantity for the predetermined length message that central processing unit forwards within a predetermined period of time
Value, finally determines the utilization of central processing unit according to the maximum value of handling capacity all in predetermined amount of time and all quantitative values
Rate.This method is by determining maximum values and practical turn of the CPU under 100% load condition to the handling capacity of each length message
The quantitative value of each length message of hair, and then determine the utilization rate of CPU.This method from statistics the practical numbers to E-Packet of CPU
Magnitude angle is set out, and in conjunction with the handling capacity maximum value of CPU, calculated cpu busy percentage can reflect the practical feelings that CPU is used
Condition, and method simple practical calculate accurately, solve the problems, such as the as follows of the prior art:Existing method can not determine true anti-
Reflect the numerical value of cpu busy percentage.
Although being example purpose, the preferred embodiment of the present invention is had been disclosed for, those skilled in the art will recognize
Various improvement, increase and substitution are also possible, and therefore, the scope of the present invention should be not limited to the above embodiments.
Claims (10)
1. a kind of determination method of central processing unit utilization rate, which is characterized in that including:
Calculate the maximum value that central processing unit forwards the handling capacity of predetermined length message within a predetermined period of time, wherein described pre-
The length of measured length message includes at least following one:64 bytes, 128 bytes, 256 bytes, 512 bytes, 1024 bytes and
1500 bytes;
Count the quantitative value for the predetermined length message that the central processing unit forwards in the predetermined amount of time;
Centre is determined according to the maximum value of the handling capacity all in the predetermined amount of time and all quantitative values
Manage the utilization rate of device.
2. determining method as described in claim 1, which is characterized in that calculate central processing unit and forward within a predetermined period of time in advance
Before the maximum value of the handling capacity of measured length message, further include:
Calculate the maximum value that central processing unit forwards the handling capacity of the predetermined length message unit time.
3. determining method as claimed in claim 2, which is characterized in that calculate central processing unit and forward the predetermined length message
The maximum value of the handling capacity of unit interval, including:
The list is determined according to the dominant frequency value of the corresponding default estimation factor of the preset length message and the central processing unit
The maximum value of the handling capacity of position time.
4. determining method as described in claim 1, which is characterized in that count the central processing unit in the predetermined amount of time
The quantitative value of the predetermined length message of interior forwarding, including:
Count the message total amount that the central processing unit forwards in the predetermined amount of time;
The message total amount is subjected to statistic of classification according to the length of the predetermined length message, obtains the predetermined amount of time
The quantitative value of the predetermined length message of each length of the interior central processing unit forwarding.
5. determining method according to any one of claims 1 to 4, which is characterized in that according to institute in the predetermined amount of time
The maximum value for the handling capacity having and all quantitative values determine the utilization rate of central processing unit, including:
The maximum value of the quantitative value divided by the handling capacity obtains the occupancy of the predetermined length message;
All occupancies in the predetermined amount of time are added, the utilization rate of the central processing unit is obtained.
6. a kind of determining device of central processing unit utilization rate, which is characterized in that including:
First computing module forwards the handling capacity of predetermined length message most within a predetermined period of time for calculating central processing unit
Big value, wherein the length of the predetermined length message includes at least following one:64 bytes, 128 bytes, 256 bytes, 512 words
Section, 1024 bytes and 1500 bytes;
Statistical module, for counting the predetermined length message that the central processing unit forwards in the predetermined amount of time
Quantitative value;
Determining module is used for the maximum value according to the handling capacity all in the predetermined amount of time and all quantity
Value determines the utilization rate of central processing unit.
7. determining device as claimed in claim 6, which is characterized in that further include:
Second computing module, the maximum for forwarding the handling capacity of the predetermined length message unit time for calculating central processing unit
Value.
8. determining device as claimed in claim 7, which is characterized in that second computing module is specifically used for:
The list is determined according to the dominant frequency value of the corresponding default estimation factor of the preset length message and the central processing unit
The maximum value of the handling capacity of position time.
9. determining device as claimed in claim 6, which is characterized in that the statistical module is specifically used for:
Count the message total amount that the central processing unit forwards in the predetermined amount of time;
The message total amount is subjected to statistic of classification according to the length of the predetermined length message, obtains the predetermined amount of time
The quantitative value of the predetermined length message of each length of the interior central processing unit forwarding.
10. the determining device as described in any one of claim 6 to 9, which is characterized in that the determining module is specifically used for:
The maximum value of the quantitative value divided by the handling capacity obtains the occupancy of the predetermined length message;
All occupancies in the predetermined amount of time are added, the utilization rate of the central processing unit is obtained.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810283921.1A CN108512727A (en) | 2018-04-02 | 2018-04-02 | A kind of determination method and device of central processing unit utilization rate |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810283921.1A CN108512727A (en) | 2018-04-02 | 2018-04-02 | A kind of determination method and device of central processing unit utilization rate |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108512727A true CN108512727A (en) | 2018-09-07 |
Family
ID=63379899
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810283921.1A Pending CN108512727A (en) | 2018-04-02 | 2018-04-02 | A kind of determination method and device of central processing unit utilization rate |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108512727A (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109491864A (en) * | 2018-10-30 | 2019-03-19 | 北京天融信网络安全技术有限公司 | A kind of method and the network equipment judging CPU usage |
CN109614305A (en) * | 2018-12-11 | 2019-04-12 | 广东省新代通信与网络创新研究院 | Occupancy acquisition methods, device and the computer readable storage medium of processor |
CN111190728A (en) * | 2019-12-13 | 2020-05-22 | 北京山石网科信息技术有限公司 | Resource adjusting method and device |
CN112162901A (en) * | 2020-09-21 | 2021-01-01 | 东软集团股份有限公司 | Method, system, storage medium and electronic device for determining CPU utilization rate |
CN112306769A (en) * | 2020-10-19 | 2021-02-02 | 苏州浪潮智能科技有限公司 | Method and system for determining utilization rate of ten-gigabit card in storage equipment |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101360075A (en) * | 2008-09-12 | 2009-02-04 | 华为技术有限公司 | Grouped gateway and method for saving power consumption |
CN102821423A (en) * | 2011-06-09 | 2012-12-12 | 中兴通讯股份有限公司 | Method and device for receiving messages |
US20130160024A1 (en) * | 2011-12-20 | 2013-06-20 | Sybase, Inc. | Dynamic Load Balancing for Complex Event Processing |
CN103312547A (en) * | 2013-06-18 | 2013-09-18 | 华为技术有限公司 | Communication method, communication device and communication system |
US20160211940A1 (en) * | 2015-01-16 | 2016-07-21 | Real-Time Innovations, Inc. | Auto-Tuning Reliability Protocol In Pub-Sub RTPS Systems |
-
2018
- 2018-04-02 CN CN201810283921.1A patent/CN108512727A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101360075A (en) * | 2008-09-12 | 2009-02-04 | 华为技术有限公司 | Grouped gateway and method for saving power consumption |
CN102821423A (en) * | 2011-06-09 | 2012-12-12 | 中兴通讯股份有限公司 | Method and device for receiving messages |
US20130160024A1 (en) * | 2011-12-20 | 2013-06-20 | Sybase, Inc. | Dynamic Load Balancing for Complex Event Processing |
CN103312547A (en) * | 2013-06-18 | 2013-09-18 | 华为技术有限公司 | Communication method, communication device and communication system |
US20160211940A1 (en) * | 2015-01-16 | 2016-07-21 | Real-Time Innovations, Inc. | Auto-Tuning Reliability Protocol In Pub-Sub RTPS Systems |
Non-Patent Citations (1)
Title |
---|
王维新: "《微机原理及单片机应用技术[M]》", 31 December 2014 * |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109491864A (en) * | 2018-10-30 | 2019-03-19 | 北京天融信网络安全技术有限公司 | A kind of method and the network equipment judging CPU usage |
CN109614305A (en) * | 2018-12-11 | 2019-04-12 | 广东省新代通信与网络创新研究院 | Occupancy acquisition methods, device and the computer readable storage medium of processor |
WO2020119826A1 (en) * | 2018-12-11 | 2020-06-18 | 广东省新一代通信与网络创新研究院 | Method for acquiring processor utilization rate, device, and computer readable storage medium |
CN111190728A (en) * | 2019-12-13 | 2020-05-22 | 北京山石网科信息技术有限公司 | Resource adjusting method and device |
CN111190728B (en) * | 2019-12-13 | 2023-08-25 | 北京山石网科信息技术有限公司 | Resource adjustment method and device |
CN112162901A (en) * | 2020-09-21 | 2021-01-01 | 东软集团股份有限公司 | Method, system, storage medium and electronic device for determining CPU utilization rate |
CN112306769A (en) * | 2020-10-19 | 2021-02-02 | 苏州浪潮智能科技有限公司 | Method and system for determining utilization rate of ten-gigabit card in storage equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US5802302A (en) | System and method for response time measurement in high speed data transmission networks | |
CN108512727A (en) | A kind of determination method and device of central processing unit utilization rate | |
US8116225B2 (en) | Method and apparatus for estimating channel bandwidth | |
Chatzimisios et al. | Performance analysis of the IEEE 802.11 MAC protocol for wireless LANs | |
CN109067665A (en) | Jamming control method and the network equipment | |
CN103259694B (en) | Space-efficient counter for the network equipment | |
CN105978821B (en) | The method and device that network congestion avoids | |
CN102223263A (en) | Method and device for monitoring packet loss rate based on an FPGA (Field Programmable Gate Array) | |
CN111163018B (en) | Network equipment and method for reducing transmission delay thereof | |
Tian et al. | P-PFC: Reducing tail latency with predictive PFC in lossless data center networks | |
US20140369195A1 (en) | Congestion avoidance and control for udp-based protocols | |
CN110019386A (en) | A kind of stream data processing method and equipment | |
JPWO2012147909A1 (en) | Network device, communication system, abnormal traffic detection method and program | |
CN106533826A (en) | Network state detection method and system | |
CN105245463B (en) | A kind of flow control methods, equipment and storage medium | |
CN103345432A (en) | Multi-core CPU overload detection device and multi-core CPU overload detection method | |
CN109547356A (en) | A kind of data transmission method of electrical energy measurement, system, equipment and computer storage medium | |
US10503807B2 (en) | Method and apparatus for measuring time stamp unit of remote device | |
WO2019109902A1 (en) | Queue scheduling method and apparatus, communication device, and storage medium | |
WO2024169934A1 (en) | Network traffic management method, apparatus, and device, and nonvolatile readable storage medium | |
CN112988417B (en) | Message processing method, device, electronic equipment and computer readable medium | |
CN117097679A (en) | Aggregation method and device for network interruption and network communication equipment | |
CN101610172A (en) | A kind of mthods, systems and devices of reporting attack logs | |
CN108595370A (en) | A kind of multi-core processor and message processing method | |
CN105611406B (en) | One kind access net service provider monitors user to video server lag characteristic method |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20180907 |