CN106412016A - Connection control method and device for server - Google Patents

Connection control method and device for server Download PDF

Info

Publication number
CN106412016A
CN106412016A CN201610786461.5A CN201610786461A CN106412016A CN 106412016 A CN106412016 A CN 106412016A CN 201610786461 A CN201610786461 A CN 201610786461A CN 106412016 A CN106412016 A CN 106412016A
Authority
CN
China
Prior art keywords
request
service instance
link information
service
forwarding
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
CN201610786461.5A
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 CN201610786461.5A priority Critical patent/CN106412016A/en
Publication of CN106412016A publication Critical patent/CN106412016A/en
Pending legal-status Critical Current

Links

Classifications

    • 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
    • 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/0823Errors, e.g. transmission errors
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/16Threshold monitoring

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses a connection control method for a server. The connection control method comprises the following steps of: after stopping forwarding a service request to a service example, forwarding a pre-set number of request accesses to the service example; when the service example correctly responds to a forwarded request, recovering to forward the service request to the service example; and, when the service example does not responds to the forwarded request, keeping to stop forwarding the service request to the service example. The invention further discloses a connection control device for the server. By means of the connection control method and device for the server disclosed by the invention, resources are sufficiently utilized; and thus, the service experience is improved.

Description

The connection control method of server and device
Technical field
The present invention relates to the connection 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 connection 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 connection control method of a kind of server that the present invention provides, including step:
Stop forwarding service request to Service Instance after, the request of predetermined number is accessed and is forwarded to described Service Instance On;
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.
Preferably, after the described request by predetermined number accesses and is forwarded on described Service Instance, also include:
Determine the quantity of the request of response;
Calculate the shared ratio in predetermined number of the quantity determining;
When the ratio calculating is more than preset ratio threshold value, judge that described Service Instance can correctly respond the request of forwarding.
Preferably, methods described also includes:
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.
Additionally, for achieving the above object, the present invention also provides a kind of connection control device of server, including:
Control module, for stop forwarding service request to Service Instance after, the request of predetermined number is accessed and forwards To described Service Instance;
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 Ask to described Service Instance.
Preferably, described device also includes:
Determining module, for determining the quantity of the request of response;
Computing module, the shared ratio in predetermined number of the quantity for calculating determination;
Judge module, for when the ratio calculating is more than preset ratio threshold value, judging that described Service Instance can correctly ring The request that should forward.
Preferably, device also includes:
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;
Described control module, is additionally operable to after described link information meets default disconnection condition, the service that stops forwarding please Ask to described Service Instance.
Preferably, described judge module, including:
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.
The present invention by disconnect after Service Instance test, after Service Instance correctly responds the request of forwarding, Quickly recover to forward service request to described Service Instance, make full use of resource, improve business experience.
Brief description
Fig. 1 is the schematic flow sheet of the first embodiment of connection control method of server of the present invention;
Fig. 2 is the schematic flow sheet judging the whether correct respond request of Service Instance in one embodiment of the invention;
Fig. 3 is the schematic flow sheet of the second embodiment of connection control method of server of the present invention;
Fig. 4 is to judge in one embodiment of the invention whether described link information meets the flow process signal of default disconnection condition Figure;
Fig. 5 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. 6 breaks the schematic diagram of calculating for one embodiment of the invention;
Fig. 7 is the schematic flow sheet of the 3rd embodiment of connection control method of server of the present invention;
Fig. 8 is the configuration diagram of client and service end service request in one embodiment of the invention;
Fig. 9 is the schematic diagram that in one embodiment of the invention, Service Instance disconnects;
Figure 10 is the high-level schematic functional block diagram of the first embodiment of connection control device of server of the present invention;
Figure 11 is the high-level schematic functional block diagram of the second embodiment of connection control device of server of the present invention;
Figure 12 is the refinement high-level schematic functional block diagram of judge module one embodiment in Figure 10.
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 connection control method of server of the present invention.
In one embodiment, the connection control method of described server includes:
Step S10, stop forwarding service request to Service Instance after, the request of predetermined number is accessed be forwarded to described On Service Instance;After Service Instance meets the disconnection of disconnection condition, need the off-state monitor in real time to this Service Instance, with Carry out business service using this Service Instance as early as possible.Described setting time can be 2 minutes or 3 minutes etc..When interval sets Between after, the request of predetermined number is accessed and is forwarded on described Service Instance, i.e. a small amount of request is accessed and is forwarded to described clothes Whether normal in order to test this Service Instance in pragmatic example, service request can be timely responded to.Described predetermined number be 80 or 50 etc., according to the performance setting of Service Instance.
Step S20, 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.
Specifically, with reference to Fig. 2, judge that Service Instance correctly responds the process of the request of forwarding and includes:
Step S11, determines the quantity of the request of response;After the request of predetermined number is forwarded on this Service Instance, The quantity of the correct request forwarding of monitoring, i.e. determine the quantity of the request of response.
Step S12, calculates the shared ratio in predetermined number of the quantity determining;Calculate the quantity of the correct request forwarding And accounting.
Step S13, when the ratio calculating is more than preset ratio threshold value, judges that described Service Instance can correctly respond forwarding Request.Described preset ratio threshold value can be 80% or 60% etc..Account for the ratio of predetermined number in the request that can correctly forward When reaching described preset ratio threshold value, judge that described Service Instance can correctly respond the request of forwarding.In other enforcements of the present invention In example, also can also be and judge that described Service Instance can correctly respond asking of forwarding according to the quantity of the correct request forwarding Ask.The request of described predetermined number is not disposably to be forwarded to Service Instance, but interval or lasting being forwarded to service in fact Example, and calculate cycle do not limit, as long as response request reach condition (ratio or quantity) after, judge described Service Instance energy The request that correct response forwards.
Step S30, 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.The present embodiment by disconnect after Service Instance test, in Service Instance After the request that correct response forwards, quickly recover to forward service request to described Service Instance, make full use of resource, improve Business experience.
Further, with reference to Fig. 3, the inventive method also includes:
Step S40, 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 S50, 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. 4, judge whether described link information meets default disconnection The inclusion of condition:
Step S51, 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 S52, 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. 5, judge whether described link information meets default disconnection condition Can also be:
Step S53, 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 S54, 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 deterministic 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. 6, 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 S60, 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. 7, methods described also includes:
Step S70, 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 S80, 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 S40, 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 S50, judges whether described link information meets default disconnection condition;
Step S60, 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 preferably describe the embodiment of the present invention, with reference to Fig. 8, 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. 9, 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 connection control device of server.
With reference to Figure 10, Figure 10 is that the functional module of the first embodiment of connection control device of server of the present invention is illustrated Figure.
In one embodiment, the connection control device of described server includes:Control module 10, recovery module 20, determination Module 30, computing module 40 and judge module 50.
Described control module 10, for stop forwarding service request to Service Instance after, the request of predetermined number is visited Ask and be forwarded on described Service Instance;After Service Instance meets the disconnection of disconnection condition, need the disconnection shape to this Service Instance State monitor in real time, to carry out business service using this Service Instance as early as possible.Described 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 on described Service Instance, i.e. a small amount of request is accessed It is forwarded to whether normal in order to test this Service Instance on described Service Instance, service request can be timely responded to.Described default Quantity is 80 or 50 etc., according to the performance setting of Service Instance.
Described recovery module 20, 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 determining module 30, for determining the quantity of the request of response;The request of predetermined number is being forwarded to this clothes After in pragmatic example, the quantity of the correct request forwarding of monitoring, i.e. determine the quantity of the request of response.
Described computing module 40, the shared ratio in predetermined number of the quantity for calculating determination;Calculate correct forwarding The quantity of request and accounting.
Described judge module 50, for when the ratio calculating is more than preset ratio threshold value, judging described Service Instance energy The request that correct response forwards.Described preset ratio threshold value can be 80% or 60% etc..Account for pre- in the request that can correctly forward If the ratio of quantity reaches described preset ratio threshold value, judge that described Service Instance can correctly respond the request of forwarding.At this In invention other embodiment, also can also be that judging described Service Instance according to the quantity of the correct request forwarding can correctly ring The request that should forward.The request of described predetermined number is not disposably to be forwarded to Service Instance, but interval or lasting turning It is sent to Service Instance, and the cycle calculating does not limit, as long as after the request of response reaches condition (ratio or quantity), judge described Service Instance can correctly respond the request of forwarding.
Described control module 10, 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.The present embodiment is by carrying out to the Service Instance after disconnecting Test, after Service Instance correctly responds the request of forwarding, quickly recovers to forward service request to described Service Instance, fills Divide and utilize resource, improve business experience.
With reference to Figure 11, described device also includes:Acquisition module 60,
Described acquisition module 60, 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 50, 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 12, described judge module 50 includes:Judging unit 51 and sentencing Order unit 52,
Described judging unit 51, 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 52, 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 51, 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 52, 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 deterministic 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. 6, 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 20, is additionally operable to, after described link information meets default disconnection condition, stop 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,
Described determining module 30, is additionally operable to determine the request forwarding time in a detection cycle internal trigger for the described Service Instance Number;When entering detection cycle, determine the request number of times in this detection cycle internal trigger for the described Service Instance, this triggering please Ask including failure and successful request, i.e. all requests being forwarded to described Service Instance.
Described determining module 30, is additionally operable to when the hop count being triggered is less than default hop count threshold value, under entrance One detection cycle asks the determination of hop count;Described default hop count threshold value sets according to Service Instance performance and user's request Put, for example, it may be 200 or 2000 etc..After the request hop count determining triggering, will be little for the hop count being triggered Compare in default hop count threshold value.
Acquisition module 60, 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 50 judges whether described link information meets default disconnection condition; Control module 20, 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 preferably describe the embodiment of the present invention, with reference to Fig. 8, 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. 9, 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 specification 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 connection control method of server is it is characterised in that include step:
Stop forwarding service request to Service Instance after, 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.
2. the connection control method of server as claimed in claim 1 is it is characterised in that the described request by predetermined number is visited Ask after being forwarded on described Service Instance, also include:
Determine the quantity of the request of response;
Calculate the shared ratio in predetermined number of the quantity determining;
When the ratio calculating is more than preset ratio threshold value, judge that described Service Instance can correctly respond the request of forwarding.
3. the connection control method of server as claimed in claim 1 or 2 is it is characterised in that methods described also includes:
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.
4. the connection control method of server as claimed in claim 3 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.
5. the connection control method of server as claimed in claim 3 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.
6. a kind of connection control device of server is it is characterised in that include:
Control module, for stop forwarding service request to Service Instance after, the request of predetermined number is accessed and is forwarded to institute State on Service Instance;
Recovery module, for correctly respond in described Service Instance forwarding request when, recover to forward service request to described clothes In pragmatic example;
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.
7. the connection control device of server as claimed in claim 6 is it is characterised in that described device also includes:
Determining module, for determining the quantity of the request of response;
Computing module, the shared ratio in predetermined number of the quantity for calculating determination;
Judge module, turns for when the ratio calculating is more than preset ratio threshold value, judging that described Service Instance can correctly respond The request sent out.
8. the connection control device of server as claimed in claims 6 or 7 is it is characterised in that device also includes:
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;
Described control module, is additionally operable to, after described link information meets default disconnection condition, stop forwarding service request extremely On described Service Instance.
9. the connection control device of server as claimed in claim 8 is it is characterised in that described judge module, including:
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.
10. the connection control device of server as claimed in claim 9 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.
CN201610786461.5A 2016-08-31 2016-08-31 Connection control method and device for server Pending CN106412016A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610786461.5A CN106412016A (en) 2016-08-31 2016-08-31 Connection control method and device for server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610786461.5A CN106412016A (en) 2016-08-31 2016-08-31 Connection control method and device for server

Publications (1)

Publication Number Publication Date
CN106412016A true CN106412016A (en) 2017-02-15

Family

ID=58002126

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610786461.5A Pending CN106412016A (en) 2016-08-31 2016-08-31 Connection control method and device for server

Country Status (1)

Country Link
CN (1) CN106412016A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018171287A1 (en) * 2017-03-22 2018-09-27 武汉斗鱼网络科技有限公司 Remote invoking method and remote invoking apparatus
CN109240765A (en) * 2018-08-28 2019-01-18 中国联合网络通信集团有限公司 Blowout method, device, equipment and the computer readable storage medium of Service Source
WO2021063109A1 (en) * 2019-09-30 2021-04-08 中兴通讯股份有限公司 Uplink authorization request control method, device, terminal and storage medium
CN116048829A (en) * 2022-07-01 2023-05-02 荣耀终端有限公司 Interface calling method, device and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
CN102801581A (en) * 2012-07-16 2012-11-28 重庆大学 Method for predicting WEB service connection success rate
CN102930346A (en) * 2012-10-15 2013-02-13 夏云霓 MTTF (Mean time to failure) forecasting method of SOA (Service Oriented Architecture) service
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
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
CN103283180A (en) * 2011-12-02 2013-09-04 华为技术有限公司 Fault detection method, gateway, user equipment, and communication system
CN102801581A (en) * 2012-07-16 2012-11-28 重庆大学 Method for predicting WEB service connection success rate
CN102930346A (en) * 2012-10-15 2013-02-13 夏云霓 MTTF (Mean time to failure) forecasting method of SOA (Service Oriented Architecture) service

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018171287A1 (en) * 2017-03-22 2018-09-27 武汉斗鱼网络科技有限公司 Remote invoking method and remote invoking apparatus
CN109240765A (en) * 2018-08-28 2019-01-18 中国联合网络通信集团有限公司 Blowout method, device, equipment and the computer readable storage medium of Service Source
WO2021063109A1 (en) * 2019-09-30 2021-04-08 中兴通讯股份有限公司 Uplink authorization request control method, device, terminal and storage medium
CN116048829A (en) * 2022-07-01 2023-05-02 荣耀终端有限公司 Interface calling method, device and storage medium
CN116048829B (en) * 2022-07-01 2023-10-10 荣耀终端有限公司 Interface calling method, device and storage medium

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
CN110166462B (en) Access control method, system, electronic device and computer storage medium
CN106412016A (en) Connection control method and device for server
EP4179410A1 (en) Ml ue capability and inability
CN108092836A (en) The monitoring method and device of a kind of server
CN106130816A (en) A kind of content distributing network monitoring method, monitoring server and system
CN104506392B (en) A kind of delay machine detection method and equipment
CN109218288A (en) A kind of Network Intrusion Detection System for industrial robot control system
CN107276851B (en) Node abnormity detection method and device, network node and console
CN106646186B (en) Batch test method and system for chips
CN107195131A (en) A kind of method and device of analog hardware equipment
WO2021008029A1 (en) Case execution method, apparatus and device, and computer readable storage medium
CN102662782A (en) Method and device for monitoring system bus
CN106649043B (en) Automatic fault diagnosis method and system for operation and maintenance system
KR102291615B1 (en) Apparatus for predicting failure of communication network and method thereof
CN108632823A (en) A kind of method for switching network, terminal and computer storage media
CN103731315A (en) Server failure detecting method
CN106060048A (en) Network resource access method and network resource access device
CN114116343A (en) Equipment testing method and device, electronic equipment and storage medium
CN111861021B (en) Service risk prediction method, device, equipment and computer readable storage medium
CN108964947B (en) Background service quality detection method and device and computer equipment
CN108039956A (en) Using monitoring method, system and computer-readable recording medium
CN110134558B (en) Method and device for detecting server
CN105224426A (en) Physical host fault detection method, device and empty machine management method, system

Legal Events

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

Effective date of registration: 20171207

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

Applicant after: Guangzhou Pinwei Software Co., Ltd.

Address before: Liwan District Fangcun Huahai street Guangzhou city Guangdong province 510000 No. 20 self 1-5 building (only for office use)

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

RJ01 Rejection of invention patent application after publication

Application publication date: 20170215

RJ01 Rejection of invention patent application after publication