Skip to content

Commit cc84297

Browse files
authored
increase threadpool size to avoid thread starvation (#8686)
We’ve seen some symptoms of thread starvation (health check timeouts despite systems looking normal). It is plausible that 300 threads may get stuck in synchronous waiting, e.g. for high-latency remote GCS endpoints. Increasing the thread pool size helps mitigate this problem to some extent. A better solution would presumably be separate thread pools #8685 ### URL of deployed dev instance (used for testing): - https://morethreads.webknossos.xyz ------ - [x] Updated [changelog](../blob/master/CHANGELOG.unreleased.md#unreleased) - [x] Needs datastore update after deployment
1 parent c240321 commit cc84297

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

MIGRATIONS.unreleased.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,7 @@ User-facing changes are documented in the [changelog](CHANGELOG.released.md).
88
## Unreleased
99
[Commits](https://github.com/scalableminds/webknossos/compare/25.06.1...HEAD)
1010

11+
- The default thread pool size was increased from 5 to 10 times the number of available CPUs (capped at 1000). Note that wk may need slightly more memory because of this. [#8686](https://github.com/scalableminds/webknossos/pull/8686)
12+
1113
### Postgres Evolutions:
1214
- [134-dataset-layer-attachments.sql](conf/evolutions/134-dataset-layer-attachments.sql)

conf/application.conf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ play {
6666
pekko.actor.default-dispatcher {
6767
# We use a compromise for our thread pool configuration
6868
# Parts of our api are async, so they should not need many threads,
69-
# but some parts are also blocking (file io, gcs, s3 access), causing new requests
69+
# but some parts are also blocking (some file io, gcs access), causing new requests
7070
# to wait despite idle cpu, if there are too few threads
7171
fork-join-executor {
72-
parallelism-factor = 5.0 # Thread count = ceil(available processors * factor)
72+
parallelism-factor = 10.0 # Thread count = ceil(available processors * factor)
7373
parallelism-min = 8 # Min number of threads to cap factor-based parallelism number to
74-
parallelism-max = 300 # Max number of threads to cap factor-based parallelism number to
74+
parallelism-max = 1000 # Max number of threads to cap factor-based parallelism number to
7575
}
7676
}
7777

webknossos-datastore/conf/standalone-datastore.conf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ play {
3838
pekko.actor.default-dispatcher {
3939
# We use a compromise for our thread pool configuration
4040
# Parts of our api are async, so they should not need many threads,
41-
# but some parts are also blocking (file io, gcs, s3 access), causing new requests
41+
# but some parts are also blocking (some file io, gcs access), causing new requests
4242
# to wait despite idle cpu, if there are too few threads
4343
fork-join-executor {
44-
parallelism-factor = 5.0 # Thread count = ceil(available processors * factor)
44+
parallelism-factor = 10.0 # Thread count = ceil(available processors * factor)
4545
parallelism-min = 8 # Min number of threads to cap factor-based parallelism number to
46-
parallelism-max = 300 # Max number of threads to cap factor-based parallelism number to
46+
parallelism-max = 1000 # Max number of threads to cap factor-based parallelism number to
4747
}
4848
}
4949

webknossos-tracingstore/conf/standalone-tracingstore.conf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ play {
3838
pekko.actor.default-dispatcher {
3939
# We use a compromise for our thread pool configuration
4040
# Parts of our api are async, so they should not need many threads,
41-
# but some parts are also blocking (file io, gcs, s3 access), causing new requests
41+
# but some parts are also blocking (some file io, gcs access), causing new requests
4242
# to wait despite idle cpu, if there are too few threads
4343
fork-join-executor {
44-
parallelism-factor = 5.0 # Thread count = ceil(available processors * factor)
44+
parallelism-factor = 10.0 # Thread count = ceil(available processors * factor)
4545
parallelism-min = 8 # Min number of threads to cap factor-based parallelism number to
46-
parallelism-max = 300 # Max number of threads to cap factor-based parallelism number to
46+
parallelism-max = 1000 # Max number of threads to cap factor-based parallelism number to
4747
}
4848
}
4949

0 commit comments

Comments
 (0)