New Fluxzy v2 just shipped. Electron is out, Tauri is in. gRPC ready, 3x smaller install. Learn more

averageThrottleAction Action

Cap the bandwidth on matching exchanges so you can reproduce slow mobile, satellite, or congested network conditions deterministically.

Slow network bugs are notoriously hard to reproduce. Browser dev tools throttle just the page, OS settings throttle everything, and real cell signal is unpredictable. averageThrottleAction sits in the middle: you pick exactly which exchanges to slow down, you choose how much, and the cap is deterministic enough to put in a regression test.

When to use this action

Use averageThrottleAction when you want to validate how your application behaves on a slow connection. Browser dev tools offer rough emulation, but they only affect the browser. Throttling at the proxy layer gives consistent results across browsers, native apps, scripts, and tests.

Typical situations include:

  • Reproducing a user report of a slow checkout on mobile data.
  • Verifying that a download client pauses and resumes correctly on a flaky link.
  • Stress testing a streaming player at a specific bitrate to find the breakpoint.
  • Catching missing progress indicators or timeouts that only fail under load.

The action evaluates on requestHeaderReceivedFromClient. Use throttleChannel to choose between throttling the upload, the download, or both directions.

Real world examples

Throttle a media host to mobile data speed

Cap a streaming endpoint to roughly 500 kbps to see how the player adapts.

rules:
- filter:
    typeKind: HostFilter
    pattern: media.example.com
  actions:
  - typeKind: AverageThrottleAction
    bandwidthBytesPerSeconds: 65536
    throttleChannel: All

Throttle only uploads to a file storage endpoint

Useful when validating that a large upload UI shows progress, retries, and cancellation correctly.

rules:
- filter:
    typeKind: FilterCollection
    operation: And
    children:
    - typeKind: HostFilter
      pattern: files.example.com
    - typeKind: PathFilter
      pattern: /upload
  actions:
  - typeKind: AverageThrottleAction
    bandwidthBytesPerSeconds: 32768
    throttleChannel: Upload

Throttle one specific app while letting the rest of the traffic run full speed

Pair with a process filter so only the app under test is slowed down. Everything else on the developer machine stays usable.

rules:
- filter:
    typeKind: ProcessNameFilter
    pattern: my-mobile-emulator
  actions:
  - typeKind: AverageThrottleAction
    bandwidthBytesPerSeconds: 16384
    throttleChannel: Download

Reference

averageThrottleAction

Description

Throttle and simulate bandwidth condition.

Evaluation scope

Evaluation scope defines the timing where this filter will be applied.

requestHeaderReceivedFromClient This scope occurs the moment fluxzy parsed the request header receiveid from client

YAML configuration name

averageThrottleAction

Settings

This action has no specific characteristic

Example of usage

The following examples apply this action to any exchanges

Throttle and simulate bandwidth condition.

rules:
- filter:
    typeKind: AnyFilter
  actions:
  - typeKind: AverageThrottleAction
    bandwidthBytesPerSeconds: 65536
    throttleChannel: All

.NET reference

View definition of AverageThrottleAction for .NET integration.

See also

This action has no related action

Frequently asked questions

Why use a proxy to throttle when the OS or browser can do it?

OS level throttling is global and intrusive, and browser throttling does not apply to native apps or background processes. Fluxzy throttles only the exchanges that match your filter, which is more precise and easier to share with teammates.

Is the bandwidth applied per exchange or shared across all matching traffic?

The cap is enforced per exchange in the matched channel direction. Two concurrent downloads from the same host can each receive up to the configured rate.

Can I simulate added latency on top of throttling?

Yes. Stack with delayAction to add a fixed delay before the throttled bytes start flowing.

What units does bandwidthBytesPerSeconds use?

Bytes per second. 65536 is roughly 64 KB/s or 512 kbps, comparable to a poor 3G connection.

Learn more about Fluxzy rules