uSync Performance Tuning
We work hard to make uSync's impact on your site as small as possible, but as your site gets larger some of the work uSync has to do to keep the sync folders in order will increase.
In most cases you shouldn't need to tune uSync performance.
The following tips can help you do less work, and make uSync run faster.
Keep uSync Up to Date​
Running the latest version of uSync will ensure you are running with all the latest fixes and updates. This way uSync can run as fast and trouble free as possible.
You can keep an eye on the latest releases on the uSync github page. You can also check the issues for performance
label to see if we have made any performance related improvements or fixes.
Keep Your uSync Folder Up to Date​
Occasionally an update in Umbraco or uSync functionality will cause us to make a change in the format/detail of the uSync .config
files. When this happens, we will increment the 'format version' of the files and uSync will warn you that the files might be using an old version.
Within a major version and often between major versions the files will still be compatible but changes can lead to "false positives" when checking files.
Checks are always faster then import operations, To minimize "false positives" in uSync when checking files, perform clean exports after you upgrade uSync minor versions (e.g 10.0 -> 10.1).
Turn off ExportOnSave If You Don't Use the Files.​
If you don't need the uSync files producing on the production site because you are never going to copy them down from production, then you can turn off all syncing.
The drawback is if you make any changes to the production site directly, they will be lost, and you will be back to doing a side by side comparison of items in the browser. In the perfect world, no one touches production, but it can happen.
Don't Sync Content/Media If You Don't Need to.​
The default configuration for uSync will sync content and media items to disk when they are saved. If you are not going to use 'standard' uSync to sync content (e.g via the uSync dashboard) then you can turn off the content and media sync.
If you are using uSync.Complete and uSync.Publisher to push and pull your content between sites you can turn off the default Content/Media as the the files in the uSync/v9 folder are not used for this process.
If you only want to sync settings to disk you can set the ExportOnSave
setting to Settings
in the appsettings.json
file:
{
"uSync": {
"Settings": {
"ExportOnSave": "Settings",
}
}
}
Use Flat Folders and Guid Filenames​
By default, when you save an item, uSync checks on disk to see if the item has been renamed.
The default is to store the uSync file using the name or alias of an item, which makes it easier to view when looking at changes in source control.
However, this means that when an item is renamed, the filename changes. uSync then has to scan the files to find what the old file was called and mark it as a rename in the new file.
If you have lots of content, this can mean a lot of scanning the folders looking for the changes. So you can remove this rename file scan by using the `UseFlatStructure" and "GuidNames" settings
"uSync": {
"Sets" : {
"Default" : {
"HandlerDefaults" :{
"UseFlatStructure": true,
"GuidNames": true,
}
}
}
}
Switching to guid file names will reduce the amount of checks that uSync needs to perform when an item is saved or deleted. Flat folders reduce the need to check multiple folders when an item is moved in Umbraco.
With these two settings, things will be saved to disk using the items key (GUID) as the filename, so when an items is renamed or moved the actual file doesn't get renamed or moved. This way, uSync doesn't perform the scan of files, which will reduce disk traffic on a large site significantly.
The disadvantage here is that files become hard to recognise manually, and changes are harder to visually track but this is not always a big issue, depending on how you are managing your site.
Switching to guid file names on a large site can have an impact on save/update times.
Don't Import at Startup​
From uSync v9 Import at Startup is off by default, but if turned on on a large import during startup it can impact the start times for your site. While a sync might only take a few seconds, during this time the site will still be 'booting' and may not be available to users.
Ensure Import at Startup is off for your site.
This setting is off by default, so if there is no entry in your appsettings.json file, ImportAtStartup will be false
{
"uSync": {
"Settings": {
"ImportAtStartup": "None",
}
}
}