CN103164663B - A kind of server overload guard method based on sliding window and device - Google Patents

A kind of server overload guard method based on sliding window and device Download PDF

Info

Publication number
CN103164663B
CN103164663B CN201110412221.6A CN201110412221A CN103164663B CN 103164663 B CN103164663 B CN 103164663B CN 201110412221 A CN201110412221 A CN 201110412221A CN 103164663 B CN103164663 B CN 103164663B
Authority
CN
China
Prior art keywords
server
sliding window
request
current
record
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.)
Active
Application number
CN201110412221.6A
Other languages
Chinese (zh)
Other versions
CN103164663A (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

Abstract

A kind of server overload guard method based on sliding window of disclosure, including: the sliding window of express time section is set, the request that described sliding window record correspondence time period server receives;When server receives new request, the load condition that the request detection server that receives according to the server of sliding window record is current, judge whether request is processed according to testing result;The present invention also provides for a kind of server overload based on sliding window and protects device.According to technical scheme, it is possible to the premature beats based on sliding window controls the impact on server of the business burst visit capacity preferably.

Description

A kind of server overload guard method based on sliding window and device
Technical field
The present invention relates to the management technique of multi-services device, particularly relate to a kind of server overload guard method based on sliding window and device.
Background technology
At present, in the load balancing of server cluster, there is a lot of technical research, but, in actual applications, server always reaches upper loading limit in extreme circumstances.Overload protection is used for ensureing that server remains able to when reaching upper loading limit work on exactly, and the handling capacity maintaining server is stable, accident impact in front end is not delivered to server.
In existing server overload resist technology, it is proposed to the multiple workload manager of a kind of employing process the other requesting method of different priorities respectively: when server load reaches certain upper limit, the service request of refusal low priority, only process the request of high priority.In actual internet, applications, except system operation safeguards the control request sent, each user is right equity, and their request all should have identical priority level.Therefore, the partition request priority that said method can not be clearly correct, can not play the effect of overload protection, can cause that Server throughput is shaken on the contrary.
Also having a kind of server overload guard method, the method is to set about from optimization trawl performance, is the loading condition weighing server according to parameters such as the CPU usage of current machine, memory usages;If server exceedes load restriction, then trawl performance refuses the new TCP of all foundation request connected, and alleviates server stress.Although this method can alleviate server load to a certain extent, but for the of short duration high access situation of burst, it will cause the handling capacity of server to shake.Meanwhile, with machine for Control granularity, rather than servicing, this will make the different services of same machine upper portion administration can service extremely and all cisco unity malfunctions because of some.
Summary of the invention
In view of this, present invention is primarily targeted at a kind of server overload guard method based on sliding window of offer and device, it is possible to the premature beats based on sliding window controls the impact on server of the business burst visit capacity preferably.
For reaching above-mentioned purpose, the technical scheme is that and be achieved in that:
The present invention provides a kind of server overload guard method based on sliding window, including:
The sliding window of express time section is set;
The request that described sliding window record correspondence time period server receives;
When server receives new request, the load condition that the request detection server that receives according to the server of sliding window record is current, judge whether request is processed according to testing result.
In said method, described express time section is set sliding window be: by virtual for the time for multiple isometric windows, each window represents a time period;
The request that described sliding window record correspondence time period server receives is: the request received by described window record correspondence time period server, and safeguard a current window scope, the load detecting of single is carried out according to described current window scope, and every time after load detecting, described current window scope is slided according to the change of the time point of last load detecting.
In said method, the length of described time period dynamically configures according to different business demands, and described current window scope is configured according to the time delay of the Internet request.
In said method, the method also includes: according to the request content that different traffic performances is each window configuration record.
In said method, described according to different traffic performances be each window configuration record request content be:
For the service of Disk bandwidth consumption-type, the number of times of magnetic disc i/o in window record current slot;
For the service of CPU consumption-type, the accumulative clock periodicity consumed in window record current slot;
For the service of network bandwidth consumption type, the flow in window record current slot.
In said method, the current load condition of request detection server that the described server according to sliding window record receives is:
The request that server according to current sliding window mouth record receives, detects the load condition that after new request arrives, server is current;If the time point of last detection load condition is positioned at same window with this time point detecting load condition, then the counting in this window is added 1;If the time point of last detection load condition is not located in same window with this time point detecting load condition, the count value in this window is reset;After count value is processed, it is judged that whether the count value in window exceedes the peak value of server processing requests.
In said method, described judge whether that request is carried out process is according to testing result:
If the count value in window exceedes the peak value of server processing requests, refusing new request, this request is not processed by server;If the count value in window is not above the peak value of server processing requests, this request is processed by server.
The present invention also provides for a kind of server overload based on sliding window and protects device, including: unit, sliding window unit are set, receive unit, processing unit;Wherein,
Unit is set, for the sliding window of express time section;
Sliding window unit, for recording the request that corresponding time period server receives;
Receive unit, during for receiving new request, the load condition that the request detection server that receives according to the server of sliding window record is current;
Processing unit, for judging whether request is processed according to testing result.
In said apparatus, the described unit that arranges is additionally operable to, the length according to different business demand sections dynamic setup time, arranges current window scope according to the time delay of the Internet request.
In said apparatus, the described unit that arranges is additionally operable to, according to the request content that different traffic performances is each window configuration record.
Server overload guard method based on sliding window provided by the invention and device, arrange the sliding window of express time section, the request that described sliding window record correspondence time period server receives;When server receives new request, the load condition that request detection server that server according to sliding window record receives is current, judge whether request is processed according to testing result, so, premature beats based on sliding window mechanism, it is possible to control the impact on server of the business burst visit capacity preferably;Additionally, the present invention can also maintain the handling capacity of server in certain level, it is to avoid cause the shake of throughput of system.
Accompanying drawing explanation
Fig. 1 is the schematic flow sheet that the present invention realizes the server overload guard method based on sliding window;
Fig. 2 is the exemplary plot of sliding window of the present invention;
Fig. 3 is the structural representation that the present invention realizes protecting device based on the server overload of sliding window.
Detailed description of the invention
The basic thought of the present invention is: arrange the sliding window of express time section, the request that described sliding window record correspondence time period server receives;When server receives new request, the load condition that the request detection server that receives according to the server of sliding window record is current, judge 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 present invention provides a kind of server overload guard method based on sliding window, and Fig. 1 is the schematic flow sheet that the present invention realizes the server overload guard method based on sliding window, as it is shown in figure 1, the method comprises the following steps:
Step 101, arranges the sliding window of express time section, the request that this time period server of this sliding window record receives;
Concrete, as in figure 2 it is shown, along the direction of the time shaft of arrow indication in Fig. 2, invent multiple isometric window the time of passage, each virtual window represents a time period;Wherein, the length of described time period dynamically can configure according to different business demands, for instance, can being 1ms, it is also possible to be 1s etc., the length of time period be more little, more can describe the load condition of real server within certain time period accurately, have more real-time.
The request received by a time period server that window record is corresponding, but the request in not every window all can be used as the foundation of detection load condition, because the dependency between the visit capacity of each time period of the Internet is less, the request that server before a period of time receives is disposed, the load of server can't be caused, therefore, have only to the access times according to the nearest time period and carry out the loading condition of evaluating server, that is: have only to safeguard a current window scope, this current window scope is in whole time shaft, foundation can be provided for the load detecting of single, current window scope can be set according to the time delay of the Internet request.Such as, current window scope has 100 grid, and the time span of each grid is 1 second, so, each load detecting all using use 100 seconds in the past all records as foundation, utilize the program, it is possible to avoid because the shake of whole Server throughput that causes of the shake in single window;As in figure 2 it is shown, t1 represents the time point of last load detecting, after each load detecting, window can slide along time-axis direction according to the change of t1, and therefore, above-mentioned window is sliding window.
Based on the overload protection scheme of hardware driving layer, overload protection granularity is entire machine, and the different services so that same machine upper portion administration that are in this case likely to can because some services extremely and all cisco unity malfunctions.Such as in particular moment, the consumptive service of some Disk bandwidth consumes substantial amounts of Disk bandwidth and reaches the upper limit of regulation, network interface card now just no longer accepts other TCP and connects, and refusal is service externally, still should be processed in practice for the consumptive service of CPU.Therefore enough motilities are lacked.
And based on the overload protection scheme of sliding window; except the dynamically configuration that can carry out the single window scope time period corresponding to single window; can also according to the request content that different traffic performances is each window configuration record; such as; service for Disk bandwidth consumption-type; window can record the number of times of magnetic disc i/o in current slot; service for CPU consumption-type; window can record the accumulative clock periodicity consumed in current slot; 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, it is possible to carry out the strategy of different overload protections according to different services, it is achieved with service for overload protection granularity.
Step 102, when server receives new request, according to the request that the server of current sliding window mouth record receives, the load condition that detection server is current, judges whether request is processed according to testing result;
Concrete, each window can record the access times in the corresponding time period, it may be assumed that the number of times of detection load condition, is after server receives request owing to detecting load condition every time, and therefore, the quantity of the request that server receives is equal to the number of times of detection load;
When server receives new request, first the request received according to the server of current sliding window mouth record, detect the load condition that after new request arrives, server is current, if the time point of last detection load condition is positioned at same window with this time point detecting load condition, then the counting in this window is added 1;After count value is processed, further, it is judged that whether the count value in window exceedes the peak value of server processing requests, if it does, then refuse current request, it may be assumed that only receive request, but do not process this request;If less than, then this request is processed by server;
If the time point of last detection load condition is not located in same window with this time point detecting load condition, then the count value in this window is reset, because server received request before this detection load condition, the load condition that server is current can not be reflected;After count value is zeroed out process, further, it is judged that whether the count value in window exceedes the peak value of server processing requests, if it does, the then current request of refusal, if less than, then this request is processed by server.
In the present invention, when the load of server exceedes the request that server can be born, at most after the time of a window, server just can process a certain amount of request normally, if a window correspondence time period is comparatively short, in units of millisecond, the performance being reflected in operation layer is exactly some request that server have rejected in substantial amounts of request, and the handling capacity of server can be constant within the scope of one, rather than handling capacity is uprushed the shake form of anticlimax.
For realizing said method; the present invention also provides for a kind of server overload based on sliding window and protects device; Fig. 3 is the structural representation that the present invention realizes protecting device based on the server overload of sliding window; as it is shown on figure 3, this device includes: arrange unit 31, sliding window unit 32, receive unit 33, processing unit 34;Wherein,
Unit 31 is set, for the sliding window of express time section;
Sliding window unit 32, for recording the request that corresponding time period server receives;
Receive unit 33, during for receiving new request, the load condition that the request detection server that receives according to the server of sliding window record is current;
Processing unit 34, for judging whether request is processed according to testing result.
The described unit 31 that arranges is additionally operable to, the length according to different business demand sections dynamic setup time, arranges current window scope according to the time delay of the Internet request.
The described unit 31 that arranges is additionally operable to, according to the request content that different traffic performances is each window configuration record.
The described unit 31 that arranges arranges the sliding window of express time section and is: by virtual for the time for multiple isometric windows, each window represents a time period;
Described sliding window unit 32 records the request of corresponding time period server reception: the request received by described window record correspondence time period server, and safeguard a current window scope, the load detecting of single is carried out according to described current window scope, and every time after load detecting, described current window scope is slided according to the change of the time point of last load detecting.
The described unit 31 that arranges according to the request content that different traffic performances is each window configuration record is: for the service of Disk bandwidth consumption-type, the number of times of magnetic disc i/o in window record current slot;For the service of CPU consumption-type, the accumulative clock periodicity consumed in window record current slot;For the service of network bandwidth consumption type, the flow in window record current slot.
The current load condition of request detection server that described reception unit 33 receives according to the server of sliding window record is: the request received according to the server of current sliding window mouth record, detects the load condition that after new request arrives, server is current;If the time point of last detection load condition is positioned at same window with this time point detecting load condition, then the counting in this window is added 1;If the time point of last detection load condition is not located in same window with this time point detecting load condition, the count value in this window is reset;After count value is processed, further, it is judged that whether the count value in window exceedes the peak value of server processing requests.
Accordingly, according to testing result, described processing unit 34 judges whether that request is carried out process is: if the count value in window exceedes the peak value of server processing requests, refuses new request, this request is not processed;If the count value in window is not above the peak value of server processing requests, this request is processed.
Technical scheme can be applied to applicant from the magnanimity distributed memory system TFS developed, this system carries numerous business datums, the stable operation to the business of carrying of TFS server is most important, utilize technique scheme that TFS server can be helped to avoid the impact on server of the front-end business abnormal access situation, thus improving the stability of server.
The above, be only presently preferred embodiments of the present invention, is not intended to limit protection scope of the present invention, all any amendment, equivalent replacement and improvement etc. made within the spirit and principles in the present invention, should be included within protection scope of the present invention.

Claims (10)

1. the server overload guard method based on sliding window, it is characterised in that
The sliding window of express time section is set;
The request that described sliding window record correspondence time period server receives;
When server receives new request, the load condition that the request detection server that receives according to the server of sliding window record is current, judge whether request is processed according to testing result;
Wherein, the load condition that request detection server that the described server according to sliding window record receives is current, including:
The loading condition that described server is current is judged according to the described sliding window number of requests that the server of record receives within the corresponding time period.
2. method according to claim 1, it is characterised in that described express time section is set sliding window be: by virtual for the time for multiple isometric sliding windows, each sliding window represents a time period;
The request that described sliding window record correspondence time period server receives is: the request received by described sliding window record correspondence time period server, and safeguard a current window scope, the load detecting of single is carried out according to described current window scope, and every time after load detecting, described current window scope is slided according to the change of the time point of last load detecting.
3. method according to claim 2, it is characterised in that the length of described time period dynamically configures according to different business demands, described current window scope is configured according to the time delay of the Internet request.
4. according to the method in claim 2 or 3, it is characterised in that the method also includes: according to the request content that different traffic performances is each sliding window configuration record.
5. method according to claim 4, it is characterised in that described according to different traffic performances be each sliding window configuration record request content be:
For the service of Disk bandwidth consumption-type, the number of times of magnetic disc i/o in sliding window record current slot;
For the service of CPU consumption-type, the accumulative clock periodicity consumed in sliding window record current slot;
For the service of network bandwidth consumption type, the flow in sliding window record current slot.
6. method according to claim 1, it is characterised in that the current load condition of request detection server that the described server according to sliding window record receives is:
The request that server according to current sliding window mouth record receives, detects the load condition that after new request arrives, server is current;If the time point of last detection load condition is positioned at same sliding window with this time point detecting load condition, then the counting in this sliding window is added 1;If the time point of last detection load condition is not located in same sliding window with this time point detecting load condition, the count value in this sliding window is reset;After count value is processed, it is judged that whether the count value in sliding window exceedes the peak value of server processing requests.
7. method according to claim 6, it is characterised in that described judge whether that request is carried out process is according to testing result:
If the count value in sliding window exceedes the peak value of server processing requests, refusing new request, this request is not processed by server;If the count value in sliding window is not above the peak value of server processing requests, this request is processed by server.
8. the server overload based on sliding window protects device, it is characterised in that this device includes: arranges unit, sliding window unit, receive unit, processing unit;Wherein,
Unit is set, for the sliding window of express time section;
Sliding window unit, for recording the request that corresponding time period server receives;
Receive unit, during for receiving new request, the load condition that the request detection server that receives according to the server of sliding window record is current;
Processing unit, for judging whether request is processed according to testing result;
Wherein, the load condition that request detection server that described reception unit receives according to the server of sliding window record is current, including: judge, according to the described sliding window number of requests that the server of record receives within the corresponding time period, the loading condition that described server is current.
9. device according to claim 8, it is characterised in that the described unit that arranges is additionally operable to, the length according to different business demand sections dynamic setup time, according to the time delay of the Internet request, current window scope is set.
10. device according to claim 9, it is characterised in that the described unit that arranges is additionally operable to, according to the request content that different traffic performances is each sliding window configuration record.
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 CN103164663A (en) 2013-06-19
CN103164663B true 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)

Families Citing this family (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
CN106227765B (en) * 2016-07-13 2019-09-06 广州唯品会网络技术有限公司 The accumulative implementation method of time window
CN106656840B (en) * 2016-11-25 2019-11-08 杭州安恒信息技术股份有限公司 A kind of dynamic flow control method applied to web crawlers
CN108694074B (en) * 2017-04-07 2023-04-07 腾讯科技(深圳)有限公司 Method for acquiring counting information and server
CN109981553B (en) * 2017-12-28 2021-12-31 北京京东尚科信息技术有限公司 Access control method, system thereof, computer system, and readable storage medium
CN109408229B (en) * 2018-09-30 2021-06-04 华为技术有限公司 Scheduling method and device
CN112308354A (en) * 2019-07-31 2021-02-02 中兴通讯股份有限公司 System overload control method and device
CN112685169B (en) * 2019-10-17 2023-06-23 腾讯科技(深圳)有限公司 Load control method, device, server and readable storage medium
CN113949516B (en) * 2021-09-22 2023-07-18 杭州海兴泽科信息技术有限公司 Unified authentication permission method, system and storage medium

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

Also Published As

Publication number Publication date
CN103164663A (en) 2013-06-19

Similar Documents

Publication Publication Date Title
CN103164663B (en) A kind of server overload guard method based on sliding window and device
CN102144220B (en) Distributed data processing system
CN108090225B (en) Database instance running method, device and system and computer readable storage medium
US9686352B2 (en) Saturation detection and admission control for storage devices
CN106790726B (en) Priority queue dynamic feedback load balancing resource scheduling method based on Docker cloud platform
Harlap et al. Tributary: spot-dancing for elastic services with latency {SLOs}
CN104396200B (en) Ensure predictable and quantifiable networking performance
US9037505B2 (en) Mechanisms for executing a process in a cloud computing environment
US7472159B2 (en) System and method for adaptive admission control and resource management for service time guarantees
CN104102543B (en) The method and apparatus of adjustment of load in a kind of cloud computing environment
US8898295B2 (en) Achieving endpoint isolation by fairly sharing bandwidth
CA2915996C (en) Burst mode control
US10764185B2 (en) Token-based policies burst-mode operations
Wierman et al. Scheduling despite inexact job-size information
CN109194539A (en) Data management-control method, device, computer equipment and storage medium
EP2661690A2 (en) Seamless scaling of enterprise applications
CN102279771A (en) Method and system for adaptively allocating resources as required in virtualization environment
Antonescu et al. Dynamic SLA management with forecasting using multi-objective optimization
US20170187790A1 (en) Ranking system
Chen et al. Overload control in QoS-aware web servers
CN114726862A (en) Method and system for determining operation state of computing node based on state monitoring chip
CN109117280A (en) The method that is communicated between electronic device and its limiting process, storage medium
Sabin et al. Unfairness metrics for space-sharing parallel job schedulers
Çavdar et al. Quantifying the brown side of priority schedulers: Lessons from big clusters
Panneerselvam et al. Latency-aware empirical analysis of the workloads for reducing excess energy consumptions at cloud datacentres

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