CN106375150A - Disconnection control method and device for server - Google Patents

Disconnection control method and device for server Download PDF

Info

Publication number
CN106375150A
CN106375150A CN201610791101.4A CN201610791101A CN106375150A CN 106375150 A CN106375150 A CN 106375150A CN 201610791101 A CN201610791101 A CN 201610791101A CN 106375150 A CN106375150 A CN 106375150A
Authority
CN
China
Prior art keywords
request
link information
service instance
service
default
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
Application number
CN201610791101.4A
Other languages
Chinese (zh)
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.)
Guangzhou Pinwei Software Co Ltd
Original Assignee
Guangzhou Vipshop Information And Technology 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 Guangzhou Vipshop Information And Technology Co Ltd filed Critical Guangzhou Vipshop Information And Technology Co Ltd
Priority to CN201610791101.4A priority Critical patent/CN106375150A/en
Publication of CN106375150A publication Critical patent/CN106375150A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • H04L43/0811Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking connectivity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/143Termination or inactivation of sessions, e.g. event-controlled end of session

Abstract

The invention discloses a disconnection control method for a server. The method comprises the steps of obtaining link information of a service instance in a detection cycle; judging whether the link information satisfies a preset disconnection condition or not; and stopping forwarding a service request to the service instance after the link information satisfies the preset disconnection condition. The invention also discloses a disconnection control device for the server. According to the method, the existing problem that after the connection between a client and a server is established, the service instance is slow in response, the service request cannot be responded timely, so the service experience is poor is solved; the service request is responded timely; and the service experience is improved.

Description

The disconnection control method of server and device
Technical field
The present invention relates to the disconnection control method in server technology field, more particularly, to server and device.
Background technology
Development with business and variation, the service request that client is initiated also becomes many therewith.When business service relies on Resource go wrong, slow-response, seemingly-dead or even no response situation in some Service Instances.And ask for above-mentioned at present Topic, may proceed to service request is forwarded on this Service Instance, the machine until this Service Instance is delayed.Therefore, current client and clothes The connection establishment at business end is slow because solving service instance response in time, leads to service request to respond not in time so that business body Test difference.
The above is only used for auxiliary and understands technical scheme, does not represent and recognizes that the above is existing skill Art.
Content of the invention
Present invention is primarily targeted at a kind of disconnection control method of server of offer and device are it is intended to solve visitor at present Family end is slow because solving service instance response in time with the connection establishment of service end, leads to service request to respond not in time, makes Obtain the problem of business experience difference.
For achieving the above object, the disconnection control method of a kind of server that the present invention provides, including step:
Obtain link information in a detection cycle for the Service Instance;
Judge whether described link information meets default disconnection condition;
After described link information meets default disconnection condition, stop forwarding service request to described Service Instance.
Preferably, described judge whether described link information meets default disconnection condition and include:
The quantity that break links request occurs is extracted from described link information;
When the quantity of described break links is more than default first amount threshold, judge whether described link information meets Default disconnection condition.
Preferably, described judge whether described link information meets default disconnection condition and include:
The quantity that link TIMEOUT occurs is extracted from described link information;
When the quantity of described link time-out is more than default second amount threshold, judge whether described link information meets Default disconnection condition.
Preferably, described acquisition Service Instance, before the link information in a detection cycle, also includes:
Determine the request hop count in a detection cycle internal trigger for the described Service Instance;
When the hop count being triggered is less than default hop count threshold value, enter next detection cycle request hop count Determination;
When the hop count being triggered is more than or equal to default hop count threshold value, execution obtains Service Instance at one The step of the link information in detection cycle.
Preferably, the described service request that stops forwarding, to after on described Service Instance, also includes:
After the setting time of interval, the request of predetermined number is accessed and is forwarded on described Service Instance;
When described Service Instance correctly responds the request of forwarding, recover to forward service request to described Service Instance;
When described Service Instance does not respond the request of forwarding, keep stopping forwarding service request to described Service Instance On.
Additionally, for achieving the above object, the present invention also provides a kind of disconnection control device of server, comprising:
Acquisition module, for obtaining link information in a detection cycle for the Service Instance;
Judge module, for judging whether described link information meets default disconnection condition;
Control module, for, after described link information meets default disconnection condition, stopping forwarding service request to institute State on Service Instance.
Preferably, described judge module includes:
Judging unit, for extracting the quantity that break links request occurs from described link information;
Identifying unit, for when the quantity of described break links is more than default first amount threshold, judging described chain Whether the information that connects meets default disconnection condition.
Preferably, described judging unit, is additionally operable to extract the quantity that link TIMEOUT occurs from described link information;
Described identifying unit, is additionally operable to, when the quantity of described link time-out is more than default second amount threshold, judge Whether described link information meets default disconnection condition.
Preferably, also include:
Determining module, for determining the request hop count in a detection cycle internal trigger for the described Service Instance;Determine Module is additionally operable to
When the hop count being triggered is less than default hop count threshold value, enter next detection cycle request hop count Determination;
Described acquisition module, for when the hop count being triggered is more than or equal to default hop count threshold value, obtaining Link information in a detection cycle for the Service Instance.
Preferably, also include recovery module,
Described control module, is additionally operable to, after the setting time of interval, the request of predetermined number be accessed and is forwarded to described clothes In pragmatic example;
Described recovery module, for correctly respond in described Service Instance forwarding request when, recover forward service request To described Service Instance;
Described control module, is additionally operable to, when described Service Instance does not respond the request of forwarding, keep stopping forwarding service Ask to described Service Instance.
The present invention, by being monitored to the link information of Service Instance, judges whether to meet pre- according to described link information If disconnection condition, when meeting, disconnect this Service Instance, stop forwarding service request on described Service Instance.By right Service Instance turns off in time, it is to avoid client and the connection establishment of service end are rung because solving Service Instance in time at present Should be slow, lead to service request response not in time so that the problem of business experience difference, so that service request timely responds to, improves industry Business experience.
Brief description
Fig. 1 is the schematic flow sheet of the first embodiment of disconnection control method of server of the present invention;
Fig. 2 is to judge in one embodiment of the invention whether described link information meets the flow process signal of default disconnection condition Figure;
Fig. 3 is to judge in another embodiment of the present invention whether described link information meets the flow process of default disconnection condition and show It is intended to;
Fig. 4 breaks the schematic diagram of calculating for one embodiment of the invention;
Fig. 5 is the schematic flow sheet of the second embodiment of disconnection control method of server of the present invention;
Fig. 6 is the schematic flow sheet of the 3rd embodiment of disconnection control method of server of the present invention;
Fig. 7 is the configuration diagram of client and service end service request in one embodiment of the invention;
Fig. 8 is the schematic diagram that in one embodiment of the invention, Service Instance disconnects;
Fig. 9 is the high-level schematic functional block diagram of the first embodiment of disconnection control device of server of the present invention;
Figure 10 is the refinement high-level schematic functional block diagram of judge module one embodiment in Fig. 9;
Figure 11 is the high-level schematic functional block diagram of the second embodiment of disconnection control device of server of the present invention;
Figure 12 is the high-level schematic functional block diagram of the 3rd embodiment of disconnection control device of server of the present invention.
The realization of the object of the invention, functional characteristics and advantage will be described further in conjunction with the embodiments referring to the drawings.
Specific embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete Site preparation description is it is clear that described embodiment is only a part of embodiment of the present invention, rather than whole embodiments.Base Embodiment in the present invention, those of ordinary skill in the art obtained under the premise of not making creative work all its His embodiment, broadly falls into the scope of protection of the invention.
With reference to Fig. 1, Fig. 1 is the schematic flow sheet of the first embodiment of disconnection control method of server of the present invention.
In one embodiment, the disconnection control method of described server includes:
Step s10, obtains link information in a detection cycle for the Service Instance;
In the present embodiment, preset a detection cycle, this detection cycle can be 50s or 60s etc., for the system of saving Resource, described detection cycle can be 3 minutes or 5 minutes, in order to improve detection frequency, pinpoints the problems in time, described detection week Phase could be arranged to 20s or 30s, client initiating business request, obtains Service Instance in a detection cycle Interior link information, this link information includes linking successful information and link failure information, and described link failure information includes chain Connect time-out and break links.In every detection trigger, obtain link information in a detection cycle for the Service Instance.Each inspection The setting of time interval can be carried out during surveying week according to performance requirement and business demand, for example, be 5 minutes or 8 minutes etc..Often It is spaced the detection that this time interval carries out a cycle.
Step s20, judges whether described link information meets default disconnection condition;
After getting the link information in a detection cycle, judge whether described link information meets default disconnection Condition.Specifically, in a preferred embodiment of the present invention, with reference to Fig. 2, judge whether described link information meets default disconnection The inclusion of condition:
Step s21, extracts the quantity that break links request occurs from described link information;Described link information include but It is not limited to break links information and link time-out and link the information such as successfully.After getting link information, from described connection The quantity that break links request occurs is extracted, i.e. extract that how many request there occurs break links, by described chain wrong in information Quantity is compared with default first amount threshold by mistake, and described default first amount threshold is to arrange in advance, for example, is 20 Or 200, according to the service request quantity setting initiated in this detection cycle, for example, number of requests is 200, then the first number Amount threshold value is set to 40 or 50, and for example, number of requests is 500, then the first amount threshold is set to 100 or 120.
Step s22, when the quantity of described break links is more than default first amount threshold, judges described link information Meet default disconnection condition.When the quantity of this detection cycle internal chaining mistake is more than default first amount threshold, judge institute State whether link information meets default disconnection condition.In other embodiments of the present invention or calculating linking mistake institute The ratio accounting for, when the ratio of break links reaches preset ratio value (20% or 25% etc.), judges that described link information meets Default disconnection condition.
In a preferred embodiment of the present invention, with reference to Fig. 3, judge whether described link information meets default disconnection condition It may also is that
Step s23, extracts the quantity that link TIMEOUT occurs from described link information;Getting link information Afterwards, extract the quantity that link TIMEOUT occurs from described link information, i.e. extract that how many request there occurs that link is super When, the quantity of described link time-out is compared with default second amount threshold, described default second amount threshold is in advance Setting, for example, is 30 or 300, according to the service request quantity setting initiated in this detection cycle, for example, number of requests For 200, then the second amount threshold is set to 60 or 70, and for example, number of requests is 400, then the second amount threshold sets It is set to 120 or 140.
Step s24, when the quantity of described link time-out is more than default second amount threshold, judges described link information Meet default disconnection condition.When the quantity of this detection cycle internal chaining time-out is more than default second amount threshold, judge institute State link information and meet default disconnection condition.In other embodiments of the present invention or shared by calculating linking mistake Ratio, when the ratio of break links reaches preset ratio value (20% or 25% etc.), judges that described link information meets default Disconnection condition.
In other embodiments of the present invention, can be will to extract generation break links and link time-out from link information Total quantity, is more than a threshold value in total quantity and (always asks as 100, threshold value is 60;Or always ask as 300, threshold value is Article 200, arrange with Service Instance performance according to demand) when, judge that described link information meets default disconnection condition.Equally Can consider from ratio, when ratio is more than 25% or 30% or even 20%, judge that described link information meets default disconnection Condition.In disconnecting judge process, the algorithm that the present embodiment adopts is to ask corresponding time point (ticker) to be set to every time 1, if the counter in the unit of account time counts, such as Fig. 4, wants to calculate the counting of certain time period it is only necessary to when current Between and prior time ticker, remove the data not in this ticker scope, do counting, such calculating does not have Any lock, performance is very high, for example, is used in calculating and the counter of link information.
Step s30, after described link information meets default disconnection condition, stops forwarding service request to described service On example.
After described link information meets default disconnection condition, stop forwarding service request to described Service Instance, That is, disconnect described Service Instance, described Service Instance no longer receives service and forwards.The present embodiment is by the link to Service Instance Information is monitored, and judges whether to meet default disconnection condition according to described link information, when meeting, disconnects this service real Example, stops forwarding service request to described Service Instance.By turning off in time to Service Instance, it is to avoid client at present Slow because service instance response cannot be solved in time with the connection establishment of service end, lead to service request response not in time so that industry The problem of business experience difference, so that service request timely responds to, improves business experience.
In order to ensure that service request is timely responded to, and avoid the waste of resource, in a preferred embodiment of the present invention, With reference to Fig. 5, methods described also includes:
Step s40, determines the request hop count in a detection cycle internal trigger for the described Service Instance;Entering detection During the cycle, determine the request number of times in this detection cycle internal trigger for the described Service Instance, the request of this triggering include failure and Successfully ask, i.e. all requests being forwarded to described Service Instance.
Step s50, when the hop count being triggered is less than default hop count threshold value, enters the request of next detection cycle The determination of hop count;Described default hop count threshold value is arranged according to Service Instance performance and user's request, for example, it may be Or 2000 etc. article 200,.After the request hop count determining triggering, the hop count being triggered is less than default hop count Threshold value compares.
Step s10, when the hop count being triggered is more than or equal to default hop count threshold value, obtains Service Instance and exists Link information in one detection cycle;
Step s20, judges whether described link information meets default disconnection condition;
Step s30, after described link information meets default disconnection condition, stops forwarding service request to described service On example.When the hop count being triggered is more than or equal to default hop count threshold value, just obtains Service Instance and examine at one Link information in the survey cycle;When the hop count being triggered is less than default hop count threshold value, do not execute acquisition service real Link information in a detection cycle for the example.In an embodiment of the present invention, preset the time, for example, be 1 minute or 30s Deng, within this time, judge whether the request number of times triggering this Service Instance reaches certain value, for example, be 200 or 300, When reaching, enter detection cycle, obtain link information in a detection cycle for the Service Instance.Preferably, set detection Service type, is only monitored to the link information of this service type and records, and to its outside the service type of this setting His classification is not counted in the link information in detection cycle.
In order to make full use of the resource of Service Instance, in a preferred embodiment of the present invention, with reference to Fig. 6, step s30 it Afterwards, also include:
Step s60, after the setting time of interval, the request of predetermined number is accessed and is forwarded on described Service Instance;Institute Stating setting time can be 2 minutes or 3 minutes etc..After the setting time of interval, the request of predetermined number is accessed and is forwarded to institute State on Service Instance, i.e. a small amount of request is accessed and is forwarded on described Service Instance in order to whether just to test this Service Instance Often, service request can be timely responded to.
Step s70, when described Service Instance correctly responds the request of forwarding, recovers to forward service request to described service On example;When described Service Instance correctly responds the request of forwarding, normally forward service request to described Service Instance, recover The use of described Service Instance.
Step s80, when described Service Instance does not respond the request of forwarding, keeps stopping forwarding service request to described clothes In pragmatic example.When described Service Instance does not respond the request of forwarding, continue to stop forwarding service request to described Service Instance On, until after being successfully tested, just normally forwarding request to Service Instance, after separated in time (5 minutes or 10 minutes etc.), Prompting Service Instance fault, need to be overhauled.
In order to preferably describe the embodiment of the present invention, with reference to Fig. 7, it is client and service end service request framework, in inspection In the survey cycle, if the break links of Service Instance or Service Instance time-out reach predetermined threshold values, osp proxy (osp Agency) will triggering fusing mechanism, this Service Instance will not forwarded the request to by upper osp in follow-up osp proxy special time After service fusing, after certain recovery duration, the request access allowing a small amount of is blown proxy by osp proxy Service.If Service Instance is again correct responded, osp proxy recovers the normal access of service, if Service Instance is still no Method correctly responds, then osp proxy be spaced again in the specific time not forward the request to this Service Instance will be upper.Fusing mechanism Control on the access interface of service;Fusing mechanism acquiescence is to close, such as need to be related using then configuring in configuration center Parameter, these parameters are all dynamically to change, and osp proxy need not be restarted;The configuration parameter of configuration center is based on clothes Business rank, multiple Service Instances are shared, and multiple interfaces are shared;Osp proxy needs to report the blown state for Service Instance, Mercury route can know the fusing situation of the osp proxy of correlation when checking service
If the instance Service Instance error rate selecting from available instances available service example reaches molten Disconnected strategy, then move on to this instance inside circuitbreak instances fusing example;System Back-end is to each Circuitbreak instance has a scheduler scheduler program triggering that it is moved on to half-open instance Half disconnects inside example;If the instance of half-open state successfully calls, put back in available instance Face.In the service instances processing procedure of half-open state, need to consider concurrent problem, such as concurrent invocation When, one is called successfully, a malloc failure malloc.Specifically, with reference to Fig. 8, as the instance3 of serviceb server b There is larger error rate in Service Instance 3, reach fusing needs, then instance3 is fused, do not affect the tune of client client With.After the instance3 that fused, because serviceb is only left instance1 Service Instance 1, instance2 Service Instance 2, then pressure can increase, now need to be alerted, to avoid avalanche effect;If introduce docker application engine container later After change, can dynamically increase instace4 Service Instance 4 to alleviate pressure, isolation instance3 is to interrogate topic simultaneously.
The present invention further provides a kind of disconnection control device of server.
With reference to Fig. 9, Fig. 9 is the high-level schematic functional block diagram of the first embodiment of disconnection control device of server of the present invention.
In one embodiment, the disconnection control device of described server includes: acquisition module 10, judge module 20 and control Module 30.
Described acquisition module 10, for obtaining link information in a detection cycle for the Service Instance;
In the present embodiment, preset a detection cycle, this detection cycle can be 50s or 60s etc., for the system of saving Resource, described detection cycle can be 3 minutes or 5 minutes, in order to improve detection frequency, pinpoints the problems in time, described detection week Phase could be arranged to 20s or 30s, client initiating business request, obtains Service Instance in a detection cycle Interior link information, this link information includes linking successful information and link failure information, and described link failure information includes chain Connect time-out and break links.In every detection trigger, obtain link information in a detection cycle for the Service Instance.Each inspection The setting of time interval can be carried out during surveying week according to performance requirement and business demand, for example, be 5 minutes or 8 minutes etc..Often It is spaced the detection that this time interval carries out a cycle.
Described judge module 20, for judging whether described link information meets default disconnection condition;
After getting the link information in a detection cycle, judge whether described link information meets default disconnection Condition.Specifically, in a preferred embodiment of the present invention, with reference to Figure 10, described judge module includes: judging unit 21 and judgement Unit 22,
Described judging unit 21, for extracting the quantity that break links request occurs from described link information;Described chain The information that connects includes but is not limited to break links information and link time-out and links the information such as successfully.Getting link information Afterwards, extract the quantity that break links request occurs from described link information, i.e. extract that how many request there occurs chain wrong By mistake, the quantity of described break links is compared with default first amount threshold, described default first amount threshold is in advance Setting, for example, is 20 or 200, according to the service request quantity setting initiated in this detection cycle, for example, number of requests For 200, then the first amount threshold is set to 40 or 50, and for example, number of requests is 500, then the first amount threshold sets It is set to 100 or 120.
Described identifying unit 22, for when the quantity of described break links is more than default first amount threshold, judging Described link information meets default disconnection condition.The quantity of this detection cycle internal chaining mistake is more than default first quantity threshold During value, judge whether described link information meets default disconnection condition.In other embodiments of the present invention or calculate Ratio shared by break links, when the ratio of break links reaches preset ratio value (20% or 25% etc.), judges described chain The information of connecing meets default disconnection condition.
Further, described judging unit 21, is additionally operable to extract generation link TIMEOUT from described link information Quantity;After getting link information, extract the quantity that link TIMEOUT occurs from described link information, i.e. extracting has How many requests there occurs link time-out, and the quantity of described link time-out is compared with default second amount threshold, described default The second amount threshold be arrange in advance, for example, be 30 or 300, according in this detection cycle initiate service request number Amount setting, for example, number of requests is 200, then the second amount threshold is set to 60 or 70, and for example, number of requests is 400 Bar, then the second amount threshold be set to 120 or 140.
Described identifying unit 22, is additionally operable to, when the quantity of described link time-out is more than default second amount threshold, sentence Fixed described link information meets default disconnection condition.The quantity of this detection cycle internal chaining time-out is more than default second quantity During threshold value, judge that described link information meets default disconnection condition.In other embodiments of the present invention or calculate chain The by mistake shared ratio of wrong, when the ratio of break links reaches preset ratio value (20% or 25% etc.), judges described link Information meets default disconnection condition.
In other embodiments of the present invention, can be will to extract generation break links and link time-out from link information Total quantity, is more than a threshold value in total quantity and (always asks as 100, threshold value is 60;Or always ask as 300, threshold value is Article 200, arrange with Service Instance performance according to demand) when, judge that described link information meets default disconnection condition.Equally Can consider from ratio, when ratio is more than 25% or 30% or even 20%, judge that described link information meets default disconnection Condition.In disconnecting judge process, the algorithm that the present embodiment adopts is to ask corresponding time point (ticker) to be set to every time 1, if the counter in the unit of account time counts, such as Fig. 3, wants to calculate the counting of certain time period it is only necessary to when current Between and prior time ticker, remove the data not in this ticker scope, do counting, such calculating does not have Any lock, performance is very high, for example, is used in calculating and the counter of link information.
Described control module 30, please for after described link information meets default disconnection condition, stopping forwarding service Ask to described Service Instance.
After described link information meets default disconnection condition, stop forwarding service request to described Service Instance, That is, disconnect described Service Instance, described Service Instance no longer receives service and forwards.The present embodiment is by the link to Service Instance Information is monitored, and judges whether to meet default disconnection condition according to described link information, when meeting, disconnects this service real Example, stops forwarding service request to described Service Instance.By turning off in time to Service Instance, it is to avoid client at present Slow because service instance response cannot be solved in time with the connection establishment of service end, lead to service request response not in time so that industry The problem of business experience difference, so that service request timely responds to, improves business experience.
In order to ensure that service request is timely responded to, and avoid the waste of resource, in a preferred embodiment of the present invention, With reference to Figure 11, described device also includes:
Determining module 40, for determining the request hop count in a detection cycle internal trigger for the described Service Instance;? When entering detection cycle, determine the request number of times in this detection cycle internal trigger for the described Service Instance, the request bag of this triggering Include failure and successful request, i.e. all requests being forwarded to described Service Instance.
Determining module 40 is additionally operable to, when the hop count being triggered is less than default hop count threshold value, enter next detection The determination of periodic request hop count;Described default hop count threshold value is arranged according to Service Instance performance and user's request, example As being 200 or 2000 etc..After the request hop count determining triggering, the hop count being triggered is less than pre- If hop count threshold value compares.
Acquisition module 10, when the hop count being triggered is more than or equal to default hop count threshold value, obtains Service Instance Link information in a detection cycle;Judge module 20 judges whether described link information meets default disconnection condition; Control module 30, after described link information meets default disconnection condition, stops forwarding service request to described Service Instance On.When the hop count being triggered is more than or equal to default hop count threshold value, just obtain Service Instance a detection week Link information in phase;When the hop count being triggered is less than default hop count threshold value, does not execute acquisition Service Instance and exist Link information in one detection cycle.In an embodiment of the present invention, preset the time, for example, be 1 minute or 30s etc., In this time, judge whether the request number of times triggering this Service Instance reaches certain value, for example, be 200 or 300, reaching When, enter detection cycle, obtain link information in a detection cycle for the Service Instance.Preferably, set the service of detection Classification, is only monitored to the link information of this service type and records, and to other classes outside the service type of this setting It is not counted in the link information in detection cycle.
In order to make full use of the resource of Service Instance, in a preferred embodiment of the present invention, with reference to Figure 12, described device is also Including: recovery module 50,
Described control module 30, is additionally operable to after the setting time of interval, the request of predetermined number is accessed described in being forwarded to On Service Instance;Described setting time can be 2 minutes or 3 minutes etc..After the setting time of interval, by the request of predetermined number Access is forwarded on described Service Instance, i.e. accesses a small amount of request and is forwarded on described Service Instance in order to test this clothes Whether pragmatic example is normal, can timely respond to service request.
Described recovery module 50, for correctly respond in described Service Instance forwarding request when, recover forward service please Ask to described Service Instance;When described Service Instance correctly responds the request of forwarding, normally forward to described Service Instance Service request, recovers the use of described Service Instance.
Described control module 30, is additionally operable to, when described Service Instance does not respond the request of forwarding, keep stopping forwarding clothes Business request is to described Service Instance.When described Service Instance does not respond the request of forwarding, continue to stop forwarding service request To on described Service Instance, until after being successfully tested, just normally forwarding to Service Instance and ask, in separated in time (5 minutes Or 10 minutes etc.) after, point out Service Instance fault, need to be overhauled.
In order to preferably describe the embodiment of the present invention, with reference to Fig. 6, it is client and service end service request framework, in inspection In the survey cycle, if the break links of Service Instance or Service Instance time-out reach predetermined threshold values, osp proxy (osp Agency) will triggering fusing mechanism, this Service Instance will not forwarded the request to by upper osp in follow-up osp proxy special time After service fusing, after certain recovery duration, the request access allowing a small amount of is blown proxy by osp proxy Service.If Service Instance is again correct responded, osp proxy recovers the normal access of service, if Service Instance is still no Method correctly responds, then osp proxy be spaced again in the specific time not forward the request to this Service Instance will be upper.Fusing mechanism Control on the access interface of service;Fusing mechanism acquiescence is to close, such as need to be related using then configuring in configuration center Parameter, these parameters are all dynamically to change, and osp proxy need not be restarted;The configuration parameter of configuration center is based on clothes Business rank, multiple Service Instances are shared, and multiple interfaces are shared;Osp proxy needs to report the blown state for Service Instance, Mercury route can know the fusing situation of the osp proxy of correlation when checking service
If the instance Service Instance error rate selecting from available instances available service example reaches molten Disconnected strategy, then move on to this instance inside circuitbreak instances fusing example;System Back-end is to each Circuitbreak instance has a scheduler scheduler program triggering that it is moved on to half-open instance Half disconnects inside example;If the instance of half-open state successfully calls, put back in available instance Face.In the service instances processing procedure of half-open state, need to consider concurrent problem, such as concurrent invocation When, one is called successfully, a malloc failure malloc.Specifically, with reference to Fig. 7, as the instance3 of serviceb server b There is larger error rate in Service Instance 3, reach fusing needs, then instance3 is fused, do not affect the tune of client client With.After the instance3 that fused, because serviceb is only left instance1 Service Instance 1, instance2 Service Instance 2, then pressure can increase, now need to be alerted, to avoid avalanche effect;If introduce docker application engine container later After change, can dynamically increase instace4 Service Instance 4 to alleviate pressure, isolation instance3 is to interrogate topic simultaneously.
These are only the preferred embodiments of the present invention, not thereby limit the present invention the scope of the claims, every using this Equivalent structure or equivalent flow conversion that bright description and accompanying drawing content are made, or directly or indirectly it is used in other related skills Art field, is included within the scope of the present invention.

Claims (10)

1. a kind of disconnection control method of server is it is characterised in that include step:
Obtain link information in a detection cycle for the Service Instance;
Judge whether described link information meets default disconnection condition;
After described link information meets default disconnection condition, stop forwarding service request to described Service Instance.
2. the disconnection control method of server as claimed in claim 1 is it is characterised in that the described link information of described judgement is No meet default disconnection condition and include:
The quantity that break links request occurs is extracted from described link information;
When the quantity of described break links is more than default first amount threshold, judge whether described link information meets default Disconnection condition.
3. the disconnection control method of server as claimed in claim 1 is it is characterised in that the described link information of described judgement is No meet default disconnection condition and include:
The quantity that link TIMEOUT occurs is extracted from described link information;
When the quantity of described link time-out is more than default second amount threshold, judge whether described link information meets default Disconnection condition.
4. the disconnection control method of server as claimed in claim 1 is it is characterised in that described acquisition Service Instance is at one Before link information in detection cycle, also include:
Determine the request hop count in a detection cycle internal trigger for the described Service Instance;
When the hop count being triggered is less than default hop count threshold value, enter next detection cycle request hop count really Fixed;
When the hop count being triggered is more than or equal to default hop count threshold value, execution obtains Service Instance and detects at one The step of the link information in the cycle.
5. the disconnection control method of the server as described in any one of Claims 1-4 is it is characterised in that described stop forwarding After service request is to described Service Instance, also include:
After the setting time of interval, the request of predetermined number is accessed and is forwarded on described Service Instance;
When described Service Instance correctly responds the request of forwarding, recover to forward service request to described Service Instance;
When described Service Instance does not respond the request of forwarding, keep stopping forwarding service request to described Service Instance.
6. a kind of disconnection control device of server is it is characterised in that include:
Acquisition module, for obtaining link information in a detection cycle for the Service Instance;
Judge module, for judging whether described link information meets default disconnection condition;
Control module, for after described link information meets default disconnection condition, stopping forwarding service request to described clothes In pragmatic example.
7. the disconnection control device of server as claimed in claim 6 is it is characterised in that described judge module includes:
Judging unit, for extracting the quantity that break links request occurs from described link information;
Identifying unit, for when the quantity of described break links is more than default first amount threshold, judging described link letter Whether breath meets default disconnection condition.
8. the disconnection control device of server as claimed in claim 7 is it is characterised in that described judging unit, be additionally operable to from The quantity that link TIMEOUT occurs is extracted in described link information;
Described identifying unit, is additionally operable to, when the quantity of described link time-out is more than default second amount threshold, judge described Whether link information meets default disconnection condition.
9. the disconnection control device of server as claimed in claim 7 or 8, it is characterised in that also comprising determining that module, is used In determine described Service Instance a detection cycle internal trigger request hop count;Determining module is additionally operable to
When the hop count being triggered is less than default hop count threshold value, enter next detection cycle request hop count really Fixed;
Described acquisition module, for when the hop count being triggered is more than or equal to default hop count threshold value, obtaining service Link information in a detection cycle for the example.
10. the disconnection control device of server as claimed in claim 9 is it is characterised in that also include: recovery module,
Described control module, is additionally operable to, after the setting time of interval, the request of predetermined number be accessed and is forwarded to described service in fact In example;
Described recovery module, for correctly respond in described Service Instance forwarding request when, recover forward service request to institute State on Service Instance;
Described control module, is additionally operable to, when described Service Instance does not respond the request of forwarding, keep stopping forwarding service request To described Service Instance.
CN201610791101.4A 2016-08-31 2016-08-31 Disconnection control method and device for server Pending CN106375150A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610791101.4A CN106375150A (en) 2016-08-31 2016-08-31 Disconnection control method and device for server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610791101.4A CN106375150A (en) 2016-08-31 2016-08-31 Disconnection control method and device for server

Publications (1)

Publication Number Publication Date
CN106375150A true CN106375150A (en) 2017-02-01

Family

ID=57899727

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610791101.4A Pending CN106375150A (en) 2016-08-31 2016-08-31 Disconnection control method and device for server

Country Status (1)

Country Link
CN (1) CN106375150A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107092532A (en) * 2017-03-22 2017-08-25 武汉斗鱼网络科技有限公司 A kind of remote invocation method and far call device
CN108009075A (en) * 2017-11-27 2018-05-08 南京联创信息科技有限公司 Dynamic fusing determination methods based on Hystrix frames
CN109240765A (en) * 2018-08-28 2019-01-18 中国联合网络通信集团有限公司 Blowout method, device, equipment and the computer readable storage medium of Service Source
CN110309016A (en) * 2019-06-13 2019-10-08 北京奇艺世纪科技有限公司 A kind of fusing restoration methods, device and server
CN111031000A (en) * 2019-11-18 2020-04-17 腾讯科技(深圳)有限公司 Processing method, device and system of business wind control system and storage medium
CN111866156A (en) * 2020-07-27 2020-10-30 网易(杭州)网络有限公司 Fusing processing method and device
CN112306701A (en) * 2019-07-25 2021-02-02 中移动信息技术有限公司 Service fusing method, device, equipment and storage medium
CN112306701B (en) * 2019-07-25 2024-05-03 中移动信息技术有限公司 Service fusing method, device, equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101252460A (en) * 2007-02-23 2008-08-27 国际商业机器公司 Method and data processing system for collecting usage data of an on-demand service
CN101383734A (en) * 2008-10-20 2009-03-11 华为技术有限公司 State detecting method, system and apparatus
CN102075380A (en) * 2010-12-16 2011-05-25 中兴通讯股份有限公司 Method and device for detecting server state
CN102238034A (en) * 2011-07-07 2011-11-09 北京星网锐捷网络技术有限公司 Method and device for maintaining link connection status and network equipment
CN103283180A (en) * 2011-12-02 2013-09-04 华为技术有限公司 Fault detection method, gateway, user equipment, and communication system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101252460A (en) * 2007-02-23 2008-08-27 国际商业机器公司 Method and data processing system for collecting usage data of an on-demand service
CN101383734A (en) * 2008-10-20 2009-03-11 华为技术有限公司 State detecting method, system and apparatus
CN102075380A (en) * 2010-12-16 2011-05-25 中兴通讯股份有限公司 Method and device for detecting server state
CN102238034A (en) * 2011-07-07 2011-11-09 北京星网锐捷网络技术有限公司 Method and device for maintaining link connection status and network equipment
CN103283180A (en) * 2011-12-02 2013-09-04 华为技术有限公司 Fault detection method, gateway, user equipment, and communication system

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107092532A (en) * 2017-03-22 2017-08-25 武汉斗鱼网络科技有限公司 A kind of remote invocation method and far call device
CN107092532B (en) * 2017-03-22 2020-08-04 武汉斗鱼网络科技有限公司 Remote calling method and remote calling device
CN108009075A (en) * 2017-11-27 2018-05-08 南京联创信息科技有限公司 Dynamic fusing determination methods based on Hystrix frames
CN109240765A (en) * 2018-08-28 2019-01-18 中国联合网络通信集团有限公司 Blowout method, device, equipment and the computer readable storage medium of Service Source
CN110309016A (en) * 2019-06-13 2019-10-08 北京奇艺世纪科技有限公司 A kind of fusing restoration methods, device and server
CN112306701A (en) * 2019-07-25 2021-02-02 中移动信息技术有限公司 Service fusing method, device, equipment and storage medium
CN112306701B (en) * 2019-07-25 2024-05-03 中移动信息技术有限公司 Service fusing method, device, equipment and storage medium
CN111031000A (en) * 2019-11-18 2020-04-17 腾讯科技(深圳)有限公司 Processing method, device and system of business wind control system and storage medium
CN111866156A (en) * 2020-07-27 2020-10-30 网易(杭州)网络有限公司 Fusing processing method and device

Similar Documents

Publication Publication Date Title
CN106375150A (en) Disconnection control method and device for server
TWI746512B (en) Physical machine fault classification processing method and device, and virtual machine recovery method and system
CN101800675B (en) Failure monitoring method, monitoring equipment and communication system
CN110166462B (en) Access control method, system, electronic device and computer storage medium
CN110445688B (en) Interface service function monitoring method and system based on data collection
CN106412016A (en) Connection control method and device for server
CN111092786B (en) Network equipment safety authentication service reliability enhancing system
CN108092836A (en) The monitoring method and device of a kind of server
CN106778260A (en) Attack detection method and device
CN107195131A (en) A kind of method and device of analog hardware equipment
CN106656604A (en) Microservice request management method, microservice controller and high-concurrence microservice architecture
CN106649043B (en) Automatic fault diagnosis method and system for operation and maintenance system
CN108508874A (en) A kind of method and apparatus of monitoring equipment fault
CN110474911A (en) Trusted end-user recognition methods, device, equipment and computer readable storage medium
CN110502366A (en) Case executes method, apparatus, equipment and computer readable storage medium
CN104182683A (en) Method, device and system for monitoring online transactions
CN110333989A (en) A kind of server failure detection method, system and electronic equipment and storage medium
CN103246585A (en) Storage controller fault detecting method
CN104076808A (en) Fault diagnosis system and method for industrial control equipment
CN106060048A (en) Network resource access method and network resource access device
CN104935436B (en) A kind of user authentication method and system
CN104794039B (en) The remote monitoring method and device of service software
CN109561487B (en) Method and device for reducing energy consumption of mobile terminal and mobile terminal
CN101237355B (en) Service monitoring method, and network monitoring device
CN107846294A (en) A kind of active and standby service switch method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20171220

Address after: 510000 Guangzhou City, Guangzhou, Guangdong, Fangcun Avenue, one of the 314 self compiled

Applicant after: Guangzhou Pinwei Software Co., Ltd.

Address before: 510000 Building No. 1-5, No. 20, Fangcun flower street, Fangcun, Guangzhou, Guangdong

Applicant before: Guangzhou VIPSHOP Information and Technology Co., Ltd.

TA01 Transfer of patent application right
RJ01 Rejection of invention patent application after publication

Application publication date: 20170201

RJ01 Rejection of invention patent application after publication