FSAssets Service
From OpenSimulator
Contents |
FS Assets
FSAssets is intended for larger grids where the size of the database is expected to exceed 50GB. This option will save the assets to the file system as opposed to the default service which stores assets as blobs in the database. This option also provides deduplication abilities, each asset is hashed when it is received for storage and if the asset already exists, the asset service will link to the existing file rather than store two copies.
Config Options
To enable FSAssets, open Robust.ini or Robust.HG.ini depending on whether you are running a standard or hypergrid enabled grid and find the AssetService section. Change the LocalServiceModule from the current option to:
LocalServiceModule = "OpenSim.Services.FSAssetService.dll:FSAssetConnector"
Also uncomment the following required settings, these are specific to FSAssets:
BaseDirectory = "./fsassets/data" SpoolDirectory = "./fsassets/tmp"
The following are optional FSAsset config options:
;FallbackService = "OpenSim.Services.AssetService.dll:AssetService" ;DaysBetweenAccessTimeUpdates = 30
;StorageProvider = "" ;ConnectionString = "" ;Realm = "fsassets"
- BaseDirectory
- This is the folder in which the asset data will be saved.
- SpoolDirectory
- The spool directory is a folder used for temporary storage while the asset is hashed and compressed before it gets moved to the BaseDirectory. This must be on the same file system as the base directory.
- FallbackService
- If you are upgrading from the default asset service, uncomment this and set the default asset connector. This will allow FSAssets to retrieve an existing asset from the old service and add it to the BaseDirectory. The fallback service is checked when an asset is requested but not found by FSAssets.
- DaysBetweenAccessTimeUpdates
- By default, the access time is updated each time an asset is requested. This option can be used to skip this update for assets that already have a recent access time and reduce calls to the database.
- StorageProvider
- To change where the metadata is saved you can set a specific storage provider and connection string. If this is disabled, the default storage provider given in the database section will be used to save metadata.
- ConnectionString
- DB connection string for the optional StorageProvider mentioned above.
- Realm
- The table name to save metadata in the database. Default is 'fsassets'
Migration
While FSAssets will use the FallBackService if set, to convert any existing assets when they are requested and not found, this will not automatically convert all the old assets to the new service. To convert all assets from the default service there is a console command provided:
import <conn> <table> [<start> <count>]
The import command expects a database connection string and the name of the legacy asset table to be passed as parameters. The following example shows how to start the import process for a MySQL database, just change the connection details to match your database schema, username and password:
import "Data Source=localhost;Database=SCHEMA;User ID=USER;Password=PASS;Old Guids=true;" assets
Depending on the size of your existing assets table, the import process will take some time to complete. The optional parameters, start and count allow you to specify the position and number of rows to convert.
Hypergrid Assets
If your grid has hypergrid enabled, you probably have it setup to use the HGAssetService for sharing assets with other grids. In this situation you will need to change the HGAssetService section of your Robust.ini to point to the FSAssets version of the HGAssetService known as HGFSAssetService.
To enable the HGFSAssetService, find the HGAssetService section of your Robust.ini, the LocalServiceModule should be changed to:
LocalServiceModule = "OpenSim.Services.HypergridService.dll:HGFSAssetService"