With the help of this module, you can ensure that a tenant that didn't receive any requests for a configurable time will shut down. This can be used to free up resources and thus increase site density.
This module contains the feature below.
This feature is available on any tenant. The maximum idle time can be set in the appsettings.json.
NOTE: Any tenant can have its own set of maximum idle time, however by default there is only one global time set.
public void ConfigureServices(IServiceCollection services) =>
services.AddOrchardCms(
builder => builder.AddTenantFeatures(Lombiq.Hosting.Tenants.IdleTenantManagement.Constants.FeatureNames.ShutDownIdleTenants));
NOTE: This way the feature will also be enabled on the Default tenant. You may not want to use this feature on the default tenant, so configure the corresponding MaxIdleMinutes
as 0
. You can do this in an appsettings.json file like this (see the docs for more details):
{
"OrchardCore": {
"Default": {
"Lombiq_Hosting_Tenants_IdleTenantManagement": {
"IdleShutdownOptions": {
"MaxIdleMinutes": 0
}
}
}
}
}