-
Notifications
You must be signed in to change notification settings - Fork 214
/
ditto-pekko-config.conf
322 lines (271 loc) · 12.3 KB
/
ditto-pekko-config.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
pekko {
loggers = ["org.apache.pekko.event.slf4j.Slf4jLogger"]
loglevel = "DEBUG"
logging-filter = "org.apache.pekko.event.slf4j.Slf4jLoggingFilter"
# for log messages during the actor system is starting up and shutting down:
stdout-loglevel = "INFO"
log-config-on-start = off
io.dns {
resolver = "inet-address"
inet-address {
# To set the time to cache name resolutions
# Possible values:
# default: sun.net.InetAddressCachePolicy.get() and getNegative()
# forever: cache forever
# never: no caching
# n [time unit]: positive timeout with unit, for example "30 s"
positive-ttl = never
negative-ttl = never
}
}
discovery {
# pick the discovery method you'd like to use:
method = pekko-dns
method = ${?DISCOVERY_METHOD}
kubernetes-api {
pod-label-selector = "actorSystemName=%s"
}
# DNS based service discovery in docker swarm (without DNS TTL caching)
docker-swarm-dns {
class = org.eclipse.ditto.base.service.DockerSwarmServiceDiscovery
}
}
coordinated-shutdown.exit-jvm = on
management {
http {
bind-hostname = "0.0.0.0"
# enable POST, PUT and DELETE operations on Pekko Management API
# e.g. used to initiate full cluster shutdown via API
route-providers-read-only = false
}
health-checks.readiness-checks {
# when this is empty, the cluster-membership check is disabled for readiness:
# cluster-membership = ""
}
cluster.bootstrap {
new-cluster-enabled = on
new-cluster-enabled = ${?CLUSTER_NEW_CLUSTER_ENABLED}
contact-point-discovery {
service-name = "ditto-cluster"
service-name = ${?CLUSTER_BS_SERVICE_NAME}
service-namespace = ${?CLUSTER_BS_SERVICE_NAMESPACE}
effective-name = ${?CLUSTER_BS_EFFECTIVE_NAME}
discovery-method = pekko-dns
discovery-method = ${?DISCOVERY_METHOD}
discovery-method = ${?BOOTSTRAP_DISCOVERY_METHOD}
required-contact-point-nr = ${?CLUSTER_BS_REQUIRED_CONTACTS}
}
}
}
actor {
provider = "org.apache.pekko.cluster.ClusterActorRefProvider"
enable-additional-serialization-bindings = on
# this is only intended for testing.
serialize-messages = off
serialize-creators = off
debug {
lifecycle = on
}
serializers {
json = "org.eclipse.ditto.internal.utils.cluster.JsonJsonifiableSerializer"
cbor = "org.eclipse.ditto.internal.utils.cluster.CborJsonifiableSerializer"
cbor-json-value = "org.eclipse.ditto.internal.utils.cluster.CborJsonValueSerializer"
jackson-cbor = "org.apache.pekko.serialization.jackson.JacksonCborSerializer"
}
# Ditto custom settings:
serializers-json {
# The number of bytes per direct buffer in the pool used to read or write messages during JSON serialization
direct-buffer-size = ${pekko.remote.artery.advanced.maximum-frame-size}
# The maximal number of direct buffers kept in the direct buffer pool for reuse
direct-buffer-pool-limit = 128
}
serialization-bindings {
#"java.io.Serializable" = none # must not be set in order to get org.apache.pekko.cluster.sharding.ShardRegion$GetShardRegionStats$ serialized
# Serialize Jsonifiable events with custom JSON serializer:
"org.eclipse.ditto.base.model.json.Jsonifiable" = cbor
"org.eclipse.ditto.base.model.exceptions.DittoRuntimeException" = cbor
"org.eclipse.ditto.json.JsonValue" = cbor-json-value
"org.eclipse.ditto.internal.utils.cluster.PekkoJacksonCborSerializable" = jackson-cbor
}
default-dispatcher {
executor = "org.eclipse.ditto.internal.utils.metrics.executor.InstrumentedForkJoinExecutorServiceConfigurator"
fork-join-executor {
parallelism-min = 4
parallelism-factor = 3.0
parallelism-max = 32
parallelism-max = ${?DEFAULT_DISPATCHER_PARALLELISM_MAX}
}
}
default-mailbox {
mailbox-type = "org.eclipse.ditto.internal.utils.pekko.mailbox.MonitoredUnboundedMailboxType"
mailbox-type = ${?DEFAULT_MAILBOX}
monitored-unbounded-mailbox {
# The number of messages in a mailbox, until its size will be logged
threshold-for-logging = 100
threshold-for-logging = ${?MONITOR_MAILBOX_SIZE_LOGGING_THRESHOLD}
# The minimum interval between mailbox-size log statements in nanoseconds. 1000000000ns = 1s
logging-interval = 1000000000
logging-interval = ${?MONITOR_MAILBOX_SIZE_LOGGING_INTERVAL}
# A regular expression to define for which actors the mailbox size shall be tracked.
# The regex matches agains the actors path without address, e.g.:
# /user/gatewayRoot/fooForwarder with regex filters: /user.*
# For the not tracked actors, the default (UnboundedMailbox.MessageQueue) will be used.
include-actors-regex = "(\/user.*)"
include-actors-regex = ${?MONITOR_MAILBOX_SIZE_INCLUDE_ACTORS_REGEX}
# To explicitly exclude actors, e.g. when 'include-actor-regex' is to coarse, exclude regex can be defined.
exclude-actors-regex = ""
exclude-actors-regex = ${?MONITOR_MAILBOX_SIZE_EXCLUDE_ACTORS_REGEX}
}
}
}
extensions = [
"pekko.cluster.pubsub.DistributedPubSub"
]
remote {
log-remote-lifecycle-events = on
artery {
enabled = on
enabled = ${?ARTERY_ENABLED}
# useful default for Ditto: "tcp" - as requires less memory, CPU, etc. than "aeron-udp"
# (which is also more complicated to configure correctly):
transport = tcp
transport = ${?ARTERY_TRANSPORT}
canonical {
# "<getHostAddress>" InetAddress.getLocalHost.getHostAddress
# "<getHostName>" InetAddress.getLocalHost.getHostName
hostname = "<getHostAddress>" # external (logical) hostname
hostname = ${?REMOTE_HOSTNAME}
port = 2551 # external (logical) port
port = ${?REMOTE_PORT}
}
bind {
hostname = "" # internal (bind) hostname -> "" means use the same as the canonical one
hostname = ${?BIND_HOSTNAME}
port = "" # internal (bind) port
port = ${?BIND_REMOTE_PORT}
}
advanced {
# Maximum serialized message size, including header data. # default: 256 KiB
maximum-frame-size = 256 KiB
maximum-frame-size = ${?REMOTE_MAX_FRAMESIZE}
# Direct byte buffers are reused in a pool with this maximum size.
buffer-pool-size = 128
# Maximum serialized message size for the large messages, including header data. # default: 2 MiB
maximum-large-frame-size = 256 KiB
maximum-large-frame-size = ${?REMOTE_MAX_FRAMESIZE}
# Direct byte buffers for the large messages are reused in a pool with this maximum size.
large-buffer-pool-size = 32
# Total number of inbound lanes, shared among all inbound associations. A value
# greater than 1 means that deserialization can be performed in parallel for
# different destination actors.
inbound-lanes = 4
inbound-lanes = ${?REMOTE_INBOUND_LANES}
# Number of outbound lanes for each outbound association. A value greater than 1
# means that serialization and other work can be performed in parallel for different
# destination actors.
outbound-lanes = 1
outbound-lanes = ${?REMOTE_OUTBOUND_LANES}
# Size of the send queue for outgoing messages. Messages will be dropped if
# the queue becomes full.
outbound-message-queue-size = 3072
outbound-message-queue-size = ${?REMOTE_OUTBOUND_MESSAGE_QUEUE_SIZE}
# Size of the send queue for outgoing control messages, such as system messages.
outbound-control-queue-size = 20000
outbound-control-queue-size = ${?REMOTE_OUTBOUND_CONTROL_QUEUE_SIZE}
# Size of the send queue for outgoing large messages. Messages will be dropped if
# the queue becomes full.
outbound-large-message-queue-size = 256
outbound-large-message-queue-size = ${?REMOTE_OUTBOUND_LARGE_MESSAGE_QUEUE_SIZE}
# Level of CPU time used, on a scale between 1 and 10, during backoff/idle.
# The tradeoff is that to have low latency more CPU time must be used to be
# able to react quickly on incoming messages or send as fast as possible after
# backoff backpressure.
# Level 1 strongly prefer low CPU consumption over low latency.
# Level 10 strongly prefer low latency over low CPU consumption.
idle-cpu-level = 1 # default: 5
idle-cpu-level = ${?REMOTING_IDLE_CPU_LEVEL}
}
}
watch-failure-detector.threshold = 12 # default 10
}
cluster {
# Required for smooth rolling update in cluster sharding.
app-version = ${ditto.version}
# Disable legacy metrics in pekko-cluster.
metrics.enabled = off
# enable weakly up feature to allow members to join even if some members are unreachable
allow-weakly-up-members = on
# required for pekko-management-cluster-bootstrap (to be more robust):
shutdown-after-unsuccessful-join-seed-nodes = 60s
sharding {
state-store-mode = ddata
use-dispatcher = "sharding-dispatcher"
# A new rebalance algorithm was included in Akka 2.6.10. It can reach optimal balance in
# less rebalance rounds (typically 1 or 2 rounds)
least-shard-allocation-strategy {
# Maximum number of shards that will be rebalanced in one rebalance round.
# The lower of this and `rebalance-relative-limit` will be used.
# only when configured >0 (which is the default), this new shard allocation strategy is used
rebalance-absolute-limit = 20
rebalance-absolute-limit = ${?PEKKO_CLUSTER_SHARDING_LEAST_SHARD_ALLOCATION_STRATEGY_REBALANCE_ABSOLUTE_LIMIT}
# must be <=1.0: with 100 active shards, a relative limit of 0.2 would result to "20"
rebalance-relative-limit = 0.2
rebalance-relative-limit = ${?PEKKO_CLUSTER_SHARDING_LEAST_SHARD_ALLOCATION_STRATEGY_REBALANCE_RELATIVE_LIMIT}
}
}
}
coordinated-shutdown {
phases {
cluster-sharding-shutdown-region {
timeout = 15s # default: 10s
timeout = ${?PEKKO_COORDINATED_SHUTDOWN_PHASES_CLUSTER_SHARDING_SHUTDOWN_REGION}
}
cluster-exiting {
timeout = 15s # default: 10s
timeout = ${?PEKKO_COORDINATED_SHUTDOWN_PHASES_CLUSTER_EXITING_TIMEOUT}
}
}
}
}
sharding-dispatcher {
# Dispatcher is the name of the event-based dispatcher
type = Dispatcher
# What kind of ExecutionService to use
executor = "org.eclipse.ditto.internal.utils.metrics.executor.InstrumentedForkJoinExecutorServiceConfigurator"
# Configuration for the fork join pool
fork-join-executor {
# Min number of threads to cap factor-based parallelism number to
parallelism-min = 4
# Parallelism (threads) ... ceil(available processors * factor)
parallelism-factor = 3.0
# Max number of threads to cap factor-based parallelism number to
parallelism-max = 32
parallelism-max = ${?DEFAULT_DISPATCHER_PARALLELISM_MAX}
}
# Throughput defines the maximum number of messages to be
# processed per actor before the thread jumps to the next actor.
# Set to 1 for as fair as possible.
throughput = 5 # default is 5
throughput = ${?SHARDING_DISPATCHER_THROUGHPUT}
}
pekko.contrib.persistence.mongodb.mongo {
driver = "pekko.contrib.persistence.mongodb.driver.ScalaDriverPersistenceExtension"
# Write concerns are one of: Unacknowledged, Acknowledged, Journaled, ReplicaAcknowledged
journal-write-concern = "Acknowledged" # By default was: "Journaled"
journal-write-concern = ${?PEKKO_PERSISTENCE_MONGO_JOURNAL_WRITE_CONCERN}
journal-wtimeout = 10000
journal-wtimeout = ${?PEKKO_PERSISTENCE_MONGO_JOURNAL_WRITE_TIMEOUT}
journal-fsync = false
journal-fsync = ${?PEKKO_PERSISTENCE_MONGO_JOURNAL_FSYNC}
snaps-write-concern = "Acknowledged" # By default was: "Journaled"
snaps-write-concern = ${?PEKKO_PERSISTENCE_MONGO_SNAPS_WRITE_CONCERN}
snaps-wtimeout = 5000
snaps-wtimeout = ${?PEKKO_PERSISTENCE_MONGO_SNAPS_WRITE_TIMEOUT}
snaps-fsync = false
snaps-fsync = ${?PEKKO_PERSISTENCE_MONGO_SNAPS_FSYNC}
realtime-enable-persistence = false
metrics-builder {
class = "org.eclipse.ditto.internal.utils.metrics.mongo.MongoMetricsBuilder"
class = ${?MONGO_METRICS_BUILDER_CLASS}
}
}