Media Server can use multiple threads to perform some analysis tasks on video. (If your source media is a single image or document, Media Server always uses one thread for each analysis task).
Using multiple threads allows Media Server to process multiple video frames simultaneously. You might want to use multiple threads for the following reasons:
Media Server can use multiple threads for performing:
Bayesian
or MaxVote
classifiers, but not CNN
classifiers.To specify the number of threads that an analysis task can use, set the NumParallel
configuration parameter in the task section of your configuration. For example:
[FaceDetect] Type=FaceDetect Database=Faces NumParallel=2 [NumberPlate] Type=NumberPlate Location=UK NumParallel=2
It is important to consider the total number of threads that Media Server will use. For example, a configuration for monitoring a television broadcast might include the following tasks:
NumParallel=2
(so face detection will use two threads).NumParallel=2
(two threads).NumParallel=1
(one thread).This demonstrates that a single process
action can easily consume many threads (at least eight in the previous example). If you have configured Media Server to run multiple process actions simultaneously, then the total number of threads consumed is multiplied by the number of actions that you are running. It is important to install Media Server on a server with sufficient resources.
The optimum number of threads to use for processing depends on the number of CPU cores your server has available. Increasing the number of threads used by Media Server up to this limit will increase throughput. For example if your server has 20 CPU cores then allowing Media Server to consume 16 threads rather than 8 should almost double throughput. Using more threads than the server has CPU cores may increase throughput but the improvement will be smaller for each additional thread. Using significantly more threads than the server has CPU cores is not recommended and may decrease performance.
|