Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dlb: add how to use #33818

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -0,0 +1,45 @@
static_resources:
listeners:
- address:
socket_address:
address: 0.0.0.0
port_value: 10000
connection_balance_config:
extend_balance:
name: envoy.network.connection_balance.dlb
typed_config:
"@type": type.googleapis.com/envoy.extensions.network.connection_balance.dlb.v3alpha.Dlb
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
codec_type: AUTO
stat_prefix: ingress_http
route_config:
name: local_route
virtual_hosts:
- name: backend
domains:
- "*"
routes:
- match:
prefix: "/"
route:
cluster: service1
http_filters:
- name: envoy.filters.http.router
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router

clusters:
- name: service1
load_assignment:
cluster_name: service1
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: 127.0.0.1
port_value: 12000
51 changes: 41 additions & 10 deletions docs/root/configuration/other_features/dlb.rst
@@ -1,19 +1,19 @@
.. _config_connection_balance_dlb:

Dlb Connection Balancer
DLB Connection Balancer
=======================

* :ref:`v3 API reference <envoy_v3_api_msg_extensions.network.connection_balance.dlb.v3alpha.Dlb>`


This connection balancer extension provides Envoy with low latency networking by integrating with `Intel DLB <https://networkbuilders.intel.com/solutionslibrary/queue-management-and-load-balancing-on-intel-architecture>`_ through the libdlb library.

The Dlb connection balancer is only included in :ref:`contrib images <install_contrib>`
The DLB connection balancer is only included in :ref:`contrib images <install_contrib>`.

Example configuration
---------------------

An example for Dlb connection balancer configuration is:
An example for DLB connection balancer configuration is:

.. literalinclude:: _include/dlb.yaml
:language: yaml
Expand All @@ -22,18 +22,49 @@ An example for Dlb connection balancer configuration is:
How it works
------------

If enabled, the Dlb connection balancer will:
If enabled, the DLB connection balancer will:

- attach Dlb hardware
- attach DLB hardware
- create a queue for balancing
- create one port to send and one port to receive for each worker thread
- create one eventfd for each worker thread and attach each eventfd to corresponding customer
- register each eventfd to corresponding customer and Dlb hardware
- register each eventfd to corresponding customer and DLB hardware

When new connections come, one worker thread will accept it and send it to Dlb hardware. Dlb hardware
When new connections come, one worker thread will accept it and send it to DLB hardware. DLB hardware
does balancing then trigger one worker thread to receive via libevent.

Installing and using Dlb
------------------------
Installing DLB
--------------

For information on how to build/install and use libdlb see `the getting started guide <https://downloadmirror.intel.com/727424/DLB_Driver_User_Guide.pdf>`_.
You can download the DLB driver release tarball from the `DLB website <https://www.intel.com/content/www/us/en/download/686372/intel-dynamic-load-balancer.html>`_. To install it refer to `the getting started guide <https://downloadmirror.intel.com/727424/DLB_Driver_User_Guide.pdf>`_.


Using DLB
---------

With the example configuration Envoy listens on port 10000 and proxies to an upstream server listening on port 12000.

.. literalinclude:: _include/dlb_example_config.yaml
:language: yaml
Copy link
Member

@phlax phlax May 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you add linenos, lineno-start and a caption with download link please

to see existing examples you can do something like git grep lineno-start docs/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets highlight lines 7-11 - also not sure we need the entire file included as it can be downloaded

when including only a part of the config i tend to include 2 lines before and after

:lines: 7-11
:lineno-start: 7
:linenos:
:caption: :download:`dlb_example_config.yaml <_include/dlb_example_config.yaml>`

Run the upstream service:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets remove this - no need to mention nginx - better to be upstream agnostic


.. code-block:: console

$ docker run -d -p 12000:80 nginx

Run Envoy with DLB connection balancer enabled:

.. code-block:: console

$ ./envoy --concurrency 2 -c dlb_example_config.yaml

Test:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure we need this section at all - this kinda instruction would be more suited to sandbox/examples - here we are just showing the necessary/minimum configuration to make it work

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the "upstream" part and "test" part, I put those here since CI do not have DLB device and cannot run this feature, so I do not put those to sandbox/examples.

My goal is to make an complete example to users, if possible, maybe do not do verify, I can move those to examples, which is more suitable.


.. code-block:: console

$ curl localhost:10000