Skip to content

Commit

Permalink
Add cost estimator for SSD (#1480)
Browse files Browse the repository at this point in the history
  • Loading branch information
serbel324 authored Jan 31, 2024
1 parent 458220e commit a456eb6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ const TDiskOperationCostEstimator TBsCostModelBase::HDDEstimator{
{ 6.089e+06, 8.1 }, // HugeWriteCoefficients
};

const TDiskOperationCostEstimator TBsCostModelBase::SSDEstimator{
{ 180000, 3.00 }, // ReadCoefficients
{ 430, 4.2 }, // WriteCoefficients
{ 110000, 3.6 }, // HugeWriteCoefficients
};

const TDiskOperationCostEstimator TBsCostModelBase::NVMEEstimator{
{ 10000, 1.3 }, // ReadCoefficients
{ 3300, 1.5 }, // WriteCoefficients
Expand Down
10 changes: 10 additions & 0 deletions ydb/core/blobstorage/vdisk/common/blobstorage_cost_tracker.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class TBsCostModelBase {
ui64 PDiskWriteBlockSize = 4ull * 1'000'000; // 4MB

static const TDiskOperationCostEstimator HDDEstimator;
static const TDiskOperationCostEstimator SSDEstimator;
static const TDiskOperationCostEstimator NVMEEstimator;

private:
Expand Down Expand Up @@ -100,6 +101,9 @@ class TBsCostModelBase {
case NPDisk::DEVICE_TYPE_ROT: {
return HDDEstimator.Write(chunkSize);
}
case NPDisk::DEVICE_TYPE_SSD: {
return SSDEstimator.Write(chunkSize);
}
case NPDisk::DEVICE_TYPE_NVME: {
return NVMEEstimator.Write(chunkSize);
}
Expand All @@ -116,6 +120,9 @@ class TBsCostModelBase {
case NPDisk::DEVICE_TYPE_ROT: {
return HDDEstimator.HugeWrite(chunkSize);
}
case NPDisk::DEVICE_TYPE_SSD: {
return SSDEstimator.HugeWrite(chunkSize);
}
case NPDisk::DEVICE_TYPE_NVME: {
return NVMEEstimator.HugeWrite(chunkSize);
}
Expand All @@ -133,6 +140,9 @@ class TBsCostModelBase {
case NPDisk::DEVICE_TYPE_ROT: {
return HDDEstimator.Read(chunkSize);
}
case NPDisk::DEVICE_TYPE_SSD: {
return SSDEstimator.Read(chunkSize);
}
case NPDisk::DEVICE_TYPE_NVME: {
return NVMEEstimator.Read(chunkSize);
}
Expand Down

0 comments on commit a456eb6

Please sign in to comment.