ibessonov commented on code in PR #5637:
URL: https://github.com/apache/ignite-3/pull/5637#discussion_r2044510876


##########
modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/throttling/SpeedBasedMemoryConsumptionThrottlingStrategy.java:
##########
@@ -496,5 +506,35 @@ void reset() {
     void finish() {
         cpWriteSpeed.closeInterval();
         threadIds.clear();
+
+        updateWriteVsFsyncCoefficient();
+    }
+
+    private void updateWriteVsFsyncCoefficient() {
+        CheckpointProgress progress = cpProgress.get();
+        assert progress != null;
+
+        if (progress.currentCheckpointPagesCount() == 0) {
+            return;
+        }
+
+        long pagesWriteTimeMillis = progress.getPagesWriteTimeMillis();
+        long fsyncTimeMillis = progress.getFsyncTimeMillis();
+
+        double coefficient = ((double) pagesWriteTimeMillis) / 
(pagesWriteTimeMillis + fsyncTimeMillis);
+        if (isNaN(coefficient)) {
+            return;
+        }
+
+        double newCoefficient = writeVsFsyncCoefficient * 0.85 + coefficient * 
0.15;
+
+        // Put it within reasonable bounds just in case.

Review Comment:
   Too afraid of some weird artifacts. I think that 0.9 upper bound can be 
ignored, but the lower bound is mandatory, otherwise we'll get huge stalls on 
malfunctioning or otherwise strangely behaving storages (that often result in 
huge fsync durations)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@ignite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to