Skip to content

Commit

Permalink
build: Add env var to set triplestore actor pool (#1537)
Browse files Browse the repository at this point in the history
* adding an env var to set graphdb pool size

* build: Add env var to set graphdb pool size

* build: Add env var to set graphdb pool size

Co-authored-by: Ivan Subotic <400790+subotic@users.noreply.github.com>
  • Loading branch information
loicjaouen and subotic authored Jan 15, 2020
1 parent 8254030 commit 19239b2
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 42 deletions.
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ services:
environment:
- KNORA_AKKA_LOGLEVEL=DEBUG
- KNORA_AKKA_STDOUT_LOGLEVEL=DEBUG
- KNORA_WEBAPI_DB_CONNECTIONS=${KNORA_WEBAPI_DB_CONNECTIONS}
- KNORA_WEBAPI_TRIPLESTORE_HOST=graphdb
- KNORA_WEBAPI_TRIPLESTORE_DBTYPE=${KNORA_GDB_TYPE}
- KNORA_WEBAPI_SIPI_INTERNAL_HOST=sipi
Expand Down
1 change: 1 addition & 0 deletions docker/knora.docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ services:
environment:
- KNORA_AKKA_LOGLEVEL=DEBUG
- KNORA_AKKA_STDOUT_LOGLEVEL=DEBUG
- KNORA_WEBAPI_DB_CONNECTIONS=${KNORA_WEBAPI_DB_CONNECTIONS}
- KNORA_WEBAPI_TRIPLESTORE_HOST=db
- KNORA_WEBAPI_TRIPLESTORE_DBTYPE=${KNORA_GDB_TYPE}
- KNORA_WEBAPI_SIPI_INTERNAL_HOST=sipi
Expand Down
81 changes: 41 additions & 40 deletions docs/src/paradox/04-publishing-deployment/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,46 +35,47 @@ The relevant sections for tuning are:

A number of core settings is additionally configurable through system environment variables. These are:

| key in application.conf | environment variable | default value |
|------------------------------------------|---------------------------------------------------|----------------------|
| akka.log-config-on-start | KNORA_AKKA_LOG_CONFIG_ON_START | off |
| akka.loglevel | KNORA_AKKA_LOGLEVEL | INFO |
| akka.stdout-loglevel | KNORA_AKKA_STDOUT_LOGLEVEL | INFO |
| app.print-short-config | KNORA_WEBAPI_PRINT_SHORT_CONFIG | true |
| app.print-extended-config | KNORA_WEBAPI_PRINT_EXTENDED_CONFIG | false |
| app.bcrypt-password-strength | KNORA_WEBAPI_BCRYPT_PASSWORD_STRENGTH | 12 |
| app.jwt-secret-key | KNORA_WEBAPI_JWT_SECRET_KEY | super-secret-key |
| app.jwt-longevity | KNORA_WEBAPI_JWT_LONGEVITY | 30 days |
| app.cookie-domain | KNORA_WEBAPI_COOKIE_DOMAIN | localhost |
| app.allow-reload-over-http | KNORA_WEBAPI_ALLOW_RELOAD_OVER_HTTP | false |
| app.ark.resolver | KNORA_WEBAPI_ARK_RESOLVER_URL | http://0.0.0.0:3336 |
| app.ark.assigned-number | KNORA_WEBAPI_ARK_NAAN | 72163 |
| app.knora-api.internal-host | KNORA_WEBAPI_KNORA_API_INTERNAL_HOST | 0.0.0.0 |
| app.knora-api.internal-port | KNORA_WEBAPI_KNORA_API_INTERNAL_PORT | 3333 |
| app.knora-api.external-protocol | KNORA_WEBAPI_KNORA_API_EXTERNAL_PROTOCOL | http |
| app.knora-api.external-host | KNORA_WEBAPI_KNORA_API_EXTERNAL_HOST | 0.0.0.0 |
| app.knora-api.external-port | KNORA_WEBAPI_KNORA_API_EXTERNAL_PORT | 3333 |
| app.sipi.internal-protocol | KNORA_WEBAPI_SIPI_INTERNAL_PROTOCOL | http |
| app.sipi.internal-host | KNORA_WEBAPI_SIPI_INTERNAL_HOST | localhost |
| app.sipi.internal-port | KNORA_WEBAPI_SIPI_INTERNAL_PORT | 1024 |
| app.sipi.external-protocol | KNORA_WEBAPI_SIPI_EXTERNAL_PROTOCOL | http |
| app.sipi.external-host | KNORA_WEBAPI_SIPI_EXTERNAL_HOST | localhost |
| app.sipi.external-port | KNORA_WEBAPI_SIPI_EXTERNAL_PORT | 443 |
| app.ark.resolver | KNORA_WEBAPI_ARK_RESOLVER_URL | http://0.0.0.0:3336 |
| app.ark.assigned-number | KNORA_WEBAPI_ARK_NAAN | 72163
| app.salsah1.base-url | KNORA_WEBAPI_SALSAH1_BASE_URL | http://localhost:3335|
| app.triplestore.dbtype | KNORA_WEBAPI_TRIPLESTORE_DBTYPE | graphdb-se |
| app.triplestore.use-https | KNORA_WEBAPI_TRIPLESTORE_USE_HTTPS | false |
| app.triplestore.host | KNORA_WEBAPI_TRIPLESTORE_HOST | localhost |
| app.triplestore.graphdb.port | KNORA_WEBAPI_TRIPLESTORE_GRAPHDB_PORT | 7200 |
| app.triplestore.graphdb.repository-name | KNORA_WEBAPI_TRIPLESTORE_GRAPHDB_REPOSITORY_NAME | knora-test |
| app.triplestore.graphdb.username | KNORA_WEBAPI_TRIPLESTORE_GRAPHDB_USERNAME | admin |
| app.triplestore.graphdb.password | KNORA_WEBAPI_TRIPLESTORE_GRAPHDB_PASSWORD | root |
| app.triplestore.fuseki.port | KNORA_WEBAPI_TRIPLESTORE_FUSEKI_PORT | 3030 |
| app.triplestore.fuseki.repository-name | KNORA_WEBAPI_TRIPLESTORE_FUSEKI_REPOSITORY_NAME | knora-test |
| app.cache-service.enabled | KNORA_WEBAPI_CACHE_SERVICE_ENABLED | true |
| app.cache-service.redis.host | KNORA_WEBAPI_CACHE_SERVICE_REDIS_HOST | localhost |
| app.cache-service.redis.port | KNORA_WEBAPI_CACHE_SERVICE_REDIS_PORT | 6379 |
| key in application.conf | environment variable | default value |
|-------------------------------------------------------------|-----------------------------------------------------------------|----------------------|
| akka.log-config-on-start | KNORA_AKKA_LOG_CONFIG_ON_START | off |
| akka.loglevel | KNORA_AKKA_LOGLEVEL | INFO |
| akka.actor.deployment.httpTriplestoreRouter.nr-of-instances | KNORA_WEBAPI_DB_CONNECTIONS | 2 |
| akka.stdout-loglevel | KNORA_AKKA_STDOUT_LOGLEVEL | INFO |
| app.print-short-config | KNORA_WEBAPI_PRINT_SHORT_CONFIG | true |
| app.print-extended-config | KNORA_WEBAPI_PRINT_EXTENDED_CONFIG | false |
| app.bcrypt-password-strength | KNORA_WEBAPI_BCRYPT_PASSWORD_STRENGTH | 12 |
| app.jwt-secret-key | KNORA_WEBAPI_JWT_SECRET_KEY | super-secret-key |
| app.jwt-longevity | KNORA_WEBAPI_JWT_LONGEVITY | 30 days |
| app.cookie-domain | KNORA_WEBAPI_COOKIE_DOMAIN | localhost |
| app.allow-reload-over-http | KNORA_WEBAPI_ALLOW_RELOAD_OVER_HTTP | false |
| app.ark.resolver | KNORA_WEBAPI_ARK_RESOLVER_URL | http://0.0.0.0:3336 |
| app.ark.assigned-number | KNORA_WEBAPI_ARK_NAAN | 72163 |
| app.knora-api.internal-host | KNORA_WEBAPI_KNORA_API_INTERNAL_HOST | 0.0.0.0 |
| app.knora-api.internal-port | KNORA_WEBAPI_KNORA_API_INTERNAL_PORT | 3333 |
| app.knora-api.external-protocol | KNORA_WEBAPI_KNORA_API_EXTERNAL_PROTOCOL | http |
| app.knora-api.external-host | KNORA_WEBAPI_KNORA_API_EXTERNAL_HOST | 0.0.0.0 |
| app.knora-api.external-port | KNORA_WEBAPI_KNORA_API_EXTERNAL_PORT | 3333 |
| app.sipi.internal-protocol | KNORA_WEBAPI_SIPI_INTERNAL_PROTOCOL | http |
| app.sipi.internal-host | KNORA_WEBAPI_SIPI_INTERNAL_HOST | localhost |
| app.sipi.internal-port | KNORA_WEBAPI_SIPI_INTERNAL_PORT | 1024 |
| app.sipi.external-protocol | KNORA_WEBAPI_SIPI_EXTERNAL_PROTOCOL | http |
| app.sipi.external-host | KNORA_WEBAPI_SIPI_EXTERNAL_HOST | localhost |
| app.sipi.external-port | KNORA_WEBAPI_SIPI_EXTERNAL_PORT | 443 |
| app.ark.resolver | KNORA_WEBAPI_ARK_RESOLVER_URL | http://0.0.0.0:3336 |
| app.ark.assigned-number | KNORA_WEBAPI_ARK_NAAN | 72163
| app.salsah1.base-url | KNORA_WEBAPI_SALSAH1_BASE_URL | http://localhost:3335|
| app.triplestore.dbtype | KNORA_WEBAPI_TRIPLESTORE_DBTYPE | graphdb-se |
| app.triplestore.use-https | KNORA_WEBAPI_TRIPLESTORE_USE_HTTPS | false |
| app.triplestore.host | KNORA_WEBAPI_TRIPLESTORE_HOST | localhost |
| app.triplestore.graphdb.port | KNORA_WEBAPI_TRIPLESTORE_GRAPHDB_PORT | 7200 |
| app.triplestore.graphdb.repository-name | KNORA_WEBAPI_TRIPLESTORE_GRAPHDB_REPOSITORY_NAME | knora-test |
| app.triplestore.graphdb.username | KNORA_WEBAPI_TRIPLESTORE_GRAPHDB_USERNAME | admin |
| app.triplestore.graphdb.password | KNORA_WEBAPI_TRIPLESTORE_GRAPHDB_PASSWORD | root |
| app.triplestore.fuseki.port | KNORA_WEBAPI_TRIPLESTORE_FUSEKI_PORT | 3030 |
| app.triplestore.fuseki.repository-name | KNORA_WEBAPI_TRIPLESTORE_FUSEKI_REPOSITORY_NAME | knora-test |
| app.cache-service.enabled | KNORA_WEBAPI_CACHE_SERVICE_ENABLED | true |
| app.cache-service.redis.host | KNORA_WEBAPI_CACHE_SERVICE_REDIS_HOST | localhost |
| app.cache-service.redis.port | KNORA_WEBAPI_CACHE_SERVICE_REDIS_PORT | 6379 |

## Selectively Disabling Routes

Expand Down
7 changes: 5 additions & 2 deletions webapi/src/main/resources/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,16 @@ akka.actor.deployment {
/applicationManager/storeManager/triplestoreManager/httpTriplestoreRouter {
router = balancing-pool
nr-of-instances = 10
nr-of-instances = ${?KNORA_WEBAPI_DB_CONNECTIONS}
pool-dispatcher {
executor = "thread-pool-executor"

# allocate exactly 10 threads for this pool
thread-pool-executor {
core-pool-size-min = 10
core-pool-size-max = 10
core-pool-size-min = 2
core-pool-size-min = ${?KNORA_WEBAPI_DB_CONNECTIONS}
core-pool-size-max = 2
core-pool-size-max = ${?KNORA_WEBAPI_DB_CONNECTIONS}
}
}
}
Expand Down

0 comments on commit 19239b2

Please sign in to comment.