-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Improve the Backend's disk info report performance #349
Conversation
1. Use the data size save in tablet's header to calculate the disk used capacity. 2. Decrease the default interval of disk and tablet report, from 10 min to 1 min.
info.capacity = 1; | ||
info.data_used_capacity = 0; | ||
info.available = 0; | ||
_get_path_available_capacity(info.path, &info.available); |
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.
If you get the value capacity, it may be better to get available by capacity minus data_used_capacity?
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.
For now, available capacity does not equal to the capacity - data_used_capacity
;
Actually, capacity = data_used_capacity + available_capacity + other_used_capacity.
other_used_capacity
includes logs/, trash/, mini_download/, meta/, etc, which are not included in data_used_capacity
.
path_map.emplace(path, it.second->to_root_path_info()); | ||
// if this path is not used, init it's info | ||
if (!path_map[path].is_used) { | ||
path_map[path].capacity = 1; |
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.
It seems that value of capacity variable is not updated?
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.
Capacity is set in Store.cpp. And I think the capacity will not change. If it changes, the Backend process must be restarted and the capacity is set when store is being initialized.
ISSUE: #348