Skip to content

Comments

RATIS-1901. Update Counter example to benchmark performance.#953

Merged
szetszwo merged 1 commit intoapache:masterfrom
szetszwo:RATIS-1901
Oct 31, 2023
Merged

RATIS-1901. Update Counter example to benchmark performance.#953
szetszwo merged 1 commit intoapache:masterfrom
szetszwo:RATIS-1901

Conversation

@szetszwo
Copy link
Contributor

@szetszwo szetszwo requested a review from SzyWilliam October 25, 2023 15:10
Copy link
Member

@SzyWilliam SzyWilliam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 the changes look good to me. Thanks @szetszwo for the benchmark!
I think we need to notice users the potential problems if we adopt a larger segment size.


String SEGMENT_SIZE_MAX_KEY = PREFIX + ".segment.size.max";
SizeInBytes SEGMENT_SIZE_MAX_DEFAULT = SizeInBytes.valueOf("8MB");
SizeInBytes SEGMENT_SIZE_MAX_DEFAULT = SizeInBytes.valueOf("128MB");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for a larger segment size. However, a larger segment size may cause heavier memory pressure, since we need to retain the open segment in memory. Let me update the configuration docs to include this notice after the patch being merged.

Copy link
Contributor Author

@szetszwo szetszwo Oct 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about changing it to a small size, say 32MB? Currently, 8MB is very small. The servers will roll the log frequently and create a lot of small files. Let me revert the change here and do it separately.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 8MB is small. Actually I think 128MB is good. Kafka even uses 1GB as the segment size. It's only that I did experiments earlier and found 32MB is the optimal for IOTDB default workload. The experiments show:

  • (end to end throughput) improves substantially as segmented size grow from 8MB to 32MB, slowly from 32MB to 128MB.
  • The memory usage in JVM young increases as the segmented size grow, even if we restricted the max-cached-size and max-cached-segments. It turned out to be the open segment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is good to know. Let's change to 32MB then. Filed RATIS-1924.

@szetszwo
Copy link
Contributor Author

Hit the NPE fixed by RATIS-1920 in my test. Will sync with the master branch.

@szetszwo szetszwo merged commit af71d40 into apache:master Oct 31, 2023
@szetszwo
Copy link
Contributor Author

@SzyWilliam , thanks a lot for reviewing this!

symious pushed a commit to symious/ratis that referenced this pull request Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants