diff --git a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_config.h b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_config.h index 80426546041f..b33ae5a9a640 100644 --- a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_config.h +++ b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_config.h @@ -123,9 +123,9 @@ struct TPDiskConfig : public TThrRefBase { ui64 CostLimitNs; // AsyncBlockDevice settings - ui32 BufferPoolBufferSizeBytes = 512 << 10; - ui32 BufferPoolBufferCount = 256; - ui32 MaxQueuedCompletionActions = 128; // BufferPoolBufferCount / 2; + ui32 BufferPoolBufferSizeBytes; + ui32 BufferPoolBufferCount; + ui32 MaxQueuedCompletionActions; bool UseSpdkNvmeDriver; ui64 ExpectedSlotCount = 0; @@ -211,6 +211,10 @@ struct TPDiskConfig : public TThrRefBase { DeviceInFlight = choose(128, 4, hddInFlight); CostLimitNs = choose(500'000ull, 20'000'000ull, 50'000'000ull); + BufferPoolBufferSizeBytes = choose(128 << 10, 256 << 10, 512 << 10); + BufferPoolBufferCount = choose(1024, 512, 256); + MaxQueuedCompletionActions = BufferPoolBufferCount / 2; + UseSpdkNvmeDriver = Path.StartsWith("PCIe:"); Y_ABORT_UNLESS(!UseSpdkNvmeDriver || deviceType == NPDisk::DEVICE_TYPE_NVME, "SPDK NVMe driver can be used only with NVMe devices!"); diff --git a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_impl.cpp b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_impl.cpp index 2595a4fdc3f6..385b9a6d8d81 100644 --- a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_impl.cpp +++ b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_impl.cpp @@ -60,10 +60,12 @@ TPDisk::TPDisk(std::shared_ptr pCtx, const TIntrusivePtrBufferPoolBufferSizeBytes); + ForsetiOpPieceSizeRot = TControlWrapper(512 * 1024, 1, Cfg->BufferPoolBufferSizeBytes); ForsetiOpPieceSizeCached = PDiskCategory.IsSolidState() ? ForsetiOpPieceSizeSsd : ForsetiOpPieceSizeRot; + + if (Cfg->SectorMap) { auto diskModeParams = Cfg->SectorMap->GetDiskModeParams(); if (diskModeParams) { @@ -3419,12 +3421,12 @@ void TPDisk::Update() { Mon.UpdateDurationTracker.UpdateStarted(); LWTRACK(PDiskUpdateStarted, UpdateCycleOrbit, PCtx->PDiskId); + ForsetiMaxLogBatchNsCached = ForsetiMaxLogBatchNs; + ForsetiOpPieceSizeCached = PDiskCategory.IsSolidState() ? ForsetiOpPieceSizeSsd : ForsetiOpPieceSizeRot; + ForsetiOpPieceSizeCached = Min(ForsetiOpPieceSizeCached, Cfg->BufferPoolBufferSizeBytes); + ForsetiOpPieceSizeCached = AlignDown(ForsetiOpPieceSizeCached, Format.SectorSize); { TGuard guard(StateMutex); - ForsetiMaxLogBatchNsCached = ForsetiMaxLogBatchNs; - ForsetiOpPieceSizeCached = PDiskCategory.IsSolidState() ? ForsetiOpPieceSizeSsd : ForsetiOpPieceSizeRot; - ForsetiOpPieceSizeCached = Min(ForsetiOpPieceSizeCached, Cfg->BufferPoolBufferSizeBytes); - ForsetiOpPieceSizeCached = AlignDown(ForsetiOpPieceSizeCached, Format.SectorSize); // Switch the scheduler when possible ForsetiScheduler.SetIsBinLogEnabled(EnableForsetiBinLog);