aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2026-01-19 12:53:17 -0600
committerGitHub <noreply@github.com>2026-01-19 12:53:17 -0600
commit6fdc317978fd91fbfd5828ee72c7e7f19c316b13 (patch)
tree0370a03f1fadda7e6d4979cb4ee46c4d75880e8d /docs
parent9c1c726f2de69dd3fd38740f5bdb7f1f76e97fcf (diff)
parent5b302ae5f2e0c01cb111a37680d63df3d47b114d (diff)
downloadslskd-6fdc317978fd91fbfd5828ee72c7e7f19c316b13.tar.gz
Merge pull request #1608 from slskd/search-metrics
Add throttling for incoming search requests, add additional prometheus metrics covering search responses
Diffstat (limited to 'docs')
-rw-r--r--docs/config.md33
1 files changed, 31 insertions, 2 deletions
diff --git a/docs/config.md b/docs/config.md
index 2f8bdb1e..9836a063 100644
--- a/docs/config.md
+++ b/docs/config.md
@@ -471,7 +471,7 @@ Users added to the blacklist will be blocked from enqueueing any new files. Any
A managed blacklist file may also be used to achieve the same effects. Read more about this in the [Managed Blacklist](#managed-blacklist) section below.
-**YAML**
+#### **YAML**
```yaml
groups:
blacklisted:
@@ -640,7 +640,7 @@ Child connections should generally only be disabled on low spec systems or situa
Depending on the current state, changing these values may require the server connection to be reset.
| Command-Line | Environment Variable | Description |
-| ------------------------- | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| ------------------------- | ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--slsk-no-dnet` | `SLSKD_SLSK_NO_DNET` | Determines whether the distributed network is disabled. If disabled, the client will not obtain a parent or any child connections, and will not receive distributed search requests. |
| `--slsk-dnet-no-children` | `SLSKD_SLSK_DNET_NO_CHILDREN` | Determines whether to disallow distributed children |
| `--slsk-dnet-children` | `SLSKD_SLSK_DNET_CHILDREN` | The maximum number of distributed children to accept |
@@ -979,6 +979,35 @@ retention:
logs: 180 # days
```
+# Throttling
+
+> [!WARNING]
+> **Application Stability Risk**: The options in this section control the behavior of the application at the limits of the hosting environment's performance. Increasing values can result in unintended behavior and crashes. Support for users that increase these values will be limited.
+
+slskd is a multi-threaded application and the logic is highly concurrent, but is mostly bound by disk and network I/O rather than CPU.
+
+The `concurrency` option controls how many threads (.NET `Task`s to be specific) can perform work at the same time, limiting I/O contention. Raising the number _can_ improve throughput on capable machines but defaults are generally set in such a way that improvements will be negligible. Lowering the number will reduce throughput but alleviate I/O contention and improve stability on lower-spec hardware.
+
+Lower values of `concurrency` or slow processing of individual messages may cause the application to process messages at a slower rate than they are received, causing messages to be 'backed up' in internal queues. The `circuit_breaker` option controls the number of messages that can be enqueued. Once the circuit breaker is hit, the application will drop or discard messages without processing them.
+
+The latency, queue depth and rate at which messages are being dropped can be monitored by reviewing the application state or Prometheus metrics.
+
+| Command Line | Environment Variable | Description |
+| -------------------------------------------------- | ------------------------------------------------------ | ----------------------------------------------------------------------------------------------------- |
+| `--throttling-search-incoming-concurrency` | `SLSKD_THROTTLING_SEARCH_INCOMING_CONCURRENCY` | The limit for the number of concurrent search response operations |
+| `--throttling-search-incoming-circuit-breaker` | `SLSKD_THROTTLING_SEARCH_INCOMING_CIRCUIT_BREAKER` | The limit for the number of queued search response operations, after which requests will be discarded |
+| `--throttling-search-incoming-response-file-limit` | `SLSKD_THROTTLING_SEARCH_INCOMING_RESPONSE_FILE_LIMIT` | The limit for the number of files that can be returned in a single search request |
+
+#### **YAML**
+```yaml
+throttling:
+ search:
+ incoming:
+ concurrency: 10 # number of search requests to process at the same time
+ circuit_breaker: 500 # maximum number of pending search requests
+ response_file_limit: 500 # maximum number of files to return in a single search response
+```
+
# Integrations
## User-Defined