File tree 1 file changed +19
-0
lines changed
1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -267,6 +267,20 @@ function prepareConfigFiles {
267
267
}
268
268
269
269
270
+ function computeDbPools {
271
+ if [[ ${__UC_INSTANCES} -eq 1 ]]; then
272
+ DB_POOLS=300;
273
+ UC_POOLS=300;
274
+ elif [[ ${__UC_INSTANCES} -eq 2 ]]; then
275
+ DB_POOLS=300;
276
+ UC_POOLS=150;
277
+ else
278
+ DB_POOLS=$(( ${__UC_INSTANCES} * 100 )) ;
279
+ UC_POOLS=100;
280
+ fi
281
+ }
282
+
283
+
270
284
function generateUcCompose {
271
285
272
286
if [[ " ${__SERVICE_NAME} " == " uniconfig" ]]; then
@@ -313,6 +327,10 @@ function generateUcCompose {
313
327
# networks
314
328
sed -i ' s|uniconfig-network|' " ${__SERVICE_NAME} -network|g" " ${__COMPOSE_PATH} "
315
329
330
+ # db pools
331
+ sed -i ' s|maxDbPoolSize=300|' " maxDbPoolSize=${UC_POOLS} |g" " ${__COMPOSE_PATH} "
332
+ sed -i ' s|max_connections=300|' " max_connections=${DB_POOLS} |g" " ${__COMPOSE_PATH} "
333
+
316
334
}
317
335
318
336
function prepareFolder {
@@ -350,4 +368,5 @@ __UNICONFIG_SERVICE_SUFIX="uniconfig-controller"
350
368
argumentsCheck " $@ "
351
369
isNodeInSwarm ${__NODE_ID}
352
370
prepareFolder
371
+ computeDbPools
353
372
generateUcCompose
You can’t perform that action at this time.
0 commit comments