Multi-service gateway-oriented flow limiting and automatic capacity expanding and shrinking method

A multi-service and gateway technology, applied in the computer field, can solve problems such as longer waiting time, slower service, no logic, etc., and achieve the effect of increasing the number of servers, ensuring normal business, and reducing costs

Active Publication Date: 2020-03-27
美味不用等(上海)信息科技股份有限公司
View PDF6 Cites 10 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

A good gateway, such as the OpenResty used in this invention, supports current limiting. The so-called current limiting means that the background service can only make up to 2000 requests per second, but when the seckill activity is active, it is 2200 per second. Exceeding the amount may cause the service to slow down (CPU rises above 90%) and unavailable (CPU 100%)
The gateway itself has no logic, and the pressure it can withstand is much greater than that of the background service. The gateway can normally release 2000 requests for these 2200 requests, and the remaining 100 requests are waiting in the waiting queue (if the capacity of the waiting queue is only 100). This caused a problem. The waiting time for the users of these 100 requests became longer, and the remaining 100 requests directly returned the result "the current number of requests is too large". Only some people can enter the background service, and the requests of others are rejected by the gateway.

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
  • Multi-service gateway-oriented flow limiting and automatic capacity expanding and shrinking method
  • Multi-service gateway-oriented flow limiting and automatic capacity expanding and shrinking method
  • Multi-service gateway-oriented flow limiting and automatic capacity expanding and shrinking method

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0034] Embodiment 1: see figure 1 , figure 1 A flow chart of a multi-service gateway-oriented current limiting and automatic scaling method provided by the present invention; a multi-service gateway-oriented current limiting and automatic scaling method provided by the present invention includes steps:

[0035] Step 101, for OpenResty to provide a plug-in interface for the lua script running on nginx, the plug-in interface includes: current limiting plug-in interface, feature anti-brush plug-in interface, access control plug-in interface, firewall plug-in interface and SQL anti-injection plug-in interface;

[0036] When the traffic is too large, it will limit the traffic to prevent the upstream of the gateway from denying access; for the overflow traffic, the gateway service will queue it and not directly discard it; there is a limit on the frequency of IP access.

[0037] Feature anti-brush means that certain services set restrictions on certain users or parameters, such as ...

Embodiment 2

[0054] continue to see figure 1 , figure 1 A flowchart of a multi-service gateway-oriented current limiting and automatic expansion and contraction method provided by the present invention; a multi-service gateway-oriented current limiting and automatic expansion and contraction method provided by the present invention includes steps:

[0055] Step 201, for OpenResty to provide a plug-in interface for the lua script running on nginx, the plug-in interface includes: current limiting plug-in interface, feature anti-brush plug-in interface, access control plug-in interface, firewall plug-in interface and SQL anti-injection plug-in interface;

[0056] When the traffic is too large, it will limit the traffic to prevent the upstream of the gateway from denying access; for the overflow traffic, the gateway service will queue it and not directly discard it; there is a limit on the frequency of IP access.

[0057] Feature anti-brush means that certain services set restrictions on cert...

Embodiment 3

[0085] This embodiment is an application embodiment:

[0086] Another multi-service gateway-oriented current limiting and automatic expansion and contraction method provided by the present invention includes steps:

[0087] In step 301, OpenResty is provided. OpenResty itself only encapsulates Nginx and integrates the Lua environment. Its core service is Nginx. Nginx configures various services and APIs through the nginx.conf file. The traditional way for Nginx to support multiple services is in nginx. Multiple Servers and locations corresponding to the API are configured in the conf file. The present invention designs a template and a conf generation module for generating the nginx.conf file, and generates the nginx.conf file for each service separately.

[0088] Step 302, when the cluster makefile is being compiled, an OpenResty gateway program for the service is generated by specifying parameters to the Makefile and the service file corresponding to the parameters. The ser...

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 multi-service gateway-oriented flow limiting and automatic capacity expanding and shrinking method. The method comprises the following steps: providing OpenResty, compiling the service parameters and the OpenResty source code through a cluster makefile, dynamically generating an nginx.conf file, deploying a service gateway corresponding to the service according to the nginx.conf file, counting the flow of each service, and sending the flow to a gateway system; the service passing through the load of the service according to the zabbix and sending the load to the gateway system; the gateway system monitoring the flow and the load in real time, and when the flow and the load are not matched, performing automatic capacity expansion and shrinkage. According to the multi-service gateway-oriented flow limiting and automatic capacity expanding and shrinking method provided by the invention, the number of servers can be increased in a peak period on the basis of flowlimiting, the normal service is ensured, the servers are returned in a valley period, and the cost is reduced.

Description

technical field [0001] The invention relates to the field of computer technology, in particular to a current limiting and automatic expansion and contraction method for multi-service gateways. Background technique [0002] When a user requests a link (API), the background corresponding to this API needs to perform logical processing on the parameters of the API and return it. If the amount of requests is too large, such as a DDOS attack or spike activity, the CPU or memory usage is too large, which may cause the service to be unavailable. Therefore, before this service, it is necessary to add a gateway layer to isolate external and internal services. The core function of this layer is forwarding. It has no business logic itself, and forwards user requests to background services, which then pass the results to the gateway. , the gateway then responds to the background. [0003] Forwarding can record and modify the address, parameters and results of the user's request, so th...

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): H04L29/06H04L12/66H04L12/873H04L47/52
CPCH04L63/02H04L12/66H04L47/522
Inventor 黄超郑国春
Owner 美味不用等(上海)信息科技股份有限公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products