Skip to content

Commit

Permalink
issue-1932: set performance profile of the main tablet based on the f…
Browse files Browse the repository at this point in the history
…ilesystem size (#2986)
  • Loading branch information
debnatkh authored Feb 6, 2025
1 parent 668b5c2 commit 9c3f69c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 18 deletions.
21 changes: 3 additions & 18 deletions cloud/filestore/libs/storage/core/model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -458,13 +458,15 @@ ui32 NodesLimit(
xxx(BoostPercentage, __VA_ARGS__) \
// PERFORMANCE_PROFILE_PARAMETERS_AU

} // namespace

void SetupFileStorePerformanceAndChannels(
bool allocateMixed0Channel,
const ui32 allocationUnitCount,
const TStorageConfig& config,
NKikimrFileStore::TConfig& fileStore,
const NProto::TFileStorePerformanceProfile& clientProfile)
{
ui32 allocationUnitCount = ComputeAllocationUnitCount(config, fileStore);
OverrideStorageMediaKind(config, fileStore);

#define SETUP_PARAMETER_SIMPLE(name, ...) \
Expand Down Expand Up @@ -496,8 +498,6 @@ void SetupFileStorePerformanceAndChannels(
fileStore);
}

} // namespace

////////////////////////////////////////////////////////////////////////////////

ui32 ComputeShardCount(
Expand All @@ -516,20 +516,6 @@ ui32 ComputeShardCount(
return Min(shardCount, MaxShardCount);
}

void SetupFileStorePerformanceAndChannels(
bool allocateMixed0Channel,
const TStorageConfig& config,
NKikimrFileStore::TConfig& fileStore,
const NProto::TFileStorePerformanceProfile& clientProfile)
{
SetupFileStorePerformanceAndChannels(
allocateMixed0Channel,
ComputeAllocationUnitCount(config, fileStore),
config,
fileStore,
clientProfile);
}

TMultiShardFileStoreConfig SetupMultiShardFileStorePerformanceAndChannels(
const TStorageConfig& config,
const NKikimrFileStore::TConfig& fileStore,
Expand All @@ -540,7 +526,6 @@ TMultiShardFileStoreConfig SetupMultiShardFileStorePerformanceAndChannels(
result.MainFileSystemConfig = fileStore;
SetupFileStorePerformanceAndChannels(
false, // allocateMixed0Channel
1, // allocationUnitCount
config,
result.MainFileSystemConfig,
clientProfile);
Expand Down
11 changes: 11 additions & 0 deletions cloud/filestore/libs/storage/core/model_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2298,6 +2298,10 @@ Y_UNIT_TEST_SUITE(TModel)
StorageConfig.SetAutomaticShardCreationEnabled(true);
StorageConfig.SetShardAllocationUnit(4_TB);
StorageConfig.SetAutomaticallyCreatedShardSize(5_TB);
StorageConfig.SetSSDMaxWriteIops(Max<ui32>());

auto OldMaxWriteIops = ClientPerformanceProfile.GetMaxWriteIops();
ClientPerformanceProfile.ClearMaxWriteIops();

KikimrConfig.SetBlocksCount(4_TB / 4_KB);
auto fs = SetupMultiShardFileStorePerformanceAndChannels(
Expand All @@ -2306,6 +2310,13 @@ Y_UNIT_TEST_SUITE(TModel)
ClientPerformanceProfile,
0);
UNIT_ASSERT_VALUES_EQUAL(1, fs.ShardConfigs.size());
// MaxWriteIops per allocation unit is 1000, so (4096 GiB / 32 GiB) *
// 1000 = 128000
UNIT_ASSERT_VALUES_EQUAL(
128000,
fs.MainFileSystemConfig.GetPerformanceProfileMaxWriteIops());

ClientPerformanceProfile.SetMaxWriteIops(OldMaxWriteIops);

KikimrConfig.SetBlocksCount(4_TB / 4_KB + 1);
fs = SetupMultiShardFileStorePerformanceAndChannels(
Expand Down

0 comments on commit 9c3f69c

Please sign in to comment.