Skip to content

Commit

Permalink
k9-pdfgen-psb går tom for tråder i prod, gjør det konfigurerbart så v…
Browse files Browse the repository at this point in the history
…i kan sette våre egne verdier (#303)

Signed-off-by: inga <[email protected]>
  • Loading branch information
inavga authored Jan 28, 2025
1 parent 29c219a commit f46a817
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ COPY templates /app/templates # handlebars templates
COPY fonts /app/fonts # fonts to be embedded
COPY resources /app/resources # additional resources
```
If you need to specify your own worker group size, connection group size or call group size you may add these as environment variables in the
Dockerfile. The variable names are WORKER_GROUP_SIZE, CONNECTION_GROUP_SIZE and CALL_GROUP_SIZE.


Check GitHub releases to find the latest `release` version
Check [GitHub releases](https://github.com/navikt/pdfgen/releases) to find the latest `release` version
Expand Down
11 changes: 11 additions & 0 deletions src/main/kotlin/no/nav/pdfgen/Application.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,22 @@ val logger: Logger = LoggerFactory.getLogger("pdfgen")
fun main() {
DefaultExports.initialize()

val workerSize = System.getenv("WORKER_GROUP_SIZE")?.toIntOrNull()
val connectionSize = System.getenv("CONNECTION_GROUP_SIZE")?.toIntOrNull()
val callSize = System.getenv("CALL_GROUP_SIZE")?.toIntOrNull()

val embeddedServer =
embeddedServer(
factory = Netty,
module = Application::module,
configure = {
// defaultverdiene er hentet fra io.ktor.server.engine.ApplicationEngine
workerGroupSize = workerSize ?: (parallelism / 2 + 1)
logger.info("Setter worker group size: $workerGroupSize")
connectionGroupSize = connectionSize ?: (parallelism / 2 + 1)
logger.info("Setter connection group size: $connectionGroupSize")
callGroupSize = callSize ?: parallelism
logger.info("Setter call group size: $callGroupSize")
responseWriteTimeoutSeconds = 70
connector { port = Environment().port }
},
Expand Down

0 comments on commit f46a817

Please sign in to comment.