Open topic with navigation

# Synchronize with the Latest Training

Training Media Server updates the training database. However, the training is not used in analysis operations until Media Server has synchronized with the database. Synchronization loads the data from the database into memory and makes it ready for use. Synchronization is necessary because several Media Servers can share a single database, and you can use any Media Server to perform training.

The default configuration ensures that analysis uses the latest training data, but you can customize Media Server for your use case.

## Automatic Synchronization

The default configuration ensures that analysis uses the latest training data, no matter how often you train Media Server and how much training data you add to the database.

Before it starts a `process` action that requires training data, Media Server synchronizes with the training database and waits for the synchronization to complete. This is because the `SyncDatabase` parameter - available for tasks that use stored training data - has a default value of `TRUE`.

Media Server also synchronizes with the database at regular intervals (by default, every second). You can configure the interval between each synchronization by setting the `SyncInterval` parameter in the `[Database]` section of the configuration file. This is important for processing video streams, because when you process a stream Media Server could continue running the same action for days or weeks. Automatic synchronization ensures that Media Server regularly loads the latest training without you having to intervene.

NOTE:

If you add a large amount of training data and then immediately start a `process` action, Media Server might not use the latest training. This is because some training actions are asynchronous and the new training might not have been committed to the database before the `process` action starts. The new training will therefore not be synchronized. To be sure that Media Server is using the latest training, ensure that all training actions for the training that you wish to use have completed before sending the `process` action.

## Manual Synchronization

In some cases, you might want to control when Media Server synchronizes with the training database:

- In a production environment, you might modify the training only at known times. In this case you might prefer to disable automatic synchronization, because forcing Media Server to query the database before it starts processing each request can reduce the processing speed.
- If you are processing a continuous video stream, you might not want Media Server to synchronize with the latest training while processing is in progress.
- You might want to disable automatic synchronization to ensure that a batch of `process` requests all use the same training. If you are processing discrete files, you might perform training in bulk and then process batches of files.

The configuration parameter `ScheduledSync` specifies whether Media Server synchronizes with the database at regular intervals. The default value is `periodic`, which enables scheduled synchronization at intervals defined by the parameter `SyncInterval`. To load training data when Media Server starts, but not synchronize with the database at regular intervals, set `ScheduledSync=startup`. To disable scheduled synchronization completely, set `ScheduledSync=never`. In this case, Media Server does not load any training data when it starts and does not synchronize with the database at timed intervals.

To prevent Media Server synchronizing with the database before it starts a `process` action, set `SyncDatabase=FALSE` in the relevant analysis tasks. With this setting, be aware that `process` requests could use outdated training.

If you disable automatic synchronization but want to ensure that Media Server has synchronized with the latest training, run the `SyncClassifiers` action before you send the `process` action. The `SyncClassifiers` action forces Media Server to synchronize with the database, and after it completes, you can be sure that Media Server is using the latest training data.

## Reduce Memory Use

With automatic synchronization, described above, Media Server loads all training data into memory. If you have an extremely large training database that contains many face databases, object databases, classifiers, and so on, this can consume a significant amount of memory.

To load only the training you need, set `ScheduledSync=startup` or `ScheduledSync=never` to disable scheduled synchronization. If you set `ScheduledSync=startup`, Media Server loads all training data when it starts but you can remove training from memory as required. If you set `ScheduledSync=never`, Media Server does not load any training data when it starts, so you can load only the training data you need. With either of these options, Media Server does not synchronize with the database at regular intervals.

To load training or remove training from memory, use one of the following methods:

- To synchronize with the latest training before beginning an analysis task, set `SyncDatabase=TRUE` in the `[TaskName]` section for your analysis task. Media Server will load the training it needs to complete the task. This ensures that Media Server uses the latest training.

- To prevent Media Server synchronizing with the training database before beginning a task, set `SyncDatabase=FALSE` in the `[TaskName]` section for your analysis task. Then, manually synchronize the training data by running the action `SyncClassifiers`.
- To remove all image classification training from memory, use the action `UnsyncClassifiers`.

© 2017 Hewlett Packard Enterprise Development LP | Send documentation feedback to HPE Close Send documentation feedback To open the configured email client on this computer, open an email window. Otherwise, copy the information below to a web mail client, and send this email to AutonomyTPFeedback@hpe.com. We appreciate your feedback! Product: Topic Title: Help Topic: Feedback:

_HP_HTML5_bannerTitle.htm