-
Notifications
You must be signed in to change notification settings - Fork 47
Implement best-of-two scheduling #872
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements the "power of two choices" (best-of-two) load balancing algorithm for drone selection, replacing the previous approach that sorted all drones by backend count. The new algorithm randomly selects two candidate drones and chooses the one with the lowest backend count, providing nearly optimal load distribution with better performance characteristics.
Key changes:
- Modified SQL query to return 2 random drones with their backend counts instead of 1 pre-sorted drone
- Implemented application-side selection of the drone with minimum backend count from the two candidates
- Added reference to academic paper documenting the best-of-two scheduling approach
Files not reviewed (2)
- plane/.sqlx/query-7cd9d4b058691049f957bb1b03acda2eaa755c20798f2f744fe51ba92c2d295b.json: Language not supported
- plane/.sqlx/query-cc4bc25932348053c5772632c5be3b9ee1e6a73798340d11950486cc16a6c81c.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
rolyatmax
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM once the non-cert tests pass
No description provided.