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

feat(server): flush slots traverse better yield #4821

Merged
merged 5 commits into from
Mar 26, 2025
Merged

Conversation

adiholden
Copy link
Collaborator

No description provided.

Comment on lines 845 to 846
int64_t exec_time_ms = (after - start) / 1000000;
if (exec_time_ms > 10) {
Copy link
Contributor

Choose a reason for hiding this comment

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

NIce, as discussed

Copy link
Collaborator

Choose a reason for hiding this comment

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

10ms is a lot, imho. why not reduce to 1?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ok we can do 1ms

Copy link
Contributor

Choose a reason for hiding this comment

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

@romange do we have anything cheaper than GetCurrentTimeNanos(), because we need ms precision

Copy link
Collaborator

Choose a reason for hiding this comment

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

i think GetCurrentTimeNanos() is ok here, given that we do not run the function frequently.

kostasrim
kostasrim previously approved these changes Mar 24, 2025
Copy link
Contributor

@kostasrim kostasrim left a comment

Choose a reason for hiding this comment

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

LGTM

if (i % 100 == 0) {
int64_t after = absl::GetCurrentTimeNanos();
int64_t exec_time_ms = (after - start) / 1000000;
if (exec_time_ms > 10) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Since we use micro in all of our statistics maybe worth keeping that unit ?

auto iterate_bucket = [&](PrimeTable::bucket_iterator it) {
it.AdvanceIfNotOccupied();
while (!it.is_done()) {
del_entry_cb(it);
Copy link
Collaborator

Choose a reason for hiding this comment

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

del_entry_cb is redundant now. why not move its implementation here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

you are right, this was just easy for me to test this with moving back and forward with TraverseBuckets/Traverse to see the impact of this change

@@ -787,13 +787,16 @@ void DbSlice::Del(Context cntx, Iterator it) {
}

void DbSlice::FlushSlotsFb(const cluster::SlotSet& slot_ids) {
VLOG(3) << "Start FlushSlotsFb";
Copy link
Contributor

@BorysTheDev BorysTheDev Mar 24, 2025

Choose a reason for hiding this comment

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

I suggest making it 2 or even 1, because it's not often operation

Signed-off-by: adi_holden <[email protected]>
Signed-off-by: adi_holden <[email protected]>
BorysTheDev
BorysTheDev previously approved these changes Mar 24, 2025
Signed-off-by: adi_holden <[email protected]>
romange
romange previously approved these changes Mar 26, 2025
Signed-off-by: adi_holden <[email protected]>
Copy link
Contributor

@kostasrim kostasrim left a comment

Choose a reason for hiding this comment

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

🚢 🇮🇹 👩‍🍳

@adiholden adiholden merged commit f8558e9 into main Mar 26, 2025
10 checks passed
@adiholden adiholden deleted the fix_flushslots branch March 26, 2025 08:41
romange pushed a commit that referenced this pull request Mar 26, 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

Successfully merging this pull request may close these issues.

4 participants