-
Notifications
You must be signed in to change notification settings - Fork 23
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
Bandwidth recommendations for direct copy #2884
base: main
Are you sure you want to change the base?
Conversation
20281ad
to
1f10e5e
Compare
1f10e5e
to
102b8ad
Compare
7302424
to
ad8643b
Compare
076c215
to
26a408f
Compare
message TDiskAgentThrottlingConfig | ||
{ | ||
// Host limits. | ||
optional string InfraThrottlingConfigPath = 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.
Поле InfraThrottlingConfigPath уже есть в настройках тротлера NBS.
Если файл не получилось прочитать будет использован дефолт DefaultNetworkMbitThroughput
optional double DirectCopyBandwidthFraction = 3; | ||
|
||
// Maximum bandwidth for one device in MiB/s. | ||
optional uint64 MaxDeviceBandwidthMiB = 4; |
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.
Нужно ограничить нагрузку на один девайс, потому что если сеть быстрая, то просядут клиентские записи в девайс, куда проводится копирование.
Rack | ||
); | ||
Rack, | ||
HostPerformanceProfile.NetworkMbitThroughput); |
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.
если дискагент создается в процессе NBS то берем полосу сетевого интерфейса, которую зачитал тротлер NBSа. Чтобы не читать файл еще раз.
//////////////////////////////////////////////////////////////////////////////// | ||
|
||
std::optional<NJson::TJsonValue> ReadJsonFile( |
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.
копипаста по парсингу файла от инфры https://github.com/ydb-platform/nbs/blob/main/cloud/blockstore/libs/daemon/common/config_initializer.cpp#L168
@@ -20,6 +20,7 @@ class TDirectCopyActor final | |||
const NActors::TActorId Source; | |||
const TRequestInfoPtr RequestInfo; | |||
const NProto::TDirectCopyBlocksRequest Request; | |||
const ui64 RecommendedBandwidth; |
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.
RecommendedBandwidth заполняется при создании актора. Он подмешивает это в ответ перед отправкой клиенту.
@@ -71,6 +72,8 @@ class TDiskAgentActor final | |||
// Pending WaitReady requests | |||
TDeque<TPendingRequest> PendingRequests; | |||
|
|||
TBandwidthCalculator BandwidthCalculator {*AgentConfig}; |
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.
BandwidthCalculator один на сервер.
TInstant now) | ||
{ | ||
DeviceLastRequest[deviceUUID] = now; | ||
ClearHistory(now - WindowDuration); |
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 (msg->AllZeroes) { | ||
ChangedRangesMap.MarkNotChanged(msg->Range); | ||
} | ||
TimeoutCalculator->SetRecommendedBandwidth(msg->RecommendedBandwidth); |
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.
после получения рекомендации сохраняем ее в TimeoutCalculator и он будет использовать ее при расчетах таймаутов между запросами.
@@ -77,6 +77,13 @@ FileDevices: { | |||
BlockSize: 4096 | |||
} | |||
|
|||
ThrottlingConfig: { |
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.
для упрощения локальной разработки
Продолжение #2368
Здесь делается ограничение по скорости со стороны ДискАгента.