Adjust traffic distribution by weight
Dubbo provides the service governance capability of adjusting traffic distribution by weight, and can dynamically adjust traffic distribution by weight without restarting the application.
Dubbo can adjust traffic distribution by weight through XML configuration, annotation configuration, and dynamic configuration. Here we mainly introduce the dynamic configuration method. For other configuration methods, please refer to the old document Configuration
before the start
Please make sure to run Dubbo-Admin successfully
In the case of different machine performance, the load of different machines needs to be evaluated systematically, and some machines need to be downgraded. By adjusting the traffic ratio of the machine by weight, the performance of the machine can be reasonably evaluated. Certain services will face traffic shocks. In order to ensure the availability of core services, some services need to be downgraded. Adjust traffic distribution by weight to avoid faults caused by traffic impact.
- Log in to the Dubbo-Admin console
- In the left navigation bar, select Service Governance > Weight Adjustment.
- Click the Create button, and in the New Weight Rule panel, fill in the rule content, and then click Save.
For the scenario of dynamically adjusting traffic distribution through weight, you only need to clarify the following issues to know how to write the configuration:
- Whether you want to modify the configuration of the entire application or a service.
scope: application, key: app-name(you can also use
servicesto specify certain services).
scope: service, key:group+service+version.
- Whether the address list configuration takes effect only for some specific instances.
- All instances:
addresses: ["0.0.0.0:*"]depends on the side value.
- Specified instances:
addersses[list of instance addresses].
- All instances:
- The weight to modify.
Select the application related to the weight configuration to trigger the call verification.