···777777778778## Best Practices
779779780780+### Caching
781781+782782+You **should** setup [metadata caching](/configuration/transforms#caching) to reduce API calls, improve transform performance, and reduce memory usage when using this stage.
783783+780784### Sensible Default
781785782786Generally, 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.
···585585586586</details>
587587588588+## Best Practices
589589+590590+### Caching
591591+592592+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*.
593593+594594+**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.
595595+596596+<details>
597597+598598+<summary>Example</summary>
599599+600600+Add valkey service to your [multi-scrobbler docker compose stack](/installation?runType=docker-compose#docker) and configure MS to use it for metadata:
601601+602602+```yaml title="docker-compose.yml"
603603+services:
604604+ multi-scrobbler:
605605+ image: foxxmd/multi-scrobbler
606606+ # ...
607607+ environment:
608608+ # ...
609609+ // highlight-start
610610+ - CACHE_METADATA=valkey
611611+ - CACHE_METADATA_CONN=redis://valkey:6379
612612+ // highlight-end
613613+ # ...
614614+615615+ // highlight-start
616616+ valkey:
617617+ image: valkey/valkey
618618+ volumes:
619619+ - valkeydata:/data
620620+621621+volumes:
622622+ valkeydata:
623623+ driver: local
624624+ // highlight-end
625625+```
626626+627627+</details>
628628+588629## Examples
589630590631See **Examples** sections in specific Stage docs (also in the sidebar):
+69-21
docsite/docs/installation/installation.mdx
···177177 - /tmp:noexec
178178```
179179180180+### (Optional) Caching With Valkey
181181+182182+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.
183183+184184+<details>
185185+186186+<summary>Example</summary>
187187+188188+```yaml title="docker-compose.yml"
189189+services:
190190+ multi-scrobbler:
191191+ image: foxxmd/multi-scrobbler
192192+ # ...
193193+ environment:
194194+ # ...
195195+ // highlight-start
196196+ CACHE_METADATA=valkey
197197+ CACHE_METADATA_CONN=redis://valkey:6379
198198+ // highlight-end
199199+ # ...
200200+201201+ // highlight-start
202202+ valkey:
203203+ image: valkey/valkey
204204+ volumes:
205205+ - valkeydata:/data
206206+207207+volumes:
208208+ valkeydata:
209209+ driver: local
210210+ // highlight-end
211211+```
212212+213213+</details>
214214+180215### Docker Usage Example
181216182217:::tip
···193228* Docker container located on a different IP (`192.168.0.100`) so use [Base URL](/configuration#base-url)
194229* Config/data directory on host machine in a directory next to `docker-compose.yml`
195230* Linux uid/gid is `1000:1000`
231231+* Optional caching using valkey (after uncommenting)
196232197233<Tabs groupId="runType" queryString>
198234 <TabItem value="docker" label="Docker">
···212248 <TabItem value="docker-compose" label="Docker Compose" default>
213249 See [`docker-compose.yml`](#docker) sample above for more options and annotations.
214250215215- ```yaml title="docker-compose.yml"
216216- services:
217217- multi-scrobbler:
218218- image: foxxmd/multi-scrobbler
219219- container_name: multi-scrobbler
220220- environment:
221221- - TZ=Etc/GMT # Specify timezone from TZ Database name found here https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
222222- - JELLYFIN_APIKEY=c9fae8756fbf481ebd9c5bb56bd6540c
223223- - JELLYFIN_URL=192.168.0.101:8096
224224- - JELLYFIN_USER=MyUser
225225- - BASE_URL=http://192.168.0.100:9078
226226- - MALOJA_URL=http://domain.tld:42010
227227- - MALOJA_API_KEY=1234
228228- - PUID=1000
229229- - PGID=1000
230230- volumes:
231231- - "./config:/config"
232232- ports:
233233- - "9078:9078"
234234- restart: unless-stopped
235235- ```
251251+```yaml title="docker-compose.yml"
252252+services:
253253+ multi-scrobbler:
254254+ image: foxxmd/multi-scrobbler
255255+ container_name: multi-scrobbler
256256+ environment:
257257+ - TZ=Etc/GMT # Specify timezone from TZ Database name found here https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
258258+ - JELLYFIN_APIKEY=c9fae8756fbf481ebd9c5bb56bd6540c
259259+ - JELLYFIN_URL=192.168.0.101:8096
260260+ - JELLYFIN_USER=MyUser
261261+ - BASE_URL=http://192.168.0.100:9078
262262+ - MALOJA_URL=http://domain.tld:42010
263263+ - MALOJA_API_KEY=1234
264264+ - PUID=1000
265265+ - PGID=1000
266266+ # uncomment along with valkey service/volume below for better caching
267267+ #- CACHE_METADATA=valkey
268268+ #- CACHE_METADATA_CONN=redis://valkey:6379
269269+ volumes:
270270+ - ./config:/config
271271+ ports:
272272+ - 9078:9078
273273+ restart: unless-stopped
274274+275275+ #valkey:
276276+ # image: valkey/valkey
277277+ # volumes:
278278+ # - valkeydata:/data
279279+280280+#volumes:
281281+# valkeydata:
282282+# driver: local
283283+```
236284 </TabItem>
237285</Tabs>
238286
+1
docsite/docs/quickstart.mdx
···336336## Next Steps
337337338338* See more advanced docker options as well as other install methods in the [**Installation**](/installation#docker) docs
339339+ * Setup [secondary caching](/configuration/?cacheType=valkey#secondary-caching-configuration) with [valkey](/installation/#optional-caching-with-valkey) for increased performance and reduced memory usage
339340* Review the [**Configuration**](/configuration) docs
340341 * Learn about how to configure multi-scrobbler using files for more complicated Source/Client scenarios
341342 * See all available [**Sources**](/configuration/sources) and [**Clients**](/configuration/clients) alongside configuration examples