diff --git a/docsite/docs/configuration/transforms/musicbrainz.mdx b/docsite/docs/configuration/transforms/musicbrainz.mdx index 7c33213d..3075c531 100644 --- a/docsite/docs/configuration/transforms/musicbrainz.mdx +++ b/docsite/docs/configuration/transforms/musicbrainz.mdx @@ -777,6 +777,10 @@ In the final sorting of Recordings, title score + artist score is combined with ## Best Practices +### Caching + +You **should** setup [metadata caching](/configuration/transforms#caching) to reduce API calls, improve transform performance, and reduce memory usage when using this stage. + ### Sensible Default Generally, the Musicbrainz Stage can be used without any of the [optional configuration](#configuration) and you should still see good results from matches. The top [scored](#score) match is, anecdotally, good enough for correcting and filling in surface-level play data like Title and Artist names. diff --git a/docsite/docs/configuration/transforms/transforms.mdx b/docsite/docs/configuration/transforms/transforms.mdx index 3a860012..b2dc6ff1 100644 --- a/docsite/docs/configuration/transforms/transforms.mdx +++ b/docsite/docs/configuration/transforms/transforms.mdx @@ -585,6 +585,47 @@ The output shows the diff between the previous stage (or original Play) and the +## Best Practices + +### Caching + +MS uses [caching](/configuration/#caching) to reduce the number of API calls needed for stages like [Musicbrainz](/configuration/transforms/musicbrainz) and to speed up all transforms by caching steps and results. However, the default caching strategy uses a small cache size and very short [TTLs](https://en.wikipedia.org/wiki/Time_to_live) because it is *in-memory*. + +**If you are using any Transform stages you should configure [secondary caching with Valkey for Metadata](/configuration/?cacheType=valkey&cachedThings=metadata#secondary-caching-configuration)** to increase the cache size and lifetime of cached items. This will also reduce memory usage in MS. + +
+ +Example + +Add valkey service to your [multi-scrobbler docker compose stack](/installation?runType=docker-compose#docker) and configure MS to use it for metadata: + +```yaml title="docker-compose.yml" +services: + multi-scrobbler: + image: foxxmd/multi-scrobbler + # ... + environment: + # ... + // highlight-start + - CACHE_METADATA=valkey + - CACHE_METADATA_CONN=redis://valkey:6379 + // highlight-end + # ... + + // highlight-start + valkey: + image: valkey/valkey + volumes: + - valkeydata:/data + +volumes: + valkeydata: + driver: local + // highlight-end +``` + +
+ ## Examples See **Examples** sections in specific Stage docs (also in the sidebar): diff --git a/docsite/docs/installation/installation.mdx b/docsite/docs/installation/installation.mdx index 7c3c3ccd..6d88cf2a 100644 --- a/docsite/docs/installation/installation.mdx +++ b/docsite/docs/installation/installation.mdx @@ -177,6 +177,41 @@ services: - /tmp:noexec ``` +### (Optional) Caching With Valkey + +Optionally, add a [Valkey](https://valkey.io/) service to your stack for [secondary caching](/configuration/?cacheType=valkey#secondary-caching-configuration) to take advantage of faster performance and reduced memory usage. + +
+ +Example + +```yaml title="docker-compose.yml" +services: + multi-scrobbler: + image: foxxmd/multi-scrobbler + # ... + environment: + # ... + // highlight-start + CACHE_METADATA=valkey + CACHE_METADATA_CONN=redis://valkey:6379 + // highlight-end + # ... + + // highlight-start + valkey: + image: valkey/valkey + volumes: + - valkeydata:/data + +volumes: + valkeydata: + driver: local + // highlight-end +``` + +
+ ### Docker Usage Example :::tip @@ -193,6 +228,7 @@ The example scenario: * Docker container located on a different IP (`192.168.0.100`) so use [Base URL](/configuration#base-url) * Config/data directory on host machine in a directory next to `docker-compose.yml` * Linux uid/gid is `1000:1000` +* Optional caching using valkey (after uncommenting) @@ -212,27 +248,39 @@ The example scenario: See [`docker-compose.yml`](#docker) sample above for more options and annotations. - ```yaml title="docker-compose.yml" - services: - multi-scrobbler: - image: foxxmd/multi-scrobbler - container_name: multi-scrobbler - environment: - - TZ=Etc/GMT # Specify timezone from TZ Database name found here https://en.wikipedia.org/wiki/List_of_tz_database_time_zones - - JELLYFIN_APIKEY=c9fae8756fbf481ebd9c5bb56bd6540c - - JELLYFIN_URL=192.168.0.101:8096 - - JELLYFIN_USER=MyUser - - BASE_URL=http://192.168.0.100:9078 - - MALOJA_URL=http://domain.tld:42010 - - MALOJA_API_KEY=1234 - - PUID=1000 - - PGID=1000 - volumes: - - "./config:/config" - ports: - - "9078:9078" - restart: unless-stopped - ``` +```yaml title="docker-compose.yml" +services: + multi-scrobbler: + image: foxxmd/multi-scrobbler + container_name: multi-scrobbler + environment: + - TZ=Etc/GMT # Specify timezone from TZ Database name found here https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + - JELLYFIN_APIKEY=c9fae8756fbf481ebd9c5bb56bd6540c + - JELLYFIN_URL=192.168.0.101:8096 + - JELLYFIN_USER=MyUser + - BASE_URL=http://192.168.0.100:9078 + - MALOJA_URL=http://domain.tld:42010 + - MALOJA_API_KEY=1234 + - PUID=1000 + - PGID=1000 + # uncomment along with valkey service/volume below for better caching + #- CACHE_METADATA=valkey + #- CACHE_METADATA_CONN=redis://valkey:6379 + volumes: + - ./config:/config + ports: + - 9078:9078 + restart: unless-stopped + + #valkey: + # image: valkey/valkey + # volumes: + # - valkeydata:/data + +#volumes: +# valkeydata: +# driver: local +``` diff --git a/docsite/docs/quickstart.mdx b/docsite/docs/quickstart.mdx index d745789d..3860c553 100644 --- a/docsite/docs/quickstart.mdx +++ b/docsite/docs/quickstart.mdx @@ -336,6 +336,7 @@ Visit `http://192.168.0.100:9078` to see the dashboard where ## Next Steps * See more advanced docker options as well as other install methods in the [**Installation**](/installation#docker) docs + * Setup [secondary caching](/configuration/?cacheType=valkey#secondary-caching-configuration) with [valkey](/installation/#optional-caching-with-valkey) for increased performance and reduced memory usage * Review the [**Configuration**](/configuration) docs * Learn about how to configure multi-scrobbler using files for more complicated Source/Client scenarios * See all available [**Sources**](/configuration/sources) and [**Clients**](/configuration/clients) alongside configuration examples