Multi Threading - YAMJ/yamj-v2 GitHub Wiki

Using the Multi-Threading Parameters to speed up MovieJukebox

Introduction

With v1.6 of MovieJukebox, Multi-Threading has been introduced to enhance the speed of MovieJukebox. This page will attempt to explain what multi-threading does and how you can tweak it to your set-up.

!MovieJukebox Performance

Let's be clear about where the perceived performance of MovieJukebox can be improved:

  1. The greatest speed cost is having MovieJukebox remote from the PC/Mac running it. ALWAYS run it from a local machine, a lot of temp files are written during the run and if MovieJukebox is saving them over the network then it will slow down the generation A LOT (Especially over wireless, and even wired networking is slower than local storage).
  2. The location of the video files relative to the PC/Mac running MovieJukebox: - Local is best - Wired network OK - Wireless BAD. It's a function of how long it takes to scan the locations for the information over the network and the latencies involved.
  3. Each video file is analysed in turn, looking for local artwork, nfo files, existing jukebox information, etc. A lot of file, means a lot of searches.
  4. The amount of artwork that needs to be downloaded. The more artwork to get, the longer it takes. E.g. Aeon skin uses Posters, Fanart, Banners and video images, where as the default skin uses just posters.
  5. Copying the local temp jukebox files to a remote jukebox. See #2. If YAMJ has to copy the files to a network drive, it can take some time. Some users prefer to generate local jukeboxes and then copy the jukebox using other file copying methods.

Where does Multi-threading help?

Multi-threading speeds up #3 (mjb.MaxThreadsScan) & #4 (mjb.MaxThreadsProcess). These are often the longest/slowest parts of the run, certainly #3 is for existing jukeboxes and #4 for new jukeboxes.

mjb.MaxThreadsScan

Setting mjb.MaxThreadsScan > 1 means that there are that many threads running in parallel searching your library at the same time.

How many should you use?

This largely depends on your set-up and PC/Mac capability. If you have a low bandwidth wireless connection, you probably wont see much benefit beyond 5. If you have local video files and a modern PC, 15 would probably work fine. Unfortunately it's a trial and error approach.

mjb.MaxThreadsProcess

Setting mjb.MaxThreadsProcess (in conjunction with some other parameters detailed below) is what limits the downloads threads for specific sites. So, as the scanning threads are requesting downloads they are put in a "queue" for the processing threads to download. The scanning threads then wait for the processing threads to finish before continuing their scan, so there is no point making this setting more than the mjb.MaxThreadsScan setting.

Just because you set this property to 10 or so, doesn't mean that you will download 10 times as fast, it means that there are 10 download slots for the scanning threads to use, and these can be further restricted by the sites that they are pulling from. For example, TheTVDB and TheMovieDB are set to 2 each, meaning that even if there are 10 threads requesting downloads, only 2 will be processed at any one time for each of these sites (see below). This is to prevent us overloading these sites with download requests.

Why don't I just set this to 2 then? Well, you might get the situation where you are downloading 2 threads from TheTVDB.com, 2 from TheMovieDB.com, 5 from IMDB and 1 from google: And that's where the speed increase will come from.

Limiting Downloads Per Site

To be completed...