Application protection rule FAQ

Updated at:

This topic lists frequently asked questions about application protection rules.

  1. When I add a rule on the request trace page, does it apply to a single machine or all machines?

    The rule is pushed to all machines.

  2. What does "source application" mean in a throttling rule?

    Sentinel supports throttling based on the call source. In a throttling rule, the source application is the identity of the caller that invokes the resource. For example, in Dubbo, this corresponds to the application name of the Dubbo Consumer. The default source application is set to default, which means that calls from all source applications are processed.

  3. What do the different throttling patterns in a throttling rule mean?

    • Direct: Throttles traffic based on the call source of the current resource. If the source is default, calls from all sources are processed.
    • Associate: When two resources have a dependency, this pattern throttles traffic to the current resource based on the traffic of the associated resource.

      For example, consider two resources: read_db and write_db, which represent database reads and writes. You can set a throttling rule for read_db to prioritize writes. Set the associated resource to write_db. This way, if write operations become too frequent, read requests are throttled.

    • Chain: Throttles traffic based on the entry point of a call chain. You must configure the entry resource in the rule, which is the context name of the call chain's entry point.
  4. What do the different throttling methods in a throttling rule mean?

    • Fail fast: Immediately rejects requests when the threshold is reached.
    • Warm Up: When traffic suddenly increases, this method gradually transitions the system from an idle to a busy state. If the system has been idle for a long time, the request processing rate increases slowly over a preset period until it reaches the configured threshold. By default, the Queries Per Second (QPS) starts at one-third of the configured QPS threshold and gradually increases.
    • Queue: Processes requests at a steady rate and queues excess requests. This method is often used for peak-load shifting. For example, if you set the QPS to 5, only one request can pass every 200 ms. Additional requests are queued. The timeout period represents the maximum queueing time. Requests that exceed this time are rejected immediately. Note: In queue mode, do not set the QPS to more than 1,000 (a request interval of 1 ms).
  5. What do the RT pattern and abnormal ratio pattern mean in a circuit breaking rule?

    Sentinel circuit breaking supports two policies:

    • Response time (RT): Breaks the circuit based on the average response time (RT), measured in milliseconds. If the average RT of five consecutive requests exceeds the threshold, the circuit is automatically broken.
    • Abnormal ratio: Breaks the circuit based on the ratio of abnormal requests. When the ratio of abnormal requests to passed requests within a one-second statistical window exceeds the threshold, the resource enters a circuit breaking state.

    After a resource enters a circuit breaking state, all requests fail fast during the configured circuit breaking window.

  6. What is a system protection rule?

    A system protection rule throttles traffic based on system metrics, such as inbound QPS, RT, thread count, and load. This allows the system to run at its maximum throughput while maintaining overall stability. System protection rules apply to the entire system, not to individual resources, and affect only inbound traffic. Inbound traffic refers to traffic entering an application, such as requests received by a web service or a Dubbo server.

    System rules support the following types:

    • System Load (load1): Throttles traffic based on the system's load1 and real-time throughput.
    • Overall average RT: Triggers system protection when the average RT of all inbound traffic on a single machine reaches the threshold.
    • Overall QPS: Triggers system protection when the QPS of all inbound traffic on a single machine reaches the threshold.
    • Overall thread count: Triggers system protection when the number of concurrent threads for all inbound traffic on a single machine reaches the threshold.

    An application can have only one rule of each system protection type.