-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add fetch_by_key_in_parallel to fix #764 #22
Conversation
@yosukehara Also please check the comment here: leo-project/leofs#764 (comment) @windkit Can you benchmark the delete-bucket performance on RIT env with the patch below for leo_storage. diff --git a/apps/leo_storage/src/leo_storage_handler_object.erl b/apps/leo_storage/src/leo_storage_handler_object.erl
index bad8275..a94aee9 100644
--- a/apps/leo_storage/src/leo_storage_handler_object.erl
+++ b/apps/leo_storage/src/leo_storage_handler_object.erl
@@ -1076,7 +1076,7 @@ prefix_search_and_remove_objects(MQId, ParentDir, EnqueuedAt) ->
end
end
end,
- case catch leo_object_storage_api:fetch_by_key(ParentDir, Fun) of
+ case catch leo_object_storage_api:fetch_by_key_in_parallel(ParentDir, Fun, undefined) of
{'EXIT', Cause} ->
{error, Cause};
{ok,_} -> It should be almost same as without PR however I have a bit concern especially in case the number of AVS files is huge (256 - 512) |
@mocchira WIP |
@mocchira When I try to compile with
and I cannot put any object to LeoFS. Do you think any things I am missing here?
|
@windkit how about running ./git_checkout develop between step 1 and 2? |
@mocchira Thank you, now it is working. |
@mocchira From my testing, the initial enqueuing phase is quicker, but afterwards the consumption phase seems to be run in the same speed, does the above commit change that? |
Version 1.3.8PR (before the d17c49e |
It should keep the same behavior. (maybe initial enqueuing phase gets a bit slow down due to the additional cpu cost to make the distribution as uniform as possible although quicker than 1.3.8) anyway, there is still room to make the distribution more uniform by tuning some hard coded values so I'll ask you the benchmark again once the final optimization finished. |
@windkit Please benchmark again with the latest PR. also just in case let me confirm that what is set to num_of_containers? (256 or 512 would be desirable as I mentioned above) |
PR (avs, 256)@mocchira I am not seeing much difference with number of avs = 8 and 1.3.8 |
@windkit Thanks. It looks good to me. |
@mocchira it makes me wonder where is the bottleneck here, neither CPU / IO seems to be fully utilized. |
@windkit The original problem can be found on here leo-project/leofs#725 (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.
I've reviewed this PR. Can you confirm the comment?
src/leo_object_storage_api.erl
Outdated
end, | ||
NewCounter = Counter + 1, | ||
erlang:put(counter, NewCounter), | ||
case NewCounter rem 5 of |
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.
5
, as a trivial thing, I think that its value should be a constant.
@yosukehara Fixed. PTAL. |
@mocchira Merged, thanks |
@mocchira but the result still shows that neither CPU nor IO got fully utilized, are there other bottlenecks? |
@windkit Yes probably software locks happened on eleveldb thread pool management/erlang runtime and/or OS thread scheduling especially for ones spawned by eleveldb thread pool. I think we can improve CPU/IO utilization in case dealing with many AVS files by tuning https://github.com/basho/eleveldb/blob/develop/c_src/eleveldb.cc#L223 which has been used as default(71) on leofs so changing it to the number of AVS files could improve CPU/IO utilization. |
filed on leo-project/leofs#970 |
No description provided.