Qatzstd Compressor

Qatzstd compressor provides Envoy with faster hardware-accelerated zstd compression by integrating with Intel® QuickAssist Technology (Intel® QAT) through the qatlib and QAT-ZSTD-Plugin libraries.

Example configuration

An example for Qatzstd compressor configuration is:

static_resources:
  listeners:
  - address:
      socket_address:
        address: 0.0.0.0
        port_value: 10000
    filter_chains:
    - filters:
      - name: envoy.filters.network.http_connection_manager
        typed_config:
          "@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
          stat_prefix: ingress_http
          route_config:
            name: local_route
            virtual_hosts:
            - name: backend
              domains:
              - "*"
              routes:
              - match:
                  prefix: "/"
                route:
                  cluster: service
          http_filters:
          - name: envoy.filters.http.compressor
            typed_config:
              "@type": type.googleapis.com/envoy.extensions.filters.http.compressor.v3.Compressor
              response_direction_config:
                common_config:
                  min_content_length: 100
                  content_type:
                  - application/octet-stream
                disable_on_etag_header: false
              compressor_library:
                name: text_optimized
                typed_config:
                  "@type": type.googleapis.com/envoy.extensions.compression.qatzstd.compressor.v3alpha.Qatzstd
                  compression_level: 9
                  enable_qat_zstd: true
                  chunk_size: 65536
                  qat_zstd_fallback_threshold: 0
          - name: envoy.filters.http.router
            typed_config:
              "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
  clusters:
  - name: service
    connect_timeout: 0.25s
    type: STRICT_DNS
    lb_policy: ROUND_ROBIN
    load_assignment:
      cluster_name: service
      endpoints:
      - lb_endpoints:
        - endpoint:
            address:
              socket_address:
                address: 127.0.0.1
                port_value: 1234
admin:
  address:
    socket_address:
      address: 0.0.0.0
      port_value: 9901

How it works

If enabled, the Qatzstd compressor will:

  • attach Qat hardware

  • create Threadlocal Qatzstd context for each worker thread

When new http package come, one worker thread will process it using its Qatzstd context and send the data needed to be compressed to Qat hardware using standard zstd api.

Installing and using QAT-ZSTD-Plugin

For information on how to build/install and use QAT-ZSTD-Plugin see introduction.