Aeraki can help you manage any Layer 7 protocol in a service mesh. Currently, Aeraki already supports open source protocols such as Dubbo, Thrit, and Redis. You can also use Aeraki's MetaProtocol protocol extension framework to manage Layer 7 traffic for private protocols. This series of tutorials will introduce how to use Aeraki to provide seven-layer traffic routing, local flow control, and global flow control for services using protocols such as Dubbo and Thrift in a service mesh, as well as how to quickly develop a custom protocol based on the Aeraki Protocol and manage services using custom protocols in the Istio service mesh. This tutorial describes how to use the MetaRouter CRD resource provided by Areaaki to set local throttling rules for application protocols developed based on MetaProtocol. Installing the Sample ProgramIf you haven't installed the sample application yet, refer to the Quick Start guide to install Aeraki, Istio, and the sample application. After the installation is complete, you can see that the following two NSs are added to the cluster. The two NSs are installed with sample programs for Dubbo and Thrift protocols based on MetaProtocol. You can choose any program for testing.
Aeraki's throttling rules are designed to be intuitive and flexible, supporting both throttling of all incoming requests to a service and fine-grained throttling of requests to a server based on different conditions. Limit all incoming requests to the service
Note: Because local throttling is processed on a service instance, when a service has multiple instances, the actual throttling effect is the throttling number multiplied by the number of instances. Use the aerakictl command to view the client's application logs. You can see that the client can only successfully execute 4 requests per minute (there are two service instances, and each service instance is limited to 2 requests per minute):
Limit incoming requests to services based on conditionsAeraki supports setting multiple throttling rules for services based on conditions to meet fine-grained throttling requirements, such as grouping requests by user or interface and setting different throttling rules for each group. The matching conditions for packet current limiting are the same as those for routing. Any attribute that can be extracted from the request data packet can be used as the matching condition for the current limiting rule. For example, the following rules set different current limiting conditions for the sayHello and ping interfaces:
Set up traffic limiting rules by service and by condition at the same timeYou can set both service-level throttling rules and conditional throttling rules at the same time. This is suitable for situations where you need to set an overall throttling rule for all requests of a service, while also setting exceptions for one or several groups of requests. For example, the following rate limiting rule sets an overall rate limiting rule of 1000 messages per minute for the service, and sets a rate limiting condition of 100 messages per minute for the ping interface.
Understanding the principlesIn the configuration sent by Aeraki to the Sidecar Proxy, the MetaProtocol Proxy is set for the Listener corresponding to the service, and the local rate limit filter is set in the configuration. Aeraki will translate the rate limiting rules configured in MetaRouter into rate limiting configurations of the local rate limit filter and send them to MetaProtocol Proxy through Aeraki. You can view the configuration of the service's sidecar proxy with the following command:
The MetaProtocol Proxy configuration in the Inbound Listener of the Thrift service is as follows:
|
<<: Interviewer: How to close a TCP connection without killing the process?
RAKsmart has launched a new month of promotions, ...
While fiber will always be the primary network, t...
DogYun has launched a promotion during this year&...
[[189050]] When 5G is widely mentioned, network s...
US-based telecom operators have been working on h...
We have received the official announcement from D...
Looking back at the year 2020, there are many eve...
VMISS is a foreign hosting service provider estab...
With the advent of the Internet era, people need ...
Wi-Fi networks can be slow due to the use of olde...
RS-232 connections are an integral part of serial...
HTTP3 is the latest version of the HTTP protocol....
HostYun has added a new VPS product in Hong Kong&...
As the core of the next generation technology, 5G...
Whenever a "404 error" appears when bro...