diff options
author | Sergey Belyakov <serg-belyakov@ydb.tech> | 2024-01-31 17:03:04 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-31 17:03:04 +0300 |
commit | 736e7ff03b96618cbfcc0556cc9d7a88a4d8af82 (patch) | |
tree | f410f098b9d2ccccf97182b1893d6853b0ed32c6 | |
parent | c2c1997e2ba8baaf1c18d3bb169393e1bf3ef0e4 (diff) | |
download | ydb-736e7ff03b96618cbfcc0556cc9d7a88a4d8af82.tar.gz |
Add cost estimator for NVME disks (#1443)
-rw-r--r-- | ydb/core/blobstorage/vdisk/common/blobstorage_cost_tracker.cpp | 6 | ||||
-rw-r--r-- | ydb/core/blobstorage/vdisk/common/blobstorage_cost_tracker.h | 10 |
2 files changed, 16 insertions, 0 deletions
diff --git a/ydb/core/blobstorage/vdisk/common/blobstorage_cost_tracker.cpp b/ydb/core/blobstorage/vdisk/common/blobstorage_cost_tracker.cpp index 689c577bec..87eeafc2e7 100644 --- a/ydb/core/blobstorage/vdisk/common/blobstorage_cost_tracker.cpp +++ b/ydb/core/blobstorage/vdisk/common/blobstorage_cost_tracker.cpp @@ -8,6 +8,12 @@ const TDiskOperationCostEstimator TBsCostModelBase::HDDEstimator{ { 6.089e+06, 8.1 }, // HugeWriteCoefficients }; +const TDiskOperationCostEstimator TBsCostModelBase::NVMEEstimator{ + { 10000, 1.3 }, // ReadCoefficients + { 3300, 1.5 }, // WriteCoefficients + { 50000, 1.83 }, // HugeWriteCoefficients +}; + class TBsCostModelMirror3dc : public TBsCostModelBase { public: TBsCostModelMirror3dc(NPDisk::EDeviceType deviceType) diff --git a/ydb/core/blobstorage/vdisk/common/blobstorage_cost_tracker.h b/ydb/core/blobstorage/vdisk/common/blobstorage_cost_tracker.h index 27b9f9e9c7..baf9f6fa9f 100644 --- a/ydb/core/blobstorage/vdisk/common/blobstorage_cost_tracker.h +++ b/ydb/core/blobstorage/vdisk/common/blobstorage_cost_tracker.h @@ -63,6 +63,7 @@ protected: ui64 PDiskWriteBlockSize = 4ull * 1'000'000; // 4MB static const TDiskOperationCostEstimator HDDEstimator; + static const TDiskOperationCostEstimator NVMEEstimator; private: enum class EMemoryOperationType { @@ -99,6 +100,9 @@ protected: case NPDisk::DEVICE_TYPE_ROT: { return HDDEstimator.Write(chunkSize); } + case NPDisk::DEVICE_TYPE_NVME: { + return NVMEEstimator.Write(chunkSize); + } default: { ui64 seekTime = DeviceSeekTimeNs / 100u; // assume we do one seek per 100 log records ui64 writeTime = chunkSize * 1'000'000'000ull / DeviceWriteSpeedBps; @@ -112,6 +116,9 @@ protected: case NPDisk::DEVICE_TYPE_ROT: { return HDDEstimator.HugeWrite(chunkSize); } + case NPDisk::DEVICE_TYPE_NVME: { + return NVMEEstimator.HugeWrite(chunkSize); + } default: { ui64 blocksNumber = (chunkSize + DeviceWriteBlockSize - 1) / DeviceWriteBlockSize; ui64 seekTime = 1. * blocksNumber * DeviceSeekTimeNs; @@ -126,6 +133,9 @@ protected: case NPDisk::DEVICE_TYPE_ROT: { return HDDEstimator.Read(chunkSize); } + case NPDisk::DEVICE_TYPE_NVME: { + return NVMEEstimator.Read(chunkSize); + } default: { ui64 blocksNumber = (chunkSize + DeviceReadBlockSize - 1) / DeviceReadBlockSize; ui64 seekTime = 1. * blocksNumber * DeviceSeekTimeNs; |