Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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::NVMEEstimator{
{ 10000, 1.3 }, // ReadCoefficients
{ 3300, 1.5 }, // WriteCoefficients
{ 50000, 1.83 }, // HugeWriteCoefficients
};

class TBsCostModelMirror3dc : public TBsCostModelBase {
public:
TBsCostModelMirror3dc(NPDisk::EDeviceType deviceType)
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 NVMEEstimator;

private:
enum class EMemoryOperationType {
Expand Down Expand Up @@ -99,6 +100,9 @@ class TBsCostModelBase {
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;
Expand All @@ -112,6 +116,9 @@ class TBsCostModelBase {
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;
Expand All @@ -126,6 +133,9 @@ class TBsCostModelBase {
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;
Expand Down