Skip to content

Commit 3a7db6f

Browse files
wojciech-adaptivenickelaway
authored andcommitted
[Java/C] Increase default cycle thresholds to 100ms.
The new 1ms default is a bit too short - with idle components using backoff idle strategy it keeps ticking up, and it's not uncommon for some operations, mostly on files, to take tens of millis.
1 parent 81f456b commit 3a7db6f

File tree

5 files changed

+19
-19
lines changed

5 files changed

+19
-19
lines changed

aeron-archive/src/main/java/io/aeron/archive/Archive.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -528,8 +528,8 @@ public static final class Configuration
528528
/**
529529
* Default threshold value for the conductor work cycle threshold to track for being exceeded.
530530
*/
531-
@Config(defaultType = DefaultType.LONG, defaultLong = 1_000_000L)
532-
public static final long CONDUCTOR_CYCLE_THRESHOLD_DEFAULT_NS = TimeUnit.MILLISECONDS.toNanos(1);
531+
@Config(defaultType = DefaultType.LONG, defaultLong = 100_000_000L)
532+
public static final long CONDUCTOR_CYCLE_THRESHOLD_DEFAULT_NS = TimeUnit.MILLISECONDS.toNanos(100);
533533

534534
/**
535535
* Property name for threshold value for the recorder work cycle threshold to track for being exceeded.
@@ -540,8 +540,8 @@ public static final class Configuration
540540
/**
541541
* Default threshold value for the recorder work cycle threshold to track for being exceeded.
542542
*/
543-
@Config(defaultType = DefaultType.LONG, defaultLong = 1_000_000L)
544-
public static final long RECORDER_CYCLE_THRESHOLD_DEFAULT_NS = TimeUnit.MILLISECONDS.toNanos(1);
543+
@Config(defaultType = DefaultType.LONG, defaultLong = 100_000_000L)
544+
public static final long RECORDER_CYCLE_THRESHOLD_DEFAULT_NS = TimeUnit.MILLISECONDS.toNanos(100);
545545

546546
/**
547547
* Property name for threshold value for the replayer work cycle threshold to track for being exceeded.
@@ -552,8 +552,8 @@ public static final class Configuration
552552
/**
553553
* Default threshold value for the replayer work cycle threshold to track for being exceeded.
554554
*/
555-
@Config(defaultType = DefaultType.LONG, defaultLong = 1_000_000L)
556-
public static final long REPLAYER_CYCLE_THRESHOLD_DEFAULT_NS = TimeUnit.MILLISECONDS.toNanos(1);
555+
@Config(defaultType = DefaultType.LONG, defaultLong = 100_000_000L)
556+
public static final long REPLAYER_CYCLE_THRESHOLD_DEFAULT_NS = TimeUnit.MILLISECONDS.toNanos(100);
557557

558558
/**
559559
* Should the archive delete existing files on start. Default is false and should only be true for testing.

aeron-cluster/src/main/java/io/aeron/cluster/ConsensusModule.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -826,8 +826,8 @@ public static final class Configuration
826826
/**
827827
* Default threshold value for the consensus module agent work cycle threshold to track for being exceeded.
828828
*/
829-
@Config(defaultType = DefaultType.LONG, defaultLong = 1_000_000L)
830-
public static final long CYCLE_THRESHOLD_DEFAULT_NS = TimeUnit.MILLISECONDS.toNanos(1);
829+
@Config(defaultType = DefaultType.LONG, defaultLong = 100_000_000L)
830+
public static final long CYCLE_THRESHOLD_DEFAULT_NS = TimeUnit.MILLISECONDS.toNanos(100);
831831

832832
/**
833833
* Property name for threshold value, which is used for tracking total snapshot duration breaches.

aeron-cluster/src/main/java/io/aeron/cluster/service/ClusteredServiceContainer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,8 +402,8 @@ public static final class Configuration
402402
@Config(
403403
id = "SERVICE_CYCLE_THRESHOLD",
404404
defaultType = DefaultType.LONG,
405-
defaultLong = 1_000_000L)
406-
public static final long CYCLE_THRESHOLD_DEFAULT_NS = TimeUnit.MILLISECONDS.toNanos(1);
405+
defaultLong = 100_000_000L)
406+
public static final long CYCLE_THRESHOLD_DEFAULT_NS = TimeUnit.MILLISECONDS.toNanos(100);
407407

408408
/**
409409
* Property name for threshold value, which is used for tracking snapshot duration breaches.

aeron-driver/src/main/c/aeron_driver_context.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,9 @@ static void aeron_driver_untethered_subscription_state_change_null(
204204
#define AERON_PUBLICATION_RESERVED_SESSION_ID_LOW_DEFAULT (-1)
205205
#define AERON_PUBLICATION_RESERVED_SESSION_ID_HIGH_DEFAULT (1000)
206206
#define AERON_DRIVER_RERESOLUTION_CHECK_INTERVAL_NS_DEFAULT (1 * 1000 * 1000 * INT64_C(1000))
207-
#define AERON_DRIVER_CONDUCTOR_CYCLE_THRESHOLD_NS_DEFAULT (1 * 1000 * INT64_C(1000))
208-
#define AERON_DRIVER_SENDER_CYCLE_THRESHOLD_NS_DEFAULT (1 * 1000 * INT64_C(1000))
209-
#define AERON_DRIVER_RECEIVER_CYCLE_THRESHOLD_NS_DEFAULT (1 * 1000 * INT64_C(1000))
207+
#define AERON_DRIVER_CONDUCTOR_CYCLE_THRESHOLD_NS_DEFAULT (100 * 1000 * INT64_C(1000))
208+
#define AERON_DRIVER_SENDER_CYCLE_THRESHOLD_NS_DEFAULT (100 * 1000 * INT64_C(1000))
209+
#define AERON_DRIVER_RECEIVER_CYCLE_THRESHOLD_NS_DEFAULT (100 * 1000 * INT64_C(1000))
210210
#define AERON_DRIVER_NAME_RESOLVER_THRESHOLD_NS_DEFAULT (5 * 1000 * 1000 * INT64_C(1000))
211211
#define AERON_RECEIVER_IO_VECTOR_CAPACITY_DEFAULT UINT32_C(4)
212212
#define AERON_SENDER_IO_VECTOR_CAPACITY_DEFAULT UINT32_C(4)

aeron-driver/src/main/java/io/aeron/driver/Configuration.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,9 +1070,9 @@ public final class Configuration
10701070
*/
10711071
@Config(
10721072
defaultType = DefaultType.LONG,
1073-
defaultLong = 1_000_000L,
1073+
defaultLong = 100_000_000L,
10741074
expectedCDefaultFieldName = "AERON_DRIVER_CONDUCTOR_CYCLE_THRESHOLD_NS_DEFAULT")
1075-
public static final long CONDUCTOR_CYCLE_THRESHOLD_DEFAULT_NS = TimeUnit.MILLISECONDS.toNanos(1);
1075+
public static final long CONDUCTOR_CYCLE_THRESHOLD_DEFAULT_NS = TimeUnit.MILLISECONDS.toNanos(100);
10761076

10771077
/**
10781078
* Property name for threshold value for the sender work cycle threshold to track for being exceeded.
@@ -1085,9 +1085,9 @@ public final class Configuration
10851085
*/
10861086
@Config(
10871087
defaultType = DefaultType.LONG,
1088-
defaultLong = 1_000_000L,
1088+
defaultLong = 100_000_000L,
10891089
expectedCDefaultFieldName = "AERON_DRIVER_SENDER_CYCLE_THRESHOLD_NS_DEFAULT")
1090-
public static final long SENDER_CYCLE_THRESHOLD_DEFAULT_NS = TimeUnit.MILLISECONDS.toNanos(1);
1090+
public static final long SENDER_CYCLE_THRESHOLD_DEFAULT_NS = TimeUnit.MILLISECONDS.toNanos(100);
10911091

10921092
/**
10931093
* Property name for threshold value for the receiver work cycle threshold to track for being exceeded.
@@ -1100,9 +1100,9 @@ public final class Configuration
11001100
*/
11011101
@Config(
11021102
defaultType = DefaultType.LONG,
1103-
defaultLong = 1_000_000L,
1103+
defaultLong = 100_000_000L,
11041104
expectedCDefaultFieldName = "AERON_DRIVER_RECEIVER_CYCLE_THRESHOLD_NS_DEFAULT")
1105-
public static final long RECEIVER_CYCLE_THRESHOLD_DEFAULT_NS = TimeUnit.MILLISECONDS.toNanos(1);
1105+
public static final long RECEIVER_CYCLE_THRESHOLD_DEFAULT_NS = TimeUnit.MILLISECONDS.toNanos(100);
11061106

11071107
/**
11081108
* Property name for threshold value for the name resolution threshold to track for being exceeded.

0 commit comments

Comments
 (0)