-
Notifications
You must be signed in to change notification settings - Fork 225
/
things-search.conf
executable file
·291 lines (234 loc) · 9.1 KB
/
things-search.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
ditto {
service-name = "things-search"
mapping-strategy.implementation = "org.eclipse.ditto.thingsearch.api.ThingSearchMappingStrategies"
persistence.operations.delay-after-persistence-actor-shutdown = 5s
persistence.operations.delay-after-persistence-actor-shutdown = ${?DELAY_AFTER_PERSISTENCE_ACTOR_SHUTDOWN}
mongodb {
database = "searchDB"
database = ${?MONGO_DB_DATABASE}
pool {
minSize = 0
minSize = ${?MONGO_DB_CONNECTION_MIN_POOL_SIZE}
maxSize = 1000
maxSize = ${?MONGO_DB_CONNECTION_POOL_SIZE}
maxWaitTime = 30s
maxWaitTime = ${?MONGO_DB_CONNECTION_POOL_WAIT_TIME}
jmxListenerEnabled = false
jmxListenerEnabled = ${?MONGO_DB_CONNECTION_POOL_JMX_LISTENER_ENABLED}
}
breaker {
# defines ater how many failures the circuit breaker should open
maxFailures = 5
maxFailures = ${?BREAKER_MAXFAILURES}
timeout {
# MongoDB Timeouts causing the circuitBreaker to open - "0s" disables timeouts opening the breaker
call = 5s
call = ${?BREAKER_TIMEOUT}
# after this time in "Open" state, the cicuitBreaker is "Half-opened" again
reset = 10s
reset = ${?BREAKER_RESET}
}
}
monitoring {
commands = true
commands = ${?MONGODB_MONITORING_COMMANDS_ENABLED}
connection-pool = true
commands = ${?MONGODB_MONITORING_CONNECTION_POOL_ENABLED}
}
}
signal-enrichment {
caching-signal-enrichment-facade.provider = ${?THINGS_SEARCH_CACHING_SIGNAL_ENRICHMENT_PROVIDER}
}
things-search {
query-criteria-validator.implementation = ${?QUERY_CRITERIA_VALIDATOR_IMPLEMENTATION}
search-update-mapper.implementation = ${?SEARCH_UPDATE_MAPPER_IMPLEMENTATION}
search-update-observer.implementation = ${?SEARCH_UPDATE_OBSERVER_IMPLEMENTATION}
mongo-hints-by-namespace = ${?MONGO_HINTS_BY_NAMESPACE}
index-initialization {
# indices should be created within this application
enabled = true
enabled = ${?INDEX_INITIALIZATION_ENABLED}
}
updater {
max-idle-time = 25h
max-idle-time = ${?ACTIVITY_CHECK_INTERVAL}
event-processing-active = true
event-processing-active = ${?EVENT_PROCESSING_ACTIVE}
# how often to poll shard region for state updates
sharding-state-poll-interval = 15s
sharding-state-poll-interval = ${?SHARDING_STATE_POLL_INTERVAL}
force-update-probability = 0.00
force-update-probability = ${?FORCE_UPDATE_PROBABILITY}
force-update-after-start-timeout = 5m
force-update-after-start-timeout = ${?FORCE_UPDATE_AFTER_START_TIMEOUT}
background-sync {
enabled = true
enabled = ${?BACKGROUND_SYNC_ENABLED}
quiet-period = 8m
quiet-period = ${?BACKGROUND_SYNC_QUIET_PERIOD}
idle-timeout = 5m
idle-timeout = ${?BACKGROUND_SYNC_IDLE_TIMEOUT}
tolerance-window = 20m
tolerance-window = ${?BACKGROUND_SYNC_TOLERANCE_WINDOW}
policy-ask-timeout = 10s
policy-ask-timeout = ${?BACKGROUND_SYNC_POLICY_ASK_TIMEOUT}
keep {
events = 50
events = ${?BACKGROUND_SYNC_KEEP_EVENTS}
}
throttle {
throughput = 100
throughput = ${?BACKGROUND_SYNC_THROTTLE_THROUGHPUT}
period = 10s
period = ${?BACKGROUND_SYCN_THROTTLE_PERIOD}
}
# handle failures/stalling/expired cursors
min-backoff = 1s
min-backoff = ${?BACKGROUND_SYNC_MIN_BACKOFF}
max-backoff = 2m
max-backoff = ${?BACKGROUND_SYNC_MAX_BACKOFF}
# give up stream resumption after about 6 hours = 180 * 120s
max-restarts = 180
max-restarts = ${?BACKGROUND_SYNC_MAX_RESTARTS}
# assume upstream healthy if no error happened for this long
recovery = 5m
recovery = ${?BACKGROUND_SYNC_RECOCVERY}
}
stream {
# arrays bigger than this are not indexed
max-array-size = 0
max-array-size = ${?THINGS_SEARCH_UPDATER_STREAM_MAX_ARRAY_SIZE}
# minimum delay between event dumps must be at least 1s
write-interval = 1s
write-interval = ${?THINGS_SEARCH_UPDATER_STREAM_WRITE_INTERVAL}
# configuration for retrieval of policies/things via sharding
ask-with-retry {
ask-timeout = 5s
ask-timeout = ${?THINGS_SEARCH_UPDATER_STREAM_ASK_TIMEOUT}
# one of: OFF, NO_DELAY, FIXED_DELAY, BACKOFF_DELAY
retry-strategy = BACKOFF_DELAY
retry-strategy = ${?THINGS_SEARCH_UPDATER_STREAM_RETRY_STRATEGY}
retry-attempts = 3
retry-attempts = ${?THINGS_SEARCH_UPDATER_STREAM_RETRY_ATTEMPTS}
fixed-delay = 5s
fixed-delay = ${?THINGS_SEARCH_UPDATER_STREAM_RETRY_FIXED_DELAY}
backoff-delay {
min = 100ms
max = 10s
# must be between 0.0 and 1.0:
random-factor = 0.5
}
}
# retrieval of things and policy-enforcers
retrieval {
# upper bound of parallel SudoRetrieveThing commands (by extension, parallel loads of policy enforcer cache)
parallelism = 16
parallelism = ${?THINGS_SEARCH_UPDATER_STREAM_RETRIEVAL_PARALLELISM}
# back-offs in case of failure
exponential-backoff {
min = 1s
max = 2m
random-factor = 2.0
}
}
# writing into the persistence
persistence {
# how many bulk writes to request in parallel; must be a power of 2
parallelism = 2
parallelism = ${?THINGS_SEARCH_UPDATER_STREAM_PERSISTENCE_PARALLELISM}
# how many write operations to perform in one bulk
max-bulk-size = 250
max-bulk-size = ${?THINGS_SEARCH_UPDATER_STREAM_PERSISTENCE_MAX_BULK_SIZE}
# how long to wait after DB acknowledgement before sending "search-persisted" acknowledgement
ack-delay = 0s
ack-delay = ${?THINGS_SEARCH_UPDATER_STREAM_PERSISTENCE_ACK_DELAY}
# mongoDB write concern to use for search updates requiring acknowledgement
with-acks-writeConcern = journaled
with-acks-writeConcern = ${?THINGS_SEARCH_UPDATER_STREAM_PERSISTENCE_WITH_ACKS_WRITE_CONCERN}
# backoffs in case of failure
exponential-backoff {
min = 1s
max = 2m
random-factor = 2.0
}
}
cache {
# name of the dispatcher to run async cache loaders, which do not block threads
dispatcher = "policy-enforcer-cache-dispatcher"
# delay before retrying a cache query if the cached value is out of date
retry-delay = 1s
retry-delay = ${?THINGS_SEARCH_UPDATER_STREAM_CACHE_RETRY_DELAY}
# how many enforcers to cache
maximum-size = 20000
maximum-size = ${?THINGS_SEARCH_UPDATER_STREAM_CACHE_SIZE}
# lifetime of a cached enforcer. set very high because entries are invalidated lazily
expire-after-write = 2h
expire-after-write = ${?THINGS_SEARCH_UPDATER_STREAM_CACHE_EXPIRY}
expire-after-access = 30m
expire-after-access = ${?THINGS_SEARCH_UPDATER_STREAM_CACHE_EXPIRY_AFTER_ACCESS}
}
}
persistence {
# read preference is one of: primary, primaryPreferred, secondary, secondaryPreferred, nearest
readPreference = ${ditto.mongodb.options.readPreference}
readPreference = ${?UPDATER_PERSISTENCE_MONGO_DB_READ_PREFERENCE}
# read concern is one of: default, local, majority, linearizable, snapshot, available
readConcern = ${ditto.mongodb.options.readConcern}
readConcern = ${?UPDATER_PERSISTENCE_MONGO_DB_READ_CONCERN}
}
}
}
}
akka {
cluster {
sharding {
role = ${ditto.service-name}
}
roles = [
"things-search",
"blocked-namespaces-aware",
"thing-event-aware"
]
}
}
search-dispatcher {
# one thread per query and a dedicated thread for the search actor
type = PinnedDispatcher
executor = "thread-pool-executor"
}
blocked-namespaces-dispatcher {
type = Dispatcher
executor = "fork-join-executor"
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 = 5
}
policy-enforcer-cache-dispatcher {
type = "Dispatcher"
executor = "thread-pool-executor"
thread-pool-executor {
keep-alive-time = 60s
fixed-pool-size = off
max-pool-size-max = 256
max-pool-size-max = ${?CACHE_DISPATCHER_POOL_SIZE_MAX}
max-pool-size-max = ${?POLICY_ENFORCER_CACHE_DISPATCHER_POOL_SIZE_MAX}
}
}
search-updater-dispatcher {
type = "Dispatcher"
executor = "thread-pool-executor"
thread-pool-executor {
keep-alive-time = 60s
fixed-pool-size = off
max-pool-size-max = 256
max-pool-size-max = ${?SEARCH_UPDATER_DISPATCHER_POOL_SIZE_MAX}
}
}
include "things-search-extension.conf"