Open topic with navigation

# Synchronize with the Latest Training

Training HPE Media Server updates the training database. However, the training is not used in analysis operations until HPE 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 HPE Media Servers can share a single database, and you can use any HPE Media Server to perform training.

The default configuration ensures that analysis uses the latest training data, but you can customize HPE 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 HPE Media Server and how much training data you add to the database.

Before it starts a `process` action that requires training data, HPE 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`.

HPE 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 HPE Media Server could continue running the same action for days or weeks. Automatic synchronization ensures that HPE 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 HPE 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 HPE 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 HPE 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 HPE 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 HPE 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 HPE 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, HPE Media Server does not load any training data when it starts and does not synchronize with the database at timed intervals.

To prevent HPE 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 HPE Media Server has synchronized with the latest training, run the `SyncFaces`, `SyncDetectors`, `SyncObjects`, and `SyncClassifiers` actions before you send the `process` action. These actions force HPE Media Server to synchronize with the database. After they complete, you can be sure that HPE Media Server is using the latest training data.

## Reduce Memory Use

With automatic synchronization, described above, HPE Media Server loads all training data into memory. If you have an extremely large training database that contains many face databases, object databases, and classifiers, 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`, HPE Media Server will load all training data when it starts but you can remove training from memory as required. If you set `ScheduledSync=never`, HPE 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, HPE 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. HPE Media Server will load the training it needs to complete the task. This ensures that HPE Media Server uses the latest training.
- To prevent HPE 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 you need by running the actions `SyncFaces`, `SyncDetectors`, `SyncObjects`, and `SyncClassifiers`. You can add the `database` parameter to the `SyncFaces` and `SyncObjects` actions to choose which database to load into memory.
- To remove face databases, object databases, or classifiers from memory, you can use the actions `UnsyncFaces`, `UnsyncDetectors`, `UnsyncObjects`, or `UnsyncClassifiers`.

© 2016 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