Unlock instant, AI-driven research and patent intelligence for your innovation.

Current limiting and automatic expansion and contraction methods for multi-service gateways

A multi-service and gateway technology, applied in the computer field, can solve problems such as slow service, illogical, unusable, etc., and achieve the effect of reducing costs and ensuring normal business

Active Publication Date: 2022-06-28
美味不用等(上海)信息科技股份有限公司
View PDF6 Cites 0 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
  • Current limiting and automatic expansion and contraction methods for multi-service gateways
  • Current limiting and automatic expansion and contraction methods for multi-service gateways
  • Current limiting and automatic expansion and contraction methods for multi-service gateways

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

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

[0035] In step 101, OpenResty is provided, and a plug-in interface is provided for the Lua script running on nginx, and the plug-in interface includes: a current-limiting plug-in interface, a feature anti-brush plug-in interface, an access control plug-in interface, a firewall plug-in interface, and a SQL anti-injection plug-in interface;

[0036] When the traffic is too large, the traffic is restricted to prevent the upstream of the gateway from denying access; for the overflowed traffic, the gateway service queues and does not directly discard it; the frequency of IP access is limited.

[0037] Feature anti-brush means that certain...

Embodiment 2

[0054] continue to see figure 1 , figure 1 A flow chart of a method for current limiting and automatic capacity expansion and contraction for a multi-service gateway provided by the present invention; a method for current limitation and automatic capacity expansion and contraction for a multi-service gateway provided by the present invention, comprising steps:

[0055] In step 101, OpenResty is provided, and a plug-in interface is provided for the Lua script running on nginx, and the plug-in interface includes: a current-limiting plug-in interface, a feature anti-brush plug-in interface, an access control plug-in interface, a firewall plug-in interface, and a SQL anti-injection plug-in interface;

[0056] When the traffic is too large, the traffic is restricted to prevent the upstream of the gateway from denying access; for the overflowed traffic, the gateway service queues and does not directly discard it; the frequency of IP access is limited.

[0057] Feature anti-brush me...

Embodiment 3

[0085] This embodiment is an application embodiment:

[0086] Another method for current limiting and automatic capacity expansion and contraction for multi-service gateways provided by the present invention includes the steps of:

[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 method of Nginx supporting multiple services is in nginx. The conf file is configured with locations corresponding to multiple servers and APIs. The present invention designs a template and a conf generating module for generating the nginx.conf file, and generates the nginx.conf file for each service independently.

[0088] Step 302 , when the cluster makefile is being compiled, the OpenResty gateway program of the service is generated by specifying parameters to the Makefile and a service file corresponding to the pa...

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

This application discloses a multi-service gateway-oriented current limiting and automatic expansion and contraction method, including steps: providing OpenResty, compiling service parameters and OpenResty source code through cluster makefile, dynamically generating nginx.conf file, and deploying according to nginx.conf file The service gateway corresponding to the service, counts the traffic of each service, and sends the traffic to the gateway system; the service sends the load to the gateway system according to the load of zabbix through the service; the gateway system monitors the traffic and load in real time, when the traffic and load When there is a mismatch, automatic expansion and contraction will be performed. The multi-service gateway-oriented current limiting and automatic expansion and contraction method provided by this application can increase the number of servers during peak periods to ensure normal business on the basis of current limiting, and return servers during low periods to reduce costs.

Description

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

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 Patents(China)
IPC IPC(8): H04L9/40H04L12/66H04L47/52
CPCH04L63/02H04L12/66H04L47/522
Inventor 黄超郑国春
Owner 美味不用等(上海)信息科技股份有限公司