Skip to content

"Loading balancing" doesn't actually work #1046

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

Closed
ino-josh opened this issue Jun 5, 2025 · 2 comments
Closed

"Loading balancing" doesn't actually work #1046

ino-josh opened this issue Jun 5, 2025 · 2 comments

Comments

@ino-josh
Copy link

ino-josh commented Jun 5, 2025

pick_io_context_idx in http_server.h has a comment: "TODO improve load balancing".
It turns out the existing load balancing doesn't even work! 🥴
The "task queue length" stored for each io context is incremented each time the context is used, but it is never decremented (unless there is an error; see do_accept in http_server.h).
As a result there is no "load balancing", but it just continuously sequentially picks the next io context.
And as a result of that, you will see a stall if you have a long running request, because it doesn't correctly choose an io context with a lower task queue length.

The intent seems to be there, as the task queue length is passed to the Connection, stored as queue_length_.
From what I can tell, what should happen is queue_length_ is decremented in the destructor of Connection. Currently, Connection does nothing at all with queue_length_.

@gittiver
Copy link
Member

gittiver commented Jun 6, 2025

closed, intent not clear.

@gittiver gittiver closed this as completed Jun 6, 2025
@ino-josh
Copy link
Author

ino-josh commented Jun 6, 2025

closed, intent not clear.

I'm sorry, what isn't clear? Maybe ask for more information before closing the issue?

@gittiver gittiver closed this as not planned Won't fix, can't repro, duplicate, stale Jun 6, 2025
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

No branches or pull requests

2 participants