Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

A dynamic load balancing method of Nginx based on WebSocket long connection

A balancing method and dynamic load technology, which is applied in resource allocation, program control design, instrumentation, etc., can solve the problem of setting the load information collection cycle, collecting load information without considering the JVM load problem, etc.

Active Publication Date: 2019-02-05
NANJING UNIV OF POSTS & TELECOMM
View PDF5 Cites 14 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0005] To sum up, in the prior art, how to deal with the problem of active reporting of load information by back-end server nodes in the dynamic load balancing algorithm, the problem of setting the cycle of load information collection and the problem of collecting load information under java applications has not considered the problem of JVM load. no public disclosure

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • A dynamic load balancing method of Nginx based on WebSocket long connection
  • A dynamic load balancing method of Nginx based on WebSocket long connection
  • A dynamic load balancing method of Nginx based on WebSocket long connection

Examples

Experimental program
Comparison scheme
Effect test

Embodiment

[0038] Such as figure 1 , 2 As shown, a Nginx dynamic load balancing method based on WebSocket long connection includes the following steps:

[0039] Step S1, start the server cluster, use Nginx as the WebSocket server, and the back-end server node as the WebSocket client, establish a WebSocket persistent connection, and send a heartbeat message to detect the status of the persistent connection. The persistent connection can make the back-end server node actively according to its own status Report weight changes.

[0040] It should be noted that the long connection can make the back-end server node actively report the weight change according to its own state. Compared with the short connection method of request-response, it solves the problem that in the request-response mode, the back-end server node can only wait for the request, and then Replying to the response message, it is impossible to actively make timely feedback according to its own status, and it is easy to mix w...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a Nginx dynamic load balancing method based on WebSocket long connection, includes establishing a long WebSocket connection between Nginx and the back-end server node, calculating the static weight and the remaining load threshold of each back-end server node under no load, collecting periodic load information of back-end server node, calculating residual load parameters and real-time load weights of current server back-end node, judging the relationship between residual load parameters and residual load threshold value, and reasonably distributing the request by Nginxaccording to the latest load weights; It mainly solves the problem that the load weight can not be changed according to the actual situation of the back-end server in the traditional static load balancing method, which leads to the load imbalance.

Description

technical field [0001] The present invention relates to a dynamic load balancing method of Nginx, in particular to a dynamic load balancing method of Nginx based on WebSocket long connection. Background technique [0002] With the continuous development of social networks, e-commerce, mobile Internet, etc., the number of users has increased sharply, and the stand-alone system has been unable to meet the growing demand. The most commonly used method at present is to use multiple servers to form a server cluster mode, and these servers provide services to users together. The cluster mode can combine several or more servers with general processing performance, so that they have consistent performance in external application services, and make full use of the performance of each server to improve the reliability of the system. Moreover, the server nodes in the cluster can dynamically adjust the number of nodes according to the number of users and the performance of the nodes, s...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F9/50G06F9/455
CPCG06F9/45558G06F9/5083
Inventor 姚建国刘栋
Owner NANJING UNIV OF POSTS & TELECOMM
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products