Connectors Traffic Shaping Configuration
Manage traffic between the router and REST API endpoints
Connectors support the router's traffic shaping features to improve the performance and reliability of traffic between clients and the router and between the router and Connector sources. Connectors support all traffic shaping features, except query deduplication.
You can configure traffic shaping for all Connectors or a specific Connector source.
To configure all Connectors, set traffic shaping configurations on
traffic_shaping.connector.all
.To configure a specific Connector source, set traffic shaping configurations on
traffic_shaping.connector.sources.X
whereX
is yoursubgraph_name.source_name
.If you configure both, specific Connector source configurations override configurations set on
traffic_shaping.connector.all
.
Example traffic shaping configuration
The example configuration below sets a rate limit and timeout for all Connectors and overrides the configuration for the v1
source on the example
subgraph. It also sets HTTP/2 protocol for all subgraph connections.
traffic_shaping:
connector:
# Set traffic shaping configurations for all Connectors
all:
global_rate_limit:
capacity: 50
interval: 1s
timeout: 5s
experimental_http2: http2only
# Override global setting for specific sources
sources:
subgraph1.endpoint1:
global_rate_limit:
capacity: 20
interval: 1s
timeout: 1s