Skip to content

Commit 87ff4fa

Browse files
authored
Revert "Configure BufferPool size depending on device type" (#9779)
1 parent 21846f3 commit 87ff4fa

File tree

2 files changed

+9
-15
lines changed

2 files changed

+9
-15
lines changed

ydb/core/blobstorage/pdisk/blobstorage_pdisk_config.h

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,9 @@ struct TPDiskConfig : public TThrRefBase {
123123
ui64 CostLimitNs;
124124

125125
// AsyncBlockDevice settings
126-
ui32 BufferPoolBufferSizeBytes;
127-
ui32 BufferPoolBufferCount;
128-
ui32 MaxQueuedCompletionActions;
126+
ui32 BufferPoolBufferSizeBytes = 512 << 10;
127+
ui32 BufferPoolBufferCount = 256;
128+
ui32 MaxQueuedCompletionActions = 128; // BufferPoolBufferCount / 2;
129129
bool UseSpdkNvmeDriver;
130130

131131
ui64 ExpectedSlotCount = 0;
@@ -211,10 +211,6 @@ struct TPDiskConfig : public TThrRefBase {
211211
DeviceInFlight = choose(128, 4, hddInFlight);
212212
CostLimitNs = choose(500'000ull, 20'000'000ull, 50'000'000ull);
213213

214-
BufferPoolBufferSizeBytes = choose(128 << 10, 256 << 10, 512 << 10);
215-
BufferPoolBufferCount = choose(1024, 512, 256);
216-
MaxQueuedCompletionActions = BufferPoolBufferCount / 2;
217-
218214
UseSpdkNvmeDriver = Path.StartsWith("PCIe:");
219215
Y_ABORT_UNLESS(!UseSpdkNvmeDriver || deviceType == NPDisk::DEVICE_TYPE_NVME,
220216
"SPDK NVMe driver can be used only with NVMe devices!");

ydb/core/blobstorage/pdisk/blobstorage_pdisk_impl.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,10 @@ TPDisk::TPDisk(std::shared_ptr<TPDiskCtx> pCtx, const TIntrusivePtr<TPDiskConfig
6060
0, 64 * 1024 * 1024);
6161
ForsetiMaxLogBatchNs = TControlWrapper((PDiskCategory.IsSolidState() ? 50'000ll : 500'000ll), 0, 100'000'000ll);
6262
ForsetiMaxLogBatchNsCached = ForsetiMaxLogBatchNs;
63-
ForsetiOpPieceSizeSsd = TControlWrapper(64 * 1024, 1, Cfg->BufferPoolBufferSizeBytes);
64-
ForsetiOpPieceSizeRot = TControlWrapper(512 * 1024, 1, Cfg->BufferPoolBufferSizeBytes);
63+
ForsetiOpPieceSizeSsd = TControlWrapper(64 * 1024, 1, 512 * 1024);
64+
ForsetiOpPieceSizeRot = TControlWrapper(512 * 1024, 1, 512 * 1024);
6565
ForsetiOpPieceSizeCached = PDiskCategory.IsSolidState() ? ForsetiOpPieceSizeSsd : ForsetiOpPieceSizeRot;
6666

67-
68-
6967
if (Cfg->SectorMap) {
7068
auto diskModeParams = Cfg->SectorMap->GetDiskModeParams();
7169
if (diskModeParams) {
@@ -3421,12 +3419,12 @@ void TPDisk::Update() {
34213419
Mon.UpdateDurationTracker.UpdateStarted();
34223420
LWTRACK(PDiskUpdateStarted, UpdateCycleOrbit, PCtx->PDiskId);
34233421

3424-
ForsetiMaxLogBatchNsCached = ForsetiMaxLogBatchNs;
3425-
ForsetiOpPieceSizeCached = PDiskCategory.IsSolidState() ? ForsetiOpPieceSizeSsd : ForsetiOpPieceSizeRot;
3426-
ForsetiOpPieceSizeCached = Min<i64>(ForsetiOpPieceSizeCached, Cfg->BufferPoolBufferSizeBytes);
3427-
ForsetiOpPieceSizeCached = AlignDown<i64>(ForsetiOpPieceSizeCached, Format.SectorSize);
34283422
{
34293423
TGuard<TMutex> guard(StateMutex);
3424+
ForsetiMaxLogBatchNsCached = ForsetiMaxLogBatchNs;
3425+
ForsetiOpPieceSizeCached = PDiskCategory.IsSolidState() ? ForsetiOpPieceSizeSsd : ForsetiOpPieceSizeRot;
3426+
ForsetiOpPieceSizeCached = Min<i64>(ForsetiOpPieceSizeCached, Cfg->BufferPoolBufferSizeBytes);
3427+
ForsetiOpPieceSizeCached = AlignDown<i64>(ForsetiOpPieceSizeCached, Format.SectorSize);
34303428
// Switch the scheduler when possible
34313429
ForsetiScheduler.SetIsBinLogEnabled(EnableForsetiBinLog);
34323430

0 commit comments

Comments
 (0)