CN103164663A - Overload protection method and device of server based on sliding window - Google Patents

Overload protection method and device of server based on sliding window Download PDF

Info

Publication number
CN103164663A
CN103164663A CN2011104122216A CN201110412221A CN103164663A CN 103164663 A CN103164663 A CN 103164663A CN 2011104122216 A CN2011104122216 A CN 2011104122216A CN 201110412221 A CN201110412221 A CN 201110412221A CN 103164663 A CN103164663 A CN 103164663A
Authority
CN
China
Prior art keywords
window
server
request
time period
current
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.)
Granted
Application number
CN2011104122216A
Other languages
Chinese (zh)
Other versions
CN103164663B (en
Inventor
姚明敏
娄继冰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Tencent Computer Systems Co Ltd
Original Assignee
Shenzhen Tencent Computer Systems Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Shenzhen Tencent Computer Systems Co Ltd filed Critical Shenzhen Tencent Computer Systems Co Ltd
Priority to CN201110412221.6A priority Critical patent/CN103164663B/en
Publication of CN103164663A publication Critical patent/CN103164663A/en
Application granted granted Critical
Publication of CN103164663B publication Critical patent/CN103164663B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses an overload protection method of a server based on a sliding window. The overload protection method of the server based on the sliding window comprises the following steps: the sliding window representing time period is arranged, and requests received by the server in a corresponding time period is recorded by the sliding window; the server receiving a new request is received by the server, current load conditions of the server are detected according to requests received by the server recorded in the sliding window, and whether processing the requests according to detected result is judged. The invention further provides an overload protection device of the server based on the sliding window. By adopting the technical scheme, influence of service burst traffic on the server can be excellently controlled based on overload controlling of the sliding window.

Description

A kind of server overload guard method and device based on moving window
Technical field
The present invention relates to the administrative skill of multi-services device, relate in particular to a kind of server overload guard method and device based on moving window.
Background technology
At present, a lot of technical research are being arranged aspect the load balancing of server cluster, still, in actual applications, server always is issued to the load upper limit at extreme case.Overload protection be used for to guarantee that exactly server still can work on reaching in load in limited time, and the handling capacity of keeping server is stable, the front end accident is not affected not to be delivered to server.
In existing server overload resist technology; proposing a plurality of workload manager of a kind of employing processes respectively different priorities and does not invite the method for asking: when server load reaches certain in limited time upper; the services request of refusal low priority is only processed the request of high priority.In the internet, applications of reality, except the control request that system's operation maintenance is sent, each user is the right equity, and their request all should have identical priority level.Therefore, said method can not clear correct partition request priority, can not play the effect of overload protection, can cause on the contrary the shake of server handling capacity.
Also have a kind of server overload guard method, the method is to drive and set about from optimizing network interface card, is the loading condition that parameters such as CPU usage, memory usage according to current machine are weighed server; If server surpasses load limitations, network interface card drives and refuses the request that all set up new TCP connection, alleviates server stress.Although this method can be alleviated server load to a certain extent, for the of short duration high access situation of burst, will cause the handling capacity shake of server.Simultaneously, take machine as controlling granularity, rather than service, this difference service meeting that will make same machine deploy is because some services cisco unity malfunction extremely and all.
Summary of the invention
In view of this, fundamental purpose of the present invention is to provide a kind of server overload guard method and device based on moving window, can control the impact of service control burst access amount on server preferably based on the overload of moving window.
For achieving the above object, technical scheme of the present invention is achieved in that
The invention provides a kind of server overload guard method based on moving window, comprising:
The moving window of expression time period is set;
The described moving window record request that in the corresponding time period, server receives;
When server was received new request, the current load condition of request detection server that the server that records according to moving window receives judged whether request is processed according to testing result.
In said method, the described moving window that the expression time period is set is: with the time virtual for a plurality of isometric windows, each window represents a time period;
The described moving window record request that in the corresponding time period, server receives is: the received request of server in the corresponding time period of described window record, and safeguard a current window scope, carry out the load detecting of single according to described current window scope, and after each load detecting, described current window scope is slided according to the variation of the time point of last load detecting.
In said method, the length of described time period is carried out dynamic-configuration according to different business demands, and described current window scope arranges according to the time-delay of the Internet request.
In said method, the method also comprises: according to the request content of different traffic performances for each window configuration record.
In said method, the described request content that is each window configuration record according to different traffic performances is:
For the service of Disk bandwidth consumption-type, window records the number of times of magnetic disc i/o in current slot;
For the service of CPU consumption-type, window records the clock periodicity that in current slot, accumulative total consumes;
For the service of network bandwidth consumption type, window records the flow in current slot.
In said method, the described current load condition of request detection server that receives according to the server of moving window record is:
The request that the server that records according to current moving window receives detects the new rear current load condition of server of request arrival; If last time point and this time point that detects load condition that detects load condition is positioned at same window, the counting in this window is added 1; If last time point and this time point that detects load condition that detects load condition is not to be positioned at same window, with the count value zero clearing in this window; After count value is processed, judge whether the count value in window surpasses the peak value of server process request.
In said method, describedly judge whether request is treated to according to testing result:
If the count value in window surpasses the peak value of server process request, refuse new request, server is not processed this request; If the count value in window does not surpass the peak value of server process request, server is processed this request.
The present invention also provides a kind of server overload protective device based on moving window, comprising: setting unit, moving window unit, receiving element, processing unit; Wherein,
Setting unit is for the moving window of expression time period;
The moving window unit is used for the record request that in the corresponding time period, server receives;
Receiving element, when being used for receiving new request, the current load condition of request detection server that the server that records according to moving window receives;
Processing unit is used for judging whether request is processed according to testing result.
In said apparatus, described setting unit also is used for, and according to the length of different business demand dynamic-configuration time periods, according to the time-delay of the Internet request, the current window scope is set.
In said apparatus, described setting unit also is used for, and is the request content of each window configuration record according to different traffic performances.
Server overload guard method and device based on moving window provided by the invention arrange the moving window that represents the time period, the described moving window record request that in the corresponding time period, server receives; When server is received new request, the current load condition of request detection server that the server that records according to moving window receives, judge whether request is processed according to testing result, like this, overload based on sliding window mechanism is controlled, the impact of service control burst access amount on server preferably; In addition, the present invention can also keep the handling capacity of server in certain level, avoids causing the shake of throughput of system.
Description of drawings
Fig. 1 is that the present invention realizes the schematic flow sheet based on the server overload guard method of moving window;
Fig. 2 is the exemplary plot of moving window of the present invention;
Fig. 3 is that the present invention realizes the structural representation based on the server overload protective device of moving window.
Embodiment
Basic thought of the present invention is: the moving window of expression time period is set, the described moving window record request that in the corresponding time period, server receives; When server was received new request, the current load condition of request detection server that the server that records according to moving window receives judged whether request is processed according to testing result.
Below by drawings and the specific embodiments, the present invention is described in further detail again.
The invention provides a kind of server overload guard method based on moving window, Fig. 1 is that the present invention realizes that as shown in Figure 1, the method comprises the following steps based on the schematic flow sheet of the server overload guard method of moving window:
Step 101 arranges the moving window that represents the time period, and this moving window records the request that in this time period, server receives;
Concrete, as shown in Figure 2, the direction of the time shaft of arrow indication in Fig. 2 invents a plurality of isometric windows with time of passage, and each virtual window represents a time period; Wherein, the length of described time period can be come dynamic-configuration according to different business demands, for example, can be 1ms, can be also 1s etc., and the length of time period is less, more can be described in accurately the load condition of the real server in certain time period, have more real-time.
the interior received request of server of the time period that the window record is corresponding, but the request in not every window all can be used as the foundation that detects load condition, because the correlativity between the visit capacity of each time period of internet is less, the request that server before a period of time receives is disposed, can't cause the load of server, therefore, only need to come according to the access times of nearest time period the loading condition of evaluating server, that is: only need to safeguard a current window scope, this current window scope is in whole time shaft, can provide foundation for the load detecting of single, the current window scope can be set according to the time-delay of the Internet request.For example, the current window scope has 100 grid, and the time span of each grid is 1 second, so, each load detecting all will be used over all of 100 seconds and be recorded as foundation, utilize this scheme, can avoid the shake of the whole server handling capacity that causes because of the shake in single window; As shown in Figure 2, t1 represents the time point of last load detecting, and after each load detecting, window can slide along time-axis direction according to the variation of t1, and therefore, above-mentioned window is moving window.
Based on the overload protection scheme of hardware driving layer, the overload protection granularity is entire machine, may make in this case the difference service meeting of same machine deploy because some services cisco unity malfunction extremely and all.Such as in particular moment, the consumptive services consume of some Disk bandwidths a large amount of Disk bandwidths reach set upper limit, the TCP that network interface card is just no longer accepted other this moment connects, and refusal is service externally, in fact still should be processed for the consumptive service of CPU.Therefore lack enough dirigibilities.
And based on the overload protection scheme of moving window, except can carrying out single window scope and the single window dynamic-configuration of corresponding time period, can also be the request content of each window configuration record according to different traffic performances, for example, service for the Disk bandwidth consumption-type, window can record the number of times of magnetic disc i/o in current slot, service for the CPU consumption-type, window can record the clock periodicity that in current slot, accumulative total consumes, for the business of network bandwidth consumption type, window can record the flow in current slot; By being the request content of each window configuration record flexibly, can carry out the strategy of different overload protections according to different services, realize take service as the overload protection granularity.
When step 102, server were received new request, the request that the server that records according to current moving window receives detected the current load condition of server, judges whether request is processed according to testing result;
Concrete, each window can record the access times in the corresponding time period, detects the number of times of load condition that is:, because each detection load condition is after server receives request, therefore, the quantity of the request of server reception just equals to detect the number of times of load;
When server is received new request, at first the request that the server that records according to current moving window receives, detect the new rear current load condition of server of request arrival, if last time point and this time point that detects load condition that detects load condition is positioned at same window, the counting in this window is added 1; After count value is processed, further, judge whether the count value in window surpasses the peak value of server process request, if surpass, refuse current request, that is: receive only request, but do not process this request; If be no more than, server is processed this request;
If last time point and this time point that detects load condition that detects load condition is not to be positioned at same window, with the count value zero clearing in this window, because the request that before this detection load condition, server receives can not reflect the load condition that server is current; After count value is carried out the zero clearing processing, further, judge whether the count value in window surpasses the peak value of server process request, if surpass, refusal request specifically, if be no more than, server is processed this request.
In the present invention, when the load of server surpasses the request that server can bear, at most after the time through a window, server just can be processed a certain amount of request normally, if the corresponding time period of window is shorter, take millisecond as unit, the performance that is reflected in operation layer is exactly that server has been refused some request in a large amount of requests, and the handling capacity of server can be constant in a scope, rather than the uprush shake form of anticlimax of handling capacity.
For realizing said method, the present invention also provides a kind of server overload protective device based on moving window, Fig. 3 is that the present invention realizes the structural representation based on the server overload protective device of moving window, as shown in Figure 3, this device comprises: setting unit 31, moving window unit 32, receiving element 33, processing unit 34; Wherein,
Setting unit 31 is for the moving window of expression time period;
Moving window unit 32 is used for the record request that in the corresponding time period, server receives;
Receiving element 33, when being used for receiving new request, the current load condition of request detection server that the server that records according to moving window receives;
Processing unit 34 is used for judging whether request is processed according to testing result.
Described setting unit 31 also is used for, and according to the length of different business demand dynamic-configuration time periods, according to the time-delay of the Internet request, the current window scope is set.
Described setting unit 31 also is used for, and is the request content of each window configuration record according to different traffic performances.
The moving window that described setting unit 31 arranges the expression time period is: with the time virtual for a plurality of isometric windows, each window represents a time period;
The 32 record requests that in the corresponding time period, server receives of described moving window unit are: the received request of server in the corresponding time period of described window record, and safeguard a current window scope, carry out the load detecting of single according to described current window scope, and after each load detecting, described current window scope is slided according to the variation of the time point of last load detecting.
The request content that described setting unit 31 is each window configuration record according to different traffic performances is: for the service of Disk bandwidth consumption-type, window records the number of times of magnetic disc i/o in current slot; For the service of CPU consumption-type, window records the clock periodicity that in current slot, accumulative total consumes; For the service of network bandwidth consumption type, window records the flow in current slot.
The current load condition of request detection server that the server that described receiving element 33 records according to moving window receives is: the request that the server that records according to current moving window receives, detect the new rear current load condition of server of request arrival; If last time point and this time point that detects load condition that detects load condition is positioned at same window, the counting in this window is added 1; If last time point and this time point that detects load condition that detects load condition is not to be positioned at same window, with the count value zero clearing in this window; After count value is processed, further, judge whether the count value in window surpasses the peak value of server process request.
Accordingly, described processing unit 34 judges whether request is treated to according to testing result: if the count value in window surpasses the peak value of server process request, refuse new request, this request is not processed; If the count value in window does not surpass the peak value of server process request, this request is processed.
Technical scheme of the present invention can be applied to the applicant from the magnanimity distributed memory system TFS of development, carry numerous business datums in this system, the operation of the stable business to carrying of TFS server is most important, utilize technique scheme can help the TFS server to avoid front-end business abnormal access situation on the impact of server, thereby improve the stability of server.
The above is only preferred embodiment of the present invention, is not for limiting protection scope of the present invention, all any modifications of doing within the spirit and principles in the present invention, is equal to and replaces and improvement etc., within all should being included in protection scope of the present invention.

Claims (10)

1. the server overload guard method based on moving window, is characterized in that,
The moving window of expression time period is set;
The described moving window record request that in the corresponding time period, server receives;
When server was received new request, the current load condition of request detection server that the server that records according to moving window receives judged whether request is processed according to testing result.
2. method according to claim 1, is characterized in that, the described moving window that the expression time period is set is: with the time virtual for a plurality of isometric windows, each window represents a time period;
The described moving window record request that in the corresponding time period, server receives is: the received request of server in the corresponding time period of described window record, and safeguard a current window scope, carry out the load detecting of single according to described current window scope, and after each load detecting, described current window scope is slided according to the variation of the time point of last load detecting.
3. method according to claim 2, is characterized in that, the length of described time period is carried out dynamic-configuration according to different business demands, and described current window scope arranges according to the time-delay of the Internet request.
4. according to claim 2 or 3 described methods, is characterized in that, the method also comprises: according to the request content of different traffic performances for each window configuration record.
5. method according to claim 4, is characterized in that, the described request content that is each window configuration record according to different traffic performances is:
For the service of Disk bandwidth consumption-type, window records the number of times of magnetic disc i/o in current slot;
For the service of CPU consumption-type, window records the clock periodicity that in current slot, accumulative total consumes;
For the service of network bandwidth consumption type, window records the flow in current slot.
6. method according to claim 1, is characterized in that, the described current load condition of request detection server that receives according to the server of moving window record is:
The request that the server that records according to current moving window receives detects the new rear current load condition of server of request arrival; If last time point and this time point that detects load condition that detects load condition is positioned at same window, the counting in this window is added 1; If last time point and this time point that detects load condition that detects load condition is not to be positioned at same window, with the count value zero clearing in this window; After count value is processed, judge whether the count value in window surpasses the peak value of server process request.
7. method according to claim 6, is characterized in that, describedly judges whether request is treated to according to testing result:
If the count value in window surpasses the peak value of server process request, refuse new request, server is not processed this request; If the count value in window does not surpass the peak value of server process request, server is processed this request.
8. the server overload protective device based on moving window, is characterized in that, this device comprises: setting unit, moving window unit, receiving element, processing unit; Wherein,
Setting unit is for the moving window of expression time period;
The moving window unit is used for the record request that in the corresponding time period, server receives;
Receiving element, when being used for receiving new request, the current load condition of request detection server that the server that records according to moving window receives;
Processing unit is used for judging whether request is processed according to testing result.
9. device according to claim 8, is characterized in that, described setting unit also is used for, and according to the length of different business demand dynamic-configuration time periods, according to the time-delay of the Internet request, the current window scope is set.
10. device according to claim 9, is characterized in that, described setting unit also is used for, and is the request content of each window configuration record according to different traffic performances.
CN201110412221.6A 2011-12-12 2011-12-12 A kind of server overload guard method based on sliding window and device Active CN103164663B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110412221.6A CN103164663B (en) 2011-12-12 2011-12-12 A kind of server overload guard method based on sliding window and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110412221.6A CN103164663B (en) 2011-12-12 2011-12-12 A kind of server overload guard method based on sliding window and device

Publications (2)

Publication Number Publication Date
CN103164663A true CN103164663A (en) 2013-06-19
CN103164663B CN103164663B (en) 2016-06-29

Family

ID=48587739

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110412221.6A Active CN103164663B (en) 2011-12-12 2011-12-12 A kind of server overload guard method based on sliding window and device

Country Status (1)

Country Link
CN (1) CN103164663B (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105471614A (en) * 2014-09-11 2016-04-06 腾讯科技(深圳)有限公司 Overload protection method and device and server
CN106227765A (en) * 2016-07-13 2016-12-14 广州唯品会网络技术有限公司 The implementation method that time window is accumulative
CN106656840A (en) * 2016-11-25 2017-05-10 杭州安恒信息技术有限公司 Dynamic flow control method for web crawler
CN108694074A (en) * 2017-04-07 2018-10-23 腾讯科技(深圳)有限公司 A kind of method and server obtaining count information
CN109408229A (en) * 2018-09-30 2019-03-01 华为技术有限公司 A kind of dispatching method and device
CN109981553A (en) * 2017-12-28 2019-07-05 北京京东尚科信息技术有限公司 Access control method and its system, computer system and readable storage medium storing program for executing
WO2021018058A1 (en) * 2019-07-31 2021-02-04 中兴通讯股份有限公司 System overload control method and device
CN112685169A (en) * 2019-10-17 2021-04-20 腾讯科技(深圳)有限公司 Load control method, device, server and readable storage medium
CN113949516A (en) * 2021-09-22 2022-01-18 杭州海兴泽科信息技术有限公司 Unified authentication licensing method and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5784647A (en) * 1994-12-19 1998-07-21 Nec Corporation Interface for fetching highest priority demand from priority queue, predicting completion within time limitation then issuing demand, else adding demand to pending queue or canceling
CN101699860A (en) * 2009-10-21 2010-04-28 南京邮电大学 Implement method for mixing network TV stream media server of peer-to-peer computing network
CN102264118A (en) * 2010-05-25 2011-11-30 中兴通讯股份有限公司 Method and device for realizing accessing MTC (machine-type communication) terminal

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5784647A (en) * 1994-12-19 1998-07-21 Nec Corporation Interface for fetching highest priority demand from priority queue, predicting completion within time limitation then issuing demand, else adding demand to pending queue or canceling
CN101699860A (en) * 2009-10-21 2010-04-28 南京邮电大学 Implement method for mixing network TV stream media server of peer-to-peer computing network
CN102264118A (en) * 2010-05-25 2011-11-30 中兴通讯股份有限公司 Method and device for realizing accessing MTC (machine-type communication) terminal

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105471614A (en) * 2014-09-11 2016-04-06 腾讯科技(深圳)有限公司 Overload protection method and device and server
CN106227765B (en) * 2016-07-13 2019-09-06 广州唯品会网络技术有限公司 The accumulative implementation method of time window
CN106227765A (en) * 2016-07-13 2016-12-14 广州唯品会网络技术有限公司 The implementation method that time window is accumulative
CN106656840A (en) * 2016-11-25 2017-05-10 杭州安恒信息技术有限公司 Dynamic flow control method for web crawler
CN106656840B (en) * 2016-11-25 2019-11-08 杭州安恒信息技术股份有限公司 A kind of dynamic flow control method applied to web crawlers
CN108694074A (en) * 2017-04-07 2018-10-23 腾讯科技(深圳)有限公司 A kind of method and server obtaining count information
CN109981553A (en) * 2017-12-28 2019-07-05 北京京东尚科信息技术有限公司 Access control method and its system, computer system and readable storage medium storing program for executing
CN109981553B (en) * 2017-12-28 2021-12-31 北京京东尚科信息技术有限公司 Access control method, system thereof, computer system, and readable storage medium
CN109408229A (en) * 2018-09-30 2019-03-01 华为技术有限公司 A kind of dispatching method and device
CN109408229B (en) * 2018-09-30 2021-06-04 华为技术有限公司 Scheduling method and device
WO2021018058A1 (en) * 2019-07-31 2021-02-04 中兴通讯股份有限公司 System overload control method and device
CN112685169A (en) * 2019-10-17 2021-04-20 腾讯科技(深圳)有限公司 Load control method, device, server and readable storage medium
CN112685169B (en) * 2019-10-17 2023-06-23 腾讯科技(深圳)有限公司 Load control method, device, server and readable storage medium
CN113949516A (en) * 2021-09-22 2022-01-18 杭州海兴泽科信息技术有限公司 Unified authentication licensing method and system

Also Published As

Publication number Publication date
CN103164663B (en) 2016-06-29

Similar Documents

Publication Publication Date Title
CN103164663A (en) Overload protection method and device of server based on sliding window
US9686352B2 (en) Saturation detection and admission control for storage devices
CN102144220B (en) Distributed data processing system
EP2758877B1 (en) Bandwidth throttling of virtual disks
CN103890714B (en) It is related to the system and method that the main frame of the resource pool based on cluster perceives resource management
US8863127B2 (en) Virtual machine utility computing method and system
CN104102543B (en) The method and apparatus of adjustment of load in a kind of cloud computing environment
US20170155560A1 (en) Management systems for managing resources of servers and management methods thereof
Norris et al. OnCall: Defeating spikes with a free-market application cluster
WO2006007415A2 (en) Nonlinear adaptive control of resource-distribution dynamics
US8612578B2 (en) Forecast-less service capacity management
CN106326068A (en) Resource index monitoring method and device
US20170187790A1 (en) Ranking system
CN115269108A (en) Data processing method, device and equipment
Tian et al. Optimal contract for machine repair and maintenance
CN109120424B (en) Bandwidth scheduling method and device
CN108989387A (en) Control the method, device and equipment of Asynchronous Request
Escheikh et al. Performability evaluation of server virtualized systems under bursty workload
US9922298B2 (en) System and method for determining optimal asset configurations while minimizing disruption to existing business operations in a service delivery environment
US20190073288A1 (en) Performance management system, management device, and performance management method
Yan et al. Busy bee: how to use traffic information for better scheduling of background tasks
JP2008003736A (en) Method of warning shortage of computer resource
Chang et al. Dynamic scheduling of a multiclass fluid model with transient overload
Huang et al. A prediction based server cluster capacity planning strategy
US11416288B2 (en) Method, device and computer program product for service management

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant