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
rgw: disable prefetch in rgw_file to fix 3x read amplification #38167
rgw: disable prefetch in rgw_file to fix 3x read amplification #38167
Conversation
Each call to rgw_read (rgw_file.cc) invokes three calls to RGWRados::get_obj_state with s->prefetch_data=true. It results in great read amplification. If length argument in rgw_read call is smaller than rgw_max_chunk_size, then the amplification is threefold. Signed-off-by: Kajetan Janiak <kjaniak@cloudferro.com>
@kajetanJ thanks for spotting this; at the moment, I think it probably is correct to avoid prefetching in general, but we might be able to address this in future and also take advantage of range prefetch (@ofriedma) and some additional infrastructure to get benefit from prefetch in future? It's definitely not intended that there be multiple prefetch attempts, so we'd have to fix that, also |
@kajetanJ can you create a tracker issue and attach it to his PR? |
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 (but please update with tracker issue)
@mattbenjamin my account on tracker is pending administrator approval. Would you like me to include all reproduction steps or just describe the issue? |
@kajetanJ either is fine; what's your account name in tracker? I can try to expedite it |
@mattbenjamin it is |
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 think it would be with less changes just to change line 1975 from true to false
RGWGetObj::get_data = false; // XXX
I don't agree with this advice. @kajetanJ 's proposal is fine, and will inline just fine. Matt |
@mattbenjamin Tracker issue added (link in the first comment).
it would cause problems in
|
Could we backport this to Nautilus? |
Just mark the tracker with the backports you want. |
@dang it seems I can't edit an existing issue, so I added a note |
done: we want octopus, nautilus, I believe |
@dang tested by hand in a Nautilus backport, passed librgw_file_nfsns, the main unit file. |
I've proved non-regression in unit tests run by hand, maybe worth confirming perf result |
rgw: This PR disables prefetch in rgw_file (used by NFS-Ganesha).
Each call to
rgw_read
(rgw_file.cc
) invokes three calls toRGWRados::get_obj_state
withRGWObjState::prefetch_data = true
. It results in great read amplification. Iflength
argument inrgw_read
call is smaller thanrgw_max_chunk_size
, then the amplification is threefold.Tracker issue: https://tracker.ceph.com/issues/48289
Signed-off-by: Kajetan Janiak kjaniak@cloudferro.com