Skip to content

Commit 9b5f098

Browse files
committed
better
1 parent e9445b8 commit 9b5f098

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

cloud/filestore/libs/storage/tablet/bench/tablet_bench.cpp

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ namespace {
1818

1919
////////////////////////////////////////////////////////////////////////////////
2020

21+
constexpr ui32 BlockSize = 4096;
22+
constexpr ui64 FileSize = 1_MB;
23+
constexpr ui64 MixedBlocksOffloadedRangesCapacity = 1000000;
24+
2125
struct TTabletSetup
2226
{
2327
TTestEnv Env;
@@ -26,18 +30,20 @@ struct TTabletSetup
2630

2731
TTabletSetup()
2832
: Env(TTestEnvConfig{
33+
// Turn off logging in order to reduce performance overhead
2934
.LogPriority_NFS = NActors::NLog::PRI_ALERT,
3035
.LogPriority_KiKiMR = NActors::NLog::PRI_ALERT,
3136
.LogPriority_Others = NActors::NLog::PRI_ALERT})
3237
{
3338
NCloud::NFileStore::NProto::TStorageConfig storageConfig;
3439
storageConfig.SetInMemoryIndexCacheEnabled(true);
35-
storageConfig.SetMixedBlocksOffloadedRangesCapacity(1e6);
40+
storageConfig.SetMixedBlocksOffloadedRangesCapacity(
41+
MixedBlocksOffloadedRangesCapacity);
3642

3743
Env.UpdateStorageConfig(std::move(storageConfig));
3844

3945
Env.CreateSubDomain("nfs");
40-
Env.GetRuntime().SetDispatchedEventsLimit(1e9);
46+
Env.GetRuntime().SetDispatchedEventsLimit(Max<ui64>());
4147

4248
ui32 nodeIdx = Env.CreateNode("nfs");
4349
ui64 tabletId = Env.BootIndexTablet(nodeIdx);
@@ -46,21 +52,21 @@ struct TTabletSetup
4652
Env.GetRuntime(),
4753
nodeIdx,
4854
tabletId,
49-
TFileSystemConfig{.BlockSize = 4096});
55+
TFileSystemConfig{.BlockSize = BlockSize});
5056
TabletClient->InitSession("client", "session");
5157

5258
auto nodeId = CreateNode(
5359
*TabletClient,
5460
TCreateNodeArgs::File(RootNodeId, "test"));
5561

5662
Handle = CreateHandle(*TabletClient, nodeId);
57-
TabletClient->WriteData(Handle, 0, 1_MB, '1');
63+
TabletClient->WriteData(Handle, 0, FileSize, '1');
5864
}
5965

6066
void DescribeData(ui64 offset, ui64 length)
6167
{
6268
auto response = TabletClient->DescribeData(Handle, offset, length);
63-
Y_ABORT_UNLESS(1_MB == response->Record.GetFileSize());
69+
Y_ABORT_UNLESS(FileSize == response->Record.GetFileSize());
6470
}
6571
};
6672

0 commit comments

Comments
 (0)