Content of the invention
The embodiment of the present application provides the business scheduling method of a kind of business cluster, is used for solving JVM old
The response timeout problem causing during the garbage reclamation in generation.
The embodiment of the present application provides the business scheduling method of a kind of business cluster, is applied to comprise load balancing
In the business cluster of equipment and multiple service processing equipment, it is characterised in that described method includes:
Service processing equipment detects self corresponding Java Virtual Machine JVM running state parameter;
If described JVM running state parameter reaches to set threshold value, described service processing equipment is born to described
Carry balancing equipment and send the request of suspending operation;
Wherein, the described request of suspending operation is for making described load-balancing device suspend to described Business Processing
Equipment sends service request.
Wherein, if described JVM running state parameter reaches to set after threshold value, also include: described
Service processing equipment carries out garbage reclamation.
After described service processing equipment completes garbage reclamation, described service processing equipment is to described load all
Weighing apparatus equipment sends and recovers service request;
Wherein, described recovery service request is used for making described load-balancing device recover to described Business Processing
Equipment sends service request.
Wherein, described JVM running state parameter includes: the old age of JVM is for utilization rate and fragmentation parameter.
The embodiment of the present application provides the business scheduling method of a kind of business cluster, is applied to comprise load balancing
In the business cluster of equipment and multiple service processing equipment, it is characterised in that described method includes:
Load-balancing device receives the request of suspending operation that service processing equipment sends, at described business
Reason device flag is down state, suspends and sends service request to described service processing equipment;
When described load-balancing device receives the service request needing to be sent to service processing equipment, will
Described service request is sent to be not marked with the service processing equipment of down state;
Wherein, described load-balancing device receives the recovery service request that described service processing equipment sends,
Remove the down state mark of described service processing equipment, recover to send industry to described service processing equipment
Business request.
Wherein, after described load-balancing device receives the request of suspending operation that service processing equipment sends,
Also include: the described service processing equipment of described load-balancing device instruction carries out garbage reclamation.
The embodiment of the present application provides a kind of service processing equipment, is applied to comprise load-balancing device and multiple
In the business cluster of service processing equipment, it is characterised in that described service processing equipment includes:
Detection module, for detecting the Java Virtual Machine JVM running status ginseng of corresponding service processing equipment
Number;
Sending module, for reaching to set when the JVM running state parameter detected by described detection module
During threshold value, send, to described load-balancing device, the request of suspending operation;
Wherein, the described request of suspending operation is for making described load-balancing device suspend to described Business Processing
Equipment sends service request.
Wherein, described sending module, is additionally operable to when the JVM running status detected by described detection module
When parameter reaches to set threshold value, carry out garbage reclamation.
Wherein, described sending module, is additionally operable to after completing garbage reclamation, to described load-balancing device
Send and recover service request;
Wherein, described recovery service request is used for making described load-balancing device recover to described Business Processing
Equipment sends service request.
Wherein, described JVM running state parameter includes: the old age of JVM is for utilization rate and fragmentation parameter.
The embodiment of the present application provides a kind of load-balancing device, is applied to comprise load-balancing device and multiple
In the business cluster of service processing equipment, it is characterised in that include:
Receiver module, for receiving the request of suspending operation that service processing equipment sends;
Mark module, please for receiving suspending operation of service processing equipment transmission at described receiver module
When asking, described service processing equipment is labeled as down state, so that described load-balancing device suspends
Send service request to described service processing equipment;
Sending module, for needing to be sent to service processing equipment when described load-balancing device receives
During service request, described service request is sent to be not labeled as down state by described mark module
Service processing equipment;
Wherein, described receiver module, is additionally operable to receive the recovery service request that service processing equipment sends;
Described mark module, is additionally operable to receive, at described receiver module, the recovery that service processing equipment sends
During service request, remove the down state mark of described service processing equipment, so that described sending module
Recover to send service request to described service processing equipment.
Wherein, described mark module, is additionally operable to receive the request of suspending operation that service processing equipment sends
When, indicate that described service processing equipment carries out garbage reclamation.
The embodiment of the present application provides a kind of business cluster, comprises load-balancing device and multiple Business Processing sets
Standby, it is characterised in that to include:
Described service processing equipment, for detecting self corresponding Java Virtual Machine JVM running status ginseng
Number;If described JVM running state parameter reaches to set threshold value, send temporarily to described load-balancing device
Stop service request;Wherein, the described request of suspending operation is for making described load-balancing device suspend to described
Service processing equipment sends service request;
Described load-balancing device, for receiving the request of suspending operation that service processing equipment sends, will
Described service processing equipment is labeled as down state, and suspending please to described service processing equipment transmission business
Ask;When receiving the service request needing to be sent to service processing equipment, described service request is sent
Give the service processing equipment being not marked with down state.
The embodiment of the present application has the advantage that service processing equipment by detecting the Java Virtual Machine of self
JVM running state parameter, when JVM running state parameter reaches to set threshold value, described Business Processing sets
Standby to the load-balancing device transmission request of suspending operation, the described request of suspending operation makes load-balancing device
Suspend and send service request to described service processing equipment, it is to avoid each service processing equipment is being carried out
JVM old for garbage reclamation when the response timeout problem that causes, improve the overall stability of system.
Detailed description of the invention
Embodiments herein includes: service processing equipment sets JVM running state parameter threshold value, and examines
Survey self corresponding JVM running state parameter;If described JVM running state parameter reaches to set
During threshold value, described service processing equipment sends, to load-balancing device, the request of suspending operation, and makes described load
Balancing equipment suspends to described service processing equipment transmission service request.
Below in conjunction with the accompanying drawing in the application, the technical scheme in the application is carried out clear, complete
Describe, it is clear that described embodiment is a part of embodiment of the application, rather than whole enforcement
Example.Based on the embodiment in the application, those of ordinary skill in the art are not making creative work
Under the premise of the every other embodiment that obtained, broadly fall into the scope of the application protection.
As in figure 2 it is shown, the method for traffic scheduling of a kind of business cluster providing for the embodiment of the present application,
Specifically include following steps:
Step S201, service processing equipment set JVM running state parameter threshold value.
Wherein, JVM running state parameter includes: the old age of JVM is for utilization rate and fragmentation parameter.
Step S202, service processing equipment detect self corresponding JVM running state parameter.
Specifically, this service processing equipment of Port detecting that service processing equipment is provided by detection JVM
JVM running state parameter.
If step S203 described JVM running state parameter reaches to set threshold value, described Business Processing
Equipment sends, to described load-balancing device, the request of suspending operation.
Wherein, if JVM running state parameter reaches to set after threshold value, described service processing equipment is carried out
Garbage reclamation.
Need to point out, reach setting when the old age of JVM for utilization rate and fragmentation parameter
During JVM running state parameter threshold value, service processing equipment preferentially can send to load-balancing device and suspend
Service request, then carries out garbage reclamation again;Also can carry out sending to load-balancing device suspending simultaneously
Service request and carry out garbage reclamation.This is because when service processing equipment carries out garbage reclamation, can be temporarily
Stopping the response to service request, if now first carrying out garbage reclamation, then this service processing equipment is to negative
The service request carrying reception before balancing equipment sends the request of suspending operation then may be overtime.
The request of suspending operation sends industry for making described load-balancing device suspend to described service processing equipment
Business request, wherein, this service request refers to that load-balancing device is receiving the request of suspending operation to reception
It is sent to business to recover to receive between service request from other system for needing of calling of system
The service request of processing equipment.
After this service processing equipment completes garbage reclamation, send recovery business to described load-balancing device
Request;
Wherein, after this service processing equipment completes garbage reclamation, the utilization rate in JVM old generation can under
Fall, thus will not have influence on the response time of service request because of garbage reclamation.
Wherein, described recovery service request is used for making described load-balancing device recover to described Business Processing
Equipment is sent service request, and is sent to described service request including described service processing equipment
Any one being not marked with in disabled service processing equipment all.Wherein, this service request is
Refer to load-balancing device receive recover to receive after service request from other system for system
The service request needing to be sent to service processing equipment called.
The embodiment of the present application has the advantage that service processing equipment by detecting the Java Virtual Machine of self
JVM running state parameter, when JVM running state parameter reaches to set threshold value, described Business Processing sets
Standby to the load-balancing device transmission request of suspending operation, the described request of suspending operation makes load-balancing device
Suspend and send service request to described service processing equipment, it is to avoid each service processing equipment is being carried out
JVM old for garbage reclamation when the response timeout problem that causes, improve the overall stability of system.
As it is shown on figure 3, the method for traffic scheduling of a kind of business cluster providing for the embodiment of the present application,
It is applied to comprise in the business cluster of load-balancing device and multiple service processing equipment, specifically include following
Step:
Step S301, load-balancing device receive the request of suspending operation that service processing equipment sends, by institute
State service processing equipment and be labeled as down state, suspend and send service request to described service processing equipment.
When described load-balancing device receives the service request needing to be sent to service processing equipment, will
Described service request is sent to be not marked with the service processing equipment of down state;
After described load-balancing device receives the request of suspending operation that service processing equipment sends, also
Including: the described service processing equipment of described load-balancing device instruction carries out garbage reclamation.
Wherein it is desired to point out, send out when described load-balancing device receives service processing equipment
Send suspend operation request when, can preferentially described service request be sent to be not marked with unavailable shape
The service processing equipment of state, then indicates that described service processing equipment carries out garbage reclamation again;Also can be same
When enter to be about to described service request and be sent to be not marked with service processing equipment and the instruction of down state
Described service processing equipment carries out garbage reclamation.This is because when service processing equipment carries out garbage reclamation,
Can suspend the response to service request, if now first carrying out garbage reclamation, then this service processing equipment exists
The service request receiving before load-balancing device sends the request of suspending operation then may time-out.
Specifically, when JVM running state parameter reaches to set threshold value, load-balancing device receives industry
This service processing equipment is labeled as down state, temporarily by the request of suspending operation that business processing equipment sends
Stop sending service request to described service processing equipment, when this load-balancing device receives service request,
Service request is sent to do not comprise other of described service processing equipment according to load balancing principle not mark
It is designated as the service processing equipment of down state.
Wherein, this service request refer to load-balancing device receive suspend operation request extensive to receiving
Receive between multiple service request is sent to Business Processing from other system for needing of calling of system
The service request of equipment.
Step S302, load-balancing device receive the recovery service request that service processing equipment sends, by institute
Stating service processing equipment and re-flagging as upstate, recovering to send business to described service processing equipment please
Ask.
Specifically, after this service processing equipment completes garbage reclamation, send to described load-balancing device
Recovering service request, load-balancing device receives the recovery service request that service processing equipment sends, will
Described service processing equipment re-flags as upstate, recovers to send business to described service processing equipment
This service request, when this load-balancing device receives service request, is sent to include described by request
Service processing equipment is in interior any one being not marked with in disabled service processing equipment all.
Wherein, this service request refers to that load-balancing device receives after receiving recovery service request
The service request needing to be sent to service processing equipment called for system from other system.
The embodiment of the present application has the advantage that service processing equipment by detecting the Java Virtual Machine of self
JVM running state parameter, when JVM running state parameter reaches to set threshold value, described Business Processing sets
Standby to the load-balancing device transmission request of suspending operation, the described request of suspending operation makes load-balancing device
Suspend and send service request to described service processing equipment, it is to avoid each service processing equipment is being carried out
JVM old for garbage reclamation when the response timeout problem that causes, improve the overall stability of system.
Below in conjunction with concrete application scenarios, the above-mentioned two stage is described in detail.
As it is shown in figure 1, operation system A includes 4 service processing equipments, when load-balancing device receives it
During the service request of his system, need this service request is sent to Business Processing according to load balancing principle
Equipment 2 is processed.
If now service processing equipment 2 detects that JVM running state parameter reaches to set threshold value, then business
Processing equipment 2 sends, to load-balancing device, the request of suspending operation, and carries out garbage reclamation.
Load-balancing device receives the request of suspending operation, and service processing equipment 2 is labeled as down state,
Suspend and send service request to service processing equipment 2, and according to load balancing principle, this business is sent to
Service processing equipment 3.
When Business Processing set 2 complete garbage reclamation after, service processing equipment 2 to load-balancing device send
Recover service request.
Load-balancing device receives the recovery service request that service processing equipment 2 sends, and sets Business Processing
Standby 2 re-flag as upstate, and according to load balancing principle, are sent to include industry by service request
Business processing equipment 2 is at the interior service processing equipment being not marked with down state.
The embodiment of the present application has the advantage that service processing equipment by detecting the Java Virtual Machine of self
JVM running state parameter, when JVM running state parameter reaches to set threshold value, described Business Processing sets
Standby to the load-balancing device transmission request of suspending operation, the described request of suspending operation makes load-balancing device
Suspend and send service request to described service processing equipment, it is to avoid each service processing equipment is being carried out
JVM old for garbage reclamation when the response timeout problem that causes, improve the overall stability of system.
The embodiment of the present application provides a kind of service processing equipment, as shown in Figure 4, comprising:
Setting module 401, for setting the JVM running state parameter threshold value of service processing equipment;
Wherein, JVM running state parameter includes: the old age of JVM is for utilization rate and fragmentation parameter.
Detection module 402, for detecting the JVM running state parameter of service processing equipment;
Specifically, the JVM of this service processing equipment of Port detecting that detection module is provided by detection JVM
Running state parameter.
Sending module 403, for when described JVM running state parameter reaches to set threshold value, to load
Balancing equipment sends the request of suspending operation.Wherein, this service request refers to that load-balancing device is receiving
The request of suspending operation is to receiving adjusting from other system of recovering to receive between service request for system
Need to be sent to the service request of service processing equipment.
Sending module 403, for reaching to set JVM running status when described JVM running state parameter
During parameter threshold, carry out garbage reclamation;
Sending module 403, is additionally operable to after service processing equipment completes garbage reclamation, to described load balancing
Equipment sends and recovers service request.
Wherein, after service processing equipment completes garbage reclamation, the utilization rate in JVM old generation can decline,
The response time of service request thus will not be had influence on because of garbage reclamation.
Wherein, described recovery service request is used for making described load-balancing device recover to described Business Processing
Equipment is sent service request, and is sent to described service request including described service processing equipment
Any one being not marked with in disabled service processing equipment all.Wherein, this service request is
Refer to load-balancing device receive recover to receive after service request from other system for system
The service request needing to be sent to service processing equipment called.
The embodiment of the present application has the advantage that service processing equipment by detecting the Java Virtual Machine of self
JVM running state parameter, when JVM running state parameter reaches to set threshold value, described Business Processing sets
Standby to the load-balancing device transmission request of suspending operation, the described request of suspending operation makes load-balancing device
Suspend and send service request to described service processing equipment, it is to avoid each service processing equipment is being carried out
JVM old for garbage reclamation when the response timeout problem that causes, improve the overall stability of system.
The embodiment of the present application provides a kind of load-balancing device, as shown in Figure 5, comprising:
Receiver module 501, please for receiving the request of suspending operation of service processing equipment transmission and recovery business
Ask.
Mark module 502, for receive service processing equipment send suspend operation request when, by institute
State service processing equipment and be labeled as down state, suspend and send service request to described service processing equipment;
Or when described receiver module receives the recovery service request that service processing equipment sends, remove described
The down state mark of service processing equipment, so that described sending module recovers to set to described Business Processing
Preparation send service request.
Wherein, described mark module 502, being additionally operable to receive suspending operation of service processing equipment transmission please
After asking, indicate that described service processing equipment carries out garbage reclamation.
Sending module 503, needs to be sent to the industry of service processing equipment for receiving at this load-balancing device
During business request, described service request is sent to be not labeled as down state by described mark module
Service processing equipment.
Receive service processing equipment send suspend operation request when, if this load-balancing device connects
When receipts need the service request being sent to service processing equipment, according to load balancing principle by this service request
Other Business Processing being not marked with down state being sent to not comprise described service processing equipment set
Standby.
Wherein, this service request refer to load-balancing device receive suspend operation request extensive to receiving
Receive between multiple service request is sent to Business Processing from other system for needing of calling of system
The service request of equipment.
When receiving the recovery service request that service processing equipment sends, if this load-balancing device connects
When receipts need the service request being sent to service processing equipment, according to load balancing principle by this service request
Be sent to comprise described service processing equipment the Business Processing being not flagged as down state
Equipment.
Wherein, this service request refers to that load-balancing device receives after receiving recovery service request
The service request needing to be sent to service processing equipment called for system from other system.
The embodiment of the present application has the advantage that service processing equipment by detecting the Java Virtual Machine of self
JVM running state parameter, when JVM running state parameter reaches to set threshold value, described Business Processing sets
Standby to the load-balancing device transmission request of suspending operation, the described request of suspending operation makes load-balancing device
Suspend and send service request to described service processing equipment, it is to avoid each service processing equipment is being carried out
JVM old for garbage reclamation when the response timeout problem that causes, improve the overall stability of system.
The embodiment of the present application provides a kind of business cluster, as shown in Figure 6, comprising:
Service processing equipment 61, for detecting self corresponding Java Virtual Machine JVM running status ginseng
Number;If described JVM running state parameter reaches to set threshold value, send temporarily to described load-balancing device
Stop service request;Wherein, the described request of suspending operation is for making described load-balancing device suspend to described
Service processing equipment sends service request;
Load-balancing device 62, for receiving the request of suspending operation that service processing equipment sends, by institute
State service processing equipment and be labeled as down state, suspend and send service request to described service processing equipment;
When receiving the service request needing to be sent to service processing equipment, described service request is sent to not
There is the service processing equipment being labeled as down state.
Needing to point out, in the application, service processing equipment carries out garbage reclamation and is not limited in
Load-balancing device indicates, it is possible to be when JVM running state parameter reaches to set threshold value, by described business
Processing equipment carries out garbage reclamation voluntarily.
The embodiment of the present application has the advantage that service processing equipment by detecting the Java Virtual Machine of self
JVM running state parameter, when JVM running state parameter reaches to set threshold value, described Business Processing sets
Standby to the load-balancing device transmission request of suspending operation, the described request of suspending operation makes load-balancing device
Suspend and send service request to described service processing equipment, it is to avoid each service processing equipment is being carried out
JVM old for garbage reclamation when the response timeout problem that causes, improve the overall stability of system.
Through the above description of the embodiments, those skilled in the art is it can be understood that arrive this
Application can add the mode of required general hardware platform by software and realize, naturally it is also possible to by firmly
Part, but a lot of in the case of the former is more preferably embodiment.Based on such understanding, the skill of the application
The part that prior art is contributed by art scheme substantially in other words can be with the form body of software product
Revealing to come, this computer software product is stored in a storage medium, including some instructions are in order to make
Obtain a station terminal equipment (can be mobile phone, personal computer, server, or the network equipment etc.)
Perform the method described in each embodiment of the application.
The above is only the preferred embodiment of the application, it is noted that for the art
For those of ordinary skill, on the premise of without departing from the application principle, some improvement can also be made
And retouching, these improvements and modifications also should regard the protection domain of the application.