Skip to content

Listener: extend connection balancer#20268

Merged
phlax merged 73 commits intoenvoyproxy:mainfrom
daixiang0:extend-cb
Jun 22, 2022
Merged

Listener: extend connection balancer#20268
phlax merged 73 commits intoenvoyproxy:mainfrom
daixiang0:extend-cb

Conversation

@daixiang0
Copy link
Copy Markdown
Member

@daixiang0 daixiang0 commented Mar 9, 2022

Signed-off-by: Loong Dai loong.dai@intel.com

Extend the connection balancer, support implement connection balancer as an extension.

Also provide a implement with the help of DLB hardware.

Intel® Dynamic Load Balancer (Intel® DLB) is a hardware managed system of queues and arbiters connecting producers and consumers. It is a PCI device envisaged to live in the server CPU uncore and can interact with software running on cores, and potentially with other devices. More details please refer to https://www.intel.com/content/www/us/en/download/686372/intel-dynamic-load-balancer.html.

Commit Message: Extend the connection balancer, support implement connection balancer as an extension.
Additional Description:
Risk Level:
Testing:
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]

@repokitteh-read-only
Copy link
Copy Markdown

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to (api/envoy/|docs/root/api-docs/).
envoyproxy/api-shepherds assignee is @lizan
CC @envoyproxy/api-watchers: FYI only for changes made to (api/envoy/|docs/root/api-docs/).

🐱

Caused by: #20268 was opened by daixiang0.

see: more, trace.

@daixiang0 daixiang0 marked this pull request as draft March 9, 2022 08:00
@daixiang0 daixiang0 marked this pull request as ready for review March 14, 2022 03:31
@daixiang0
Copy link
Copy Markdown
Member Author

/retest

@repokitteh-read-only
Copy link
Copy Markdown

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #20268 (comment) was created by @daixiang0.

see: more, trace.

Copy link
Copy Markdown

@KfreeZ KfreeZ left a comment

Choose a reason for hiding this comment

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

maybe add some comments on what the extend_loadbalance is.

@daixiang0
Copy link
Copy Markdown
Member Author

maybe add some comments on what the extend_loadbalance is.

It is hard to say as it depends on implement :(

@daixiang0
Copy link
Copy Markdown
Member Author

@lizan what else should I do?

@daixiang0
Copy link
Copy Markdown
Member Author

Sorry for the force push due to the wrong sign-off.

Signed-off-by: Loong Dai <loong.dai@intel.com>
Signed-off-by: Loong Dai <loong.dai@intel.com>
Signed-off-by: Loong Dai <loong.dai@intel.com>
@daixiang0
Copy link
Copy Markdown
Member Author

@mattklein123 hi, I want to ask a question:
Now we use ActiveTcpListener to post socket to balance, which is totally software level. Now I want to extend it offload, my basic thought is that send the connection to the hardware by pickTargetHandler, then register a callback to listen to events from the hardware and continue to handle connections by registerHandler. But in this way, I can not call ActiveTcpListener::onAcceptWorker since ExtendBalancer is a parent but ActiveTcpListener is a child, direct call breaks inheritance relationship(I do not like it). Can I call onSocketAccepted directly?

The old abstract flow:
connection accepted -> pick the most free thread -> if itself -> handle connection
| -> if not -> send connection to it -> handle connection
The new abstract flow:
connection accepted -> send the connection to the hardware
a thread selected by the hardware get the connection by event -> handle connection

@mattklein123
Copy link
Copy Markdown
Member

Sorry it's hard for me to follow what you are trying to achieve and/or the questions you have. At a high level, post is asynchronous. As such, you should be able to post once you figure out where you want to send the event. If you want to do a small design document that might help to have a bigger picture of what you are trying to achieve.

@daixiang0
Copy link
Copy Markdown
Member Author

@mattklein123 thanks for your input, I will create a doc with code flow, it may help you understand.

@adisuissa
Copy link
Copy Markdown
Contributor

/wait-any

@daixiang0 daixiang0 marked this pull request as draft April 1, 2022 00:48
@daixiang0
Copy link
Copy Markdown
Member Author

daixiang0 commented Apr 7, 2022

@mattklein123 @lizan sorry for the slow process of design, here is the link, please let me know if anything wrong.

@daixiang0
Copy link
Copy Markdown
Member Author

daixiang0 commented Apr 7, 2022

Also I find that connection balance does not have its own factory, but socket(SocketInterfaceBase) does. For extension purposes, need I also implement something like SocketInterfaceBase to make it easier to extend?

In the design, I create one factory only for one case.

@mattklein123
Copy link
Copy Markdown
Member

Please make the design doc world readable. Thank you.

@daixiang0
Copy link
Copy Markdown
Member Author

daixiang0 commented Apr 8, 2022

@mattklein123 Oops, I have updated the link, it is a very initial version to iterate on, please try again, thanks a lot!

@daixiang0 daixiang0 marked this pull request as ready for review April 18, 2022 01:32
@daixiang0
Copy link
Copy Markdown
Member Author

/wait for design review

Signed-off-by: Loong Dai <loong.dai@intel.com>
Signed-off-by: Loong Dai <loong.dai@intel.com>
Signed-off-by: Loong Dai <loong.dai@intel.com>
Signed-off-by: Loong Dai <loong.dai@intel.com>
@daixiang0
Copy link
Copy Markdown
Member Author

/assign-from @envoyproxy/api-shepherds @envoyproxy/dependency-shepherds

@repokitteh-read-only
Copy link
Copy Markdown

@envoyproxy/api-shepherds assignee is @mattklein123
@envoyproxy/dependency-shepherds assignee is @mattklein123

🐱

Caused by: a #20268 (comment) was created by @daixiang0.

see: more, trace.

@daixiang0
Copy link
Copy Markdown
Member Author

@mattklein123 friendly ping :)

Signed-off-by: Loong Dai <loong.dai@intel.com>
@daixiang0
Copy link
Copy Markdown
Member Author

/retest

@repokitteh-read-only
Copy link
Copy Markdown

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #20268 (comment) was created by @daixiang0.

see: more, trace.

Copy link
Copy Markdown
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

Thanks!

@repokitteh-read-only repokitteh-read-only bot removed api deps Approval required for changes to Envoy's external dependencies labels Jun 22, 2022
@mattklein123
Copy link
Copy Markdown
Member

@phlax can you approve/merge when you are satisfied?

@mattklein123 mattklein123 assigned phlax and unassigned mattklein123 Jun 22, 2022
Copy link
Copy Markdown
Member

@phlax phlax left a comment

Choose a reason for hiding this comment

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

lgtm, thanks @daixiang0 - great work, cool addition!

@phlax phlax merged commit 2167cb3 into envoyproxy:main Jun 22, 2022
@daixiang0 daixiang0 deleted the extend-cb branch June 23, 2022 00:21
@daixiang0
Copy link
Copy Markdown
Member Author

@mattklein123 @phlax thanks for your review and help!

Amila-Rukshan pushed a commit to Amila-Rukshan/envoy that referenced this pull request Jun 28, 2022
Signed-off-by: Loong Dai <loong.dai@intel.com>
Signed-off-by: Amila Senadheera <amila.15@cse.mrt.ac.lk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants