How to change max/min jdbc connections of akka-persistence-jdbc? - scala

I am trying to change the minimum and maximum pool size of JDBC connections used by akka-persistence-jdbc.
I tried to change the following in my application.conf:
jdbc-journal {
slick.db.maxConnections = 2
slick.db.minConnections = 2
}
jdbc-snapshot-store {
slick.db.maxConnections = 2
slick.db.minConnections = 2
}
jdbc-read-journal {
slick.db.maxConnections = 2
slick.db.minConnections = 2
}
But it didn't change anything.

Eventually the solution is to change Lagom related configuration:
db.default {
async-executor {
numThreads = 2
minConnections = 2
maxConnections = 2
}
}

Related

Content isn't visible on the website but it's added in ACP

I'm new to TYPO3. I came across a small problem - I've added content blocks in ACP (=admin control panel) but they're not visible live.
web_layout.tsconfig:
yellow {
config {
backend_layout {
colCount = 2
rowCount = 3
rows {
1 {
columns {
1 {
colPos = 0
name = LLL:EXT:site/Resources/Private/Language/locallang.xlf:backendLayout.yellow.colPos.0
}
2 {
colPos = 1
name = LLL:EXT:site/Resources/Private/Language/locallang.xlf:backendLayout.yellow.colPos.1
}
}
}
2 {
columns {
3 {
colPos = 2
name = LLL:EXT:site/Resources/Private/Language/locallang.xlf:backendLayout.yellow.colPos.2
}
4 {
colPos = 3
name = LLL:EXT:site/Resources/Private/Language/locallang.xlf:backendLayout.yellow.colPos.3
}
}
}
3 {
columns {
5 {
colPos = 4
name = LLL:EXT:site/Resources/Private/Language/locallang.xlf:backendLayout.yellow.colPos.4
}
6 {
colPos = 5
name = LLL:EXT:site/Resources/Private/Language/locallang.xlf:backendLayout.yellow.colPos.5
}
}
}
}
}
}
title = LLL:EXT:site/Resources/Private/Language/locallang.xlf:backendLayout.yellow
}
I need to make them visible. As you can see in my web_layout.tsconfig I have 2 columns and 3 rows but on the website there is visible only first row and first column - without the rest of them.
Where should I change config to allow/show TYPO3 that I want to display all 2 columns and 3 rows?
If you create a backend layout you have not changed the rendering for the frontend.
For the frontent you need to adapt the rendering. best way would be to change it depending on selected backend layout.
Therefore you need to copy the given FLUID templates (Layouts/ Templates/ Partials) into your own extension, modify them and add them to the paths.
More information can be found in the manual

TYPO3 8.7.8 restrict available content-elements in backend-layout column

I've been searching over and over but yet haven't found something that would work...
TYPO3 8.7.8
root - backend-layout ("Main") for this and all subpages (id=1)
|
- home - backend-layout ("Home") for this page only (id=2)
|
- subpage - same backend-layout as root (id=3)
both backend-layouts look the same:
________________________________
| Top |
|______________________________|
| main-content | right-content |
|______________|_______________|
The top-section is named differently and to be used differently.
The top-section of the "Main"-backend-layout should have only allowed the images-content-element.
cType.allowed = image
The top-section of the "Home"-backend-layout should have only allowed the text-content-element
cType.allowed = text
The last two things I've tried is
first: restricting it using the GlobalVars in typoscript
[globalVar = TSFE:id != 2]&&[globalVar = TSFE:colPos=2]
TCEFORM.tt_content.CType.removeItems := addToList(header,text,bullets,table,uploads,multimedia,mailform,search,login,splash,menu,shortcut,list,script,div,html,media)
TCEFORM.tt_content.CType.keepItems := addToList(image)
[end]
second: changing the properties of the layout in the database
backend_layout {
colCount = 2
rowCount = 2
rows {
1 {
columns {
1 {
name = Parallax
colspan = 2
colPos = 2
# The following 3 lines have been added through me
cType {
allowed = text
}
}
}
}
2 {
columns {
1 {
name = Content-Main
colPos = 0
}
2 {
name = Content-Right
colPos = 1
}
}
}
}
}
I've tried quite a few other things and I'm not sure if I would find them again. I'm not even sure this can be done in TYPO3 8.x. The options from creating a backend-layout in typo are really restricted. You can only type a name for the column and define the colPos.
Did I do something wrong for TYPO3 8.x that my configurations didn't work?
Do I need different properties? Or is it just not intended to work this way anymore in this version of TYPO3? Because it seems that it has worked before...
I'm still quite a novice to TYPO3 and I would really appreciate your help but be specific on where to change what because otherwise I'll be lost again.... ^^
Thanks!
Thanks to Joey I found the extension to work with: Content Defender
And I found out how to add my backend_layouts through ts; Add the following to the PageTS of the root page
mod.web_layout.BackendLayouts {
Home {
title = Home
config {
backend_layout {
colCount = 2
rowCount = 2
rows {
1 {
columns {
1 {
name = Parallax
colspan = 2
colPos = 2
# allowed and disallowed only work through the extension content_defender (or gridelements)
allowed {
CType = gi_customstyler_parallax_content
}
}
}
}
2 {
columns {
1 {
name = Main
colPos = 0
disallowed {
CType = gi_customstyler_bg_image,gi_customstyler_parallax_content
}
}
2 {
name = Right
colPos = 1
disallowed {
CType = gi_customstyler_bg_image,gi_customstyler_parallax_content
}
}
}
}
}
}
}
}
Main {
title = Main
config {
backend_layout {
colCount = 2
rowCount = 2
rows {
1 {
columns {
1 {
name = Titel-Hintergrund
colspan = 2
colPos = 2
allowed {
CType = gi_customstyler_bg_image
}
}
}
}
2 {
columns {
1 {
name = Main
colPos = 0
disallowed {
CType = gi_customstyler_bg_image,gi_customstyler_parallax_content
}
}
2 {
name = Right
colPos = 1
disallowed {
CType = gi_customstyler_bg_image,gi_customstyler_parallax_content
}
}
}
}
}
}
}
}
}
This way the two backend_layouts are available on the page-configurations with the additional conditions of restricted content-elements. As you can see, this can also be used with custom content-elements.
It took quite a while for me to figure this out (as novice) and I hope that this might help someone else...
Try something like this :
backend_layout {
colCount = 2
rowCount = 2
rows {
1 {
columns {
1 {
name = Parallax
colspan = 2
colPos = 2
allowed = text
}
}
}
2 {
columns {
1 {
name = Content-Main
colPos = 0
}
2 {
name = Content-Right
colPos = 1
}
}
}
}
}
You are on the good way, but the condition is not correct.
Prolbem one: There is no TSFE available for the BE.
In the "globalString" condition, key "TSFE:" will not work because the
TSFE global object only exists in the FE context. The "LIT:" key will
not work either as it is used to compare TypoScript constants, which
are not available in the BE context.
Reference: https://docs.typo3.org/typo3cms/TSconfigReference/Conditions/Index.html
You need to use the "page" instead of the "TSFE:page|". These are equal, but "page" can be used for both frontend and backend but "TSFE" is only for frontend.
The second problem is, that for the colPos you need to access the GP (GetPost) helper instead of the TSFE.
So try to change the condition like this:
[page|uid != 2]&&[globalVar = GP:colPos==2]
TCEFORM.tt_content.CType.removeItems := addToList(header,text,bullets,table,uploads,multimedia,mailform,search,login,splash,menu,shortcut,list,script,div,html,media)
TCEFORM.tt_content.CType.keepItems := addToList(image)
[end]
Note: there is no CType restriction for the BE layouts, so both "cType" and "allowed" are wrong.

Icinga2 check_load threshold on master node

I'm having an issue locating where to change the thresholds for the check_load plugin on the Icinga2 master node.
The best way is to redefine that command by adding the following to your commands.conf file in your conf.d directory. Add the following replacing <load> with whatever you want to call the command:
object CheckCommand "<load>" {
import "plugin-check-command"
command = [ PluginDir + "/check_load" ]
timeout = 1m
arguments += {
"-c" = {
description = "Exit with CRITICAL status if load average exceed CLOADn; the load average format is the same used by 'uptime' and 'w'"
value = "$load_cload1$,$load_cload5$,$load_cload15$"
}
"-r" = {
description = "Divide the load averages by the number of CPUs (when possible)"
set_if = "$load_percpu$"
}
"-w" = {
description = "Exit with WARNING status if load average exceeds WLOADn"
value = "$load_wload1$,$load_wload5$,$load_wload15$"
}
}
vars.load_cload1 = 10
vars.load_cload15 = 4
vars.load_cload5 = 6
vars.load_percpu = false
vars.load_wload1 = 5
vars.load_wload15 = 3
vars.load_wload5 = 4
}
The values you'll want to change are vars.load_cload1-15 and vars.wload1-15 or set them to varibles that you can set in the service definition with $variablename$.
Then in services.conf use the new name of your check command.

TYPO3 Gridelement nesting not working

I've created a extension based on bootstrap_grids, but cannot nest the grid elements. I understand that "allowed = *" should do the job, but the ce don't show up in nested elements.
tx_gridelements {
setup {
section {
title = LLL:EXT:h_grid/Resources/Private/Language/locallang_db.xlf:section.title
description = LLL:EXT:h_grid/Resources/Private/Language/locallang_db.xlf:section.description
icon = EXT:h_grid/Resources/Public/Icons/gridlayout_section.gif
frame = 3
topLevelLayout = 0
config {
colCount = 1
rowCount = 1
rows.1 {
columns {
1 {
name = LLL:EXT:h_grid/Resources/Private/Language/locallang_db.xlf:celayout.leftColumn
colPos = 101
allowed = *
allowedGridTypes = *
}
}
}
}
}
....
Did I miss something?
Try leaving out the lines
allowed = *
allowedGridTypes = *
when you're not actually excluding any elements.

Slick 3.0.1 limit connections to db

I'm looking at doing something as simple as limiting the number of connections that Slick 3.0.1 has to a postgres db.
This doesn't work since after a while the number of connections goes to 18 for example.
source-db = {
dataSourceClass = "org.postgresql.ds.PGSimpleDataSource"
properties = {
url = "jdbc:postgresql://..."
user = "..."
password = "..."
}
numThreads = 1
maxConnections = 5
}
If you are in a play application you are probably using HikariCP. To change the settings you need to add something like this to the configuration:
hikaricp {
minimumIdle = 2
maximumPoolSize = 5
}