internal override void StampPersistableDefaultValues() { if (!base.IsModified(MailboxDatabaseSchema.ProhibitSendReceiveQuota)) { this.ProhibitSendReceiveQuota = new Unlimited <ByteQuantifiedSize>(ByteQuantifiedSize.FromMB(2355UL)); } if (!base.IsModified(MailboxDatabaseSchema.ProhibitSendQuota)) { this.ProhibitSendQuota = new Unlimited <ByteQuantifiedSize>(ByteQuantifiedSize.FromGB(2UL)); } if (!base.IsModified(MailboxDatabaseSchema.RecoverableItemsWarningQuota)) { this.RecoverableItemsWarningQuota = new Unlimited <ByteQuantifiedSize>(ByteQuantifiedSize.FromGB(20UL)); } if (!base.IsModified(MailboxDatabaseSchema.RecoverableItemsQuota)) { this.RecoverableItemsQuota = new Unlimited <ByteQuantifiedSize>(ByteQuantifiedSize.FromGB(30UL)); } if (!base.IsModified(MailboxDatabaseSchema.CalendarLoggingQuota)) { this.CalendarLoggingQuota = new Unlimited <ByteQuantifiedSize>(ByteQuantifiedSize.FromGB(6UL)); } this.ReservedFlag = true; base.StampPersistableDefaultValues(); }
public static CapacityProjectionData FromSettings(ILoadBalanceSettings settings) { ByteQuantifiedSize reservedCapacity = ByteQuantifiedSize.FromGB((ulong)((long)settings.ReservedCapacityInGb)); double consumerGrowthRate = (double)settings.ConsumerGrowthRate / 100.0; double organizationGrowthRate = (double)settings.OrganizationGrowthRate / 100.0; return(new CapacityProjectionData(consumerGrowthRate, organizationGrowthRate, settings.CapacityGrowthPeriods, reservedCapacity)); }
public static void IncreaseRecoverableItemsQuotaIfNeeded(ADUser user) { if (RecoverableItemsQuotaHelper.IsIncreasingQuotaEnabled(user) && VariantConfiguration.InvariantNoFlightingSnapshot.Global.MultiTenancy.Enabled && user.IsInLitigationHoldOrInplaceHold && ((user.UseDatabaseQuotaDefaults != null && user.UseDatabaseQuotaDefaults.Value) || (!user.RecoverableItemsQuota.IsUnlimited && user.RecoverableItemsQuota.Value.ToGB() < RecoverableItemsQuotaHelper.RecoverableItemsQuotaForMailboxesOnHoldInGB))) { user.UseDatabaseQuotaDefaults = new bool?(false); user.RecoverableItemsQuota = ByteQuantifiedSize.FromGB(RecoverableItemsQuotaHelper.RecoverableItemsQuotaForMailboxesOnHoldInGB); user.RecoverableItemsWarningQuota = ByteQuantifiedSize.FromGB(RecoverableItemsQuotaHelper.RecoverableItemsWarningQuotaForMailboxesOnHoldInGB); } }
internal override void StampPersistableDefaultValues() { if (!base.IsModified(PublicFolderDatabaseSchema.MaxItemSize)) { this.MaxItemSize = new Unlimited <ByteQuantifiedSize>(ByteQuantifiedSize.FromKB(10240UL)); } if (!base.IsModified(PublicFolderDatabaseSchema.ProhibitPostQuota)) { this.ProhibitPostQuota = new Unlimited <ByteQuantifiedSize>(ByteQuantifiedSize.FromGB(2UL)); } base.StampPersistableDefaultValues(); }
internal override void StampPersistableDefaultValues() { if (!base.IsModified(LegacyMailboxDatabaseSchema.ProhibitSendReceiveQuota)) { this.ProhibitSendReceiveQuota = new Unlimited <ByteQuantifiedSize>(ByteQuantifiedSize.FromMB(2355UL)); } if (!base.IsModified(LegacyMailboxDatabaseSchema.ProhibitSendQuota)) { this.ProhibitSendQuota = new Unlimited <ByteQuantifiedSize>(ByteQuantifiedSize.FromGB(2UL)); } base.StampPersistableDefaultValues(); }
public IEnumerable <BandMailboxRebalanceData> BalanceForest(LoadContainer forest) { IEnumerable <BandMailboxRebalanceData> result; try { this.logger.Log(MigrationEventType.Information, "Starting a new load balancing procedure using the band algorithm.", new object[0]); this.results = new List <BandMailboxRebalanceData>(); this.logger.Log(MigrationEventType.Verbose, "Using {0} bands for balancing.", new object[] { this.bands.Count }); this.logger.Log(MigrationEventType.Verbose, "Calculating total database weight in the forest.", new object[0]); DatabaseWeightAggregator databaseWeightAggregator = new DatabaseWeightAggregator(); forest.Accept(databaseWeightAggregator); this.logger.Log(MigrationEventType.Verbose, "Forest has a '{0}' total database weight.", new object[] { databaseWeightAggregator.TotalWeight }); this.totalDataSelectedToMove = new ByteQuantifiedSize(0UL); foreach (Band band in this.bands) { BandDataAggregator bandDataAggregator = new BandDataAggregator(band); forest.Accept(bandDataAggregator); this.BalanceBand(band, (double)databaseWeightAggregator.TotalWeight, bandDataAggregator.BandData.ToArray <BandData>()); } ByteQuantifiedSize byteQuantifiedSize = ByteQuantifiedSize.FromGB((ulong)this.settings.MaximumBatchSizeGb); ByteQuantifiedSize totalBatchSize = this.GetTotalBatchSize(); if (totalBatchSize > byteQuantifiedSize) { this.logger.LogWarning("Total selected size is {0}, but we're only allowed to rebalance {1}. Reducing batch.", new object[] { totalBatchSize, byteQuantifiedSize }); IBatchSizeReducer batchSizeReducer = BatchSizeReducerFactory.Instance.GetBatchSizeReducer(byteQuantifiedSize, totalBatchSize, this.logger); result = batchSizeReducer.ReduceBatchSize(this.results); } else { result = this.results; } } finally { this.logger.Log(MigrationEventType.Information, "Finished load balancing procedure using the band algorithm. {0} rebalancing entries created.", new object[] { this.results.Count }); } return(result); }
private ByteQuantifiedSize GetMaximumDatabaseFileSizeForDag(DatabaseAvailabilityGroup dag) { ByteQuantifiedSize result; if (dag != null && dag.MailboxLoadBalanceMaximumEdbFileSize != null) { result = dag.MailboxLoadBalanceMaximumEdbFileSize.Value; } else { result = ByteQuantifiedSize.FromGB((ulong)this.settings.DefaultDatabaseMaxSizeGb); } return(result); }
// Token: 0x0600254A RID: 9546 RVA: 0x000875BC File Offset: 0x000857BC public OwaServerTraceLogConfiguration() { this.IsLoggingEnabled = AppConfigLoader.GetConfigBoolValue("OWAIsServerTraceLoggingEnabled", true); this.LogPath = AppConfigLoader.GetConfigStringValue("OWATraceLogPath", OwaServerTraceLogConfiguration.DefaultLogPath); this.MaxLogAge = AppConfigLoader.GetConfigTimeSpanValue("OWATraceMaxLogAge", TimeSpan.Zero, TimeSpan.MaxValue, TimeSpan.FromDays(5.0)); this.MaxLogDirectorySizeInBytes = (long)OwaAppConfigLoader.GetConfigByteQuantifiedSizeValue("OWATraceMaxLogDirectorySize", ByteQuantifiedSize.FromGB(1UL)).ToBytes(); this.MaxLogFileSizeInBytes = (long)OwaAppConfigLoader.GetConfigByteQuantifiedSizeValue("OWATraceMaxLogFileSize", ByteQuantifiedSize.FromMB(10UL)).ToBytes(); this.OwaTraceLoggingThreshold = AppConfigLoader.GetConfigDoubleValue("OwaTraceLoggingThreshold", 0.0, 0.0, 0.0); }
internal override void StampPersistableDefaultValues() { if (!base.IsModified(OrganizationSchema.DefaultPublicFolderProhibitPostQuota)) { this.DefaultPublicFolderProhibitPostQuota = new Unlimited <ByteQuantifiedSize>(ByteQuantifiedSize.FromGB(2UL)); } if (!base.IsModified(OrganizationSchema.DefaultPublicFolderIssueWarningQuota)) { this.DefaultPublicFolderIssueWarningQuota = this.DefaultPublicFolderProhibitPostQuota * 85 / 100; } base.StampPersistableDefaultValues(); }
internal void CreateClassificationComparisonLogger() { ILogConfig config = new LogConfig(true, "InferenceClassificationComparisons", "InferenceClassificationComparisons", Path.Combine(ExchangeSetupContext.InstallPath, "Logging\\InferenceClassification\\Comparisons"), new ulong?(ByteQuantifiedSize.FromGB(2UL).ToBytes()), new ulong?(ByteQuantifiedSize.FromMB(10UL).ToBytes()), new TimeSpan?(TimeSpan.FromDays(30.0)), 4096); this.classificationComparisonLogger = new InferenceClassificationComparisonLogger(config); }
public ClientExceptionLogConfiguration() { this.IsLoggingEnabled = AppConfigLoader.GetConfigBoolValue("IsClientExceptionLoggingEnabled", true); this.LogPath = AppConfigLoader.GetConfigStringValue("ClientExceptionLogPath", ClientExceptionLogConfiguration.DefaultLogPath); this.MaxLogAge = AppConfigLoader.GetConfigTimeSpanValue("ClientExceptionMaxLogAge", TimeSpan.Zero, TimeSpan.MaxValue, TimeSpan.FromDays(30.0)); this.MaxLogDirectorySizeInBytes = (long)ClientLogConfiguration.GetConfigByteQuantifiedSizeValue("ClientExceptionMaxLogDirectorySize", ByteQuantifiedSize.FromGB(1UL)).ToBytes(); this.MaxLogFileSizeInBytes = (long)ClientLogConfiguration.GetConfigByteQuantifiedSizeValue("ClientExceptionMaxLogFileSize", ByteQuantifiedSize.FromMB(10UL)).ToBytes(); }
// Token: 0x0600144F RID: 5199 RVA: 0x00075368 File Offset: 0x00073568 public Configuration() { bool configBoolValue = AppConfigLoader.GetConfigBoolValue("InferenceDataCollectionIsLoggingEnabled", true); LoggingLevel configEnumValue = AppConfigLoader.GetConfigEnumValue <LoggingLevel>("InferenceDataCollectionLoggingLevel", LoggingLevel.Debug); string configStringValue = AppConfigLoader.GetConfigStringValue("InferenceDataCollectionLogPath", Configuration.DefaultLogPath); TimeSpan configTimeSpanValue = AppConfigLoader.GetConfigTimeSpanValue("InferenceDataCollectionMaxLogAge", TimeSpan.Zero, TimeSpan.MaxValue, TimeSpan.FromDays(30.0)); ByteQuantifiedSize byteQuantifiedSize = ConfigurationUtils.ReadByteQuantifiedSizeValue("InferenceDataCollectionMaxLogDirectorySize", ByteQuantifiedSize.FromGB(1UL)); ByteQuantifiedSize byteQuantifiedSize2 = ConfigurationUtils.ReadByteQuantifiedSizeValue("InferenceDataCollectionMaxLogFileSize", ByteQuantifiedSize.FromMB(10UL)); base.MetadataLogConfig = new LogConfig(configBoolValue, "InferenceMetadata", "InferenceMetadata", Path.Combine(configStringValue, "Metadata"), new ulong?(byteQuantifiedSize.ToBytes()), new ulong?(byteQuantifiedSize2.ToBytes()), new TimeSpan?(configTimeSpanValue), 4096); base.DiagnosticLogConfig = new DiagnosticLogConfig(configBoolValue, "InferenceDataCollection", "InferenceDataCollection", configStringValue, new ulong?(byteQuantifiedSize.ToBytes()), new ulong?(byteQuantifiedSize2.ToBytes()), new TimeSpan?(configTimeSpanValue), configEnumValue); base.MailboxReprocessAge = AppConfigLoader.GetConfigTimeSpanValue("InferenceDataCollectionMailboxReprocessAge", TimeSpan.Zero, TimeSpan.MaxValue, TimeSpan.FromDays(30.0)); base.ModuloNumberToRandomize = AppConfigLoader.GetConfigIntValue("InferenceDataCollectionModuloNumberToRandomize", 1, int.MaxValue, 500); this.ModuloNumberToRandomizeForGroups = AppConfigLoader.GetConfigIntValue("InferenceDataCollectionModuloNumberToRandomizeForGroups", 1, int.MaxValue, 10); base.BlackListedFolders = ConfigurationUtils.ReadCommaSeperatedStringValue("InferenceDataCollectionBlackListedFolders", null); base.WhiteListedFolders = ConfigurationUtils.ReadCommaSeperatedStringValue("InferenceDataCollectionWhiteListedFolders", null); base.MinimumItemCountInMailbox = AppConfigLoader.GetConfigIntValue("InferenceDataCollectionMinimumItemCountInMailbox", 0, int.MaxValue, 0); base.MinimumSentItemsCount = AppConfigLoader.GetConfigIntValue("InferenceDataCollectionMinimumSentItemsCount", 0, int.MaxValue, 0); base.NumberOfItemsPerFolderToProcess = AppConfigLoader.GetConfigIntValue("InferenceDataCollectionNumberOfItemsPerFolderToProcess", 0, int.MaxValue, int.MaxValue); base.MinimumSentItemsPercentage = AppConfigLoader.GetConfigIntValue("InferenceDataCollectionMinimumSentItemsPercentage", 0, 100, 0); base.IsOutputSanitized = AppConfigLoader.GetConfigBoolValue("InferenceDataCollectionIsOutputSanitized", true); base.QueryPageSize = AppConfigLoader.GetConfigIntValue("InferenceDataCollectionQueryPageSize", 0, 32767, 100); base.CollectMessageBodyProps = AppConfigLoader.GetConfigBoolValue("InferenceDataCollectionCollectMessageBodyProps", false); base.ChunkSize = AppConfigLoader.GetConfigIntValue("InferenceDataCollectionChunkSize", 1, int.MaxValue, 1000); base.ItemMaxAttemptCount = AppConfigLoader.GetConfigIntValue("InferenceDataCollectionItemMaxAttemptCount", 1, 10, 3); }
private void BalanceBand(Band band, double totalDatabaseWeight, BandData[] bandData) { this.logger.Log(MigrationEventType.Information, "Balancing band '{0}' with '{1}' data entries.", new object[] { band, bandData.Count <BandData>() }); double moveUnitsPerWeight = (double)bandData.Sum((BandData data) => data.TotalWeight) / totalDatabaseWeight; double num = (band.Profile == Band.BandProfile.SizeBased) ? band.MailboxSizeWeightFactor : 0.0; double deviation = (double)this.settings.WeightDeviationPercent / 100.0; ByteQuantifiedSize byteQuantifiedSize = ByteQuantifiedSize.FromGB((ulong)this.settings.MaximumAmountOfDataPerRoundGb); this.logger.Log(MigrationEventType.Verbose, "Moving with a deviation of '{0}', a minimum delta of '{1}' and a maximum of '{2}' per database.", new object[] { deviation, num, byteQuantifiedSize }); List <BandData> list = (from data in bandData orderby this.GetBandDelta(moveUnitsPerWeight, deviation, data) descending select data).ToList <BandData>(); foreach (BandData bandData2 in list) { double num2 = this.GetBandDelta(moveUnitsPerWeight, deviation, bandData2); this.logger.Log(MigrationEventType.Verbose, "Attempting to balance band {0} for database {1}, current delta is {2}.", new object[] { band, bandData2.Database, num2 }); LoadMetric instance = PhysicalSize.Instance; if (num2 <= num) { this.logger.Log(MigrationEventType.Information, "Not balancing band {0} for database {1} because delta {2} is either less than the minimum of {3} or database has no more available space ({4}). We're done.", new object[] { band, bandData2.Database, num2, num, bandData2.Database.AvailableCapacity.GetSizeMetric(instance) }); break; } foreach (BandData bandData3 in from data in bandData orderby data.TotalWeight select data) { if (!bandData3.Database.CanAcceptBalancingLoad) { this.logger.Log(MigrationEventType.Verbose, "Database {0} can not be used as target because it can't take LB load.", new object[] { bandData3.Database }); } else { double num3 = this.GetBandDelta(moveUnitsPerWeight, 0.0 - deviation, bandData3); this.logger.Log(MigrationEventType.Verbose, "Trying to place weight into {0} (current delta: {1}).", new object[] { bandData3.Database, num3 }); ByteQuantifiedSize sizeMetric = bandData3.Database.AvailableCapacity.GetSizeMetric(instance); if (0.0 - num3 > sizeMetric.ToMB()) { this.logger.Log(MigrationEventType.Verbose, "Target delta of {0} is larger than the {1} available space in the database, adjusting.", new object[] { num3, sizeMetric }); num3 = 0.0 - sizeMetric.ToMB(); this.logger.Log(MigrationEventType.Verbose, "New target delta is {0}.", new object[] { num3 }); } if (num3 >= 0.0) { this.logger.Log(MigrationEventType.Verbose, "Target database is above the threshold, skipping as a target.", new object[0]); } else { ByteQuantifiedSize sizeMetric2 = bandData3.Database.CommittedLoad.GetSizeMetric(instance); ByteQuantifiedSize byteQuantifiedSize2; if (sizeMetric2 > byteQuantifiedSize) { byteQuantifiedSize2 = ByteQuantifiedSize.Zero; } else { byteQuantifiedSize2 = byteQuantifiedSize - sizeMetric2; } int num4 = (int)Math.Floor(byteQuantifiedSize2.ToMB() / band.MailboxSizeWeightFactor); if (num4 <= 0) { this.logger.Log(MigrationEventType.Verbose, "Target database committed load is {0} which is over the limit of {1}, skipping as a target.", new object[] { sizeMetric2, byteQuantifiedSize }); } else { int num5 = (int)Math.Min(Math.Round(Math.Min(Math.Abs(num2), Math.Abs(num3))), (double)num4); this.logger.Log(MigrationEventType.Verbose, "Projected to move {0} units out of {1} and into {2}", new object[] { num5, bandData2.Database, bandData3.Database }); if (num5 > 0) { ByteQuantifiedSize value = ByteQuantifiedSize.FromMB((ulong)((double)num5 * band.MailboxSizeWeightFactor)); LoadMetricStorage loadMetricStorage = new LoadMetricStorage(); loadMetricStorage[band] = (long)num5; BandMailboxRebalanceData item = new BandMailboxRebalanceData(bandData2.Database, bandData3.Database, loadMetricStorage); bandData3.TotalWeight += num5; LoadMetricStorage committedLoad; LoadMetric metric; (committedLoad = bandData3.Database.CommittedLoad)[metric = instance] = committedLoad[metric] + (long)value.ToBytes(); this.totalDataSelectedToMove += value; bandData2.TotalWeight -= num5; this.results.Add(item); num2 -= (double)num5; } if (num2 <= num) { break; } } } } } } }
static InferenceDiagnosticsLog() { InferenceDiagnosticsLog.Schema = new LogSchema("Microsoft Exchange", InferenceDiagnosticsLog.Version, "InferenceDiagnosticsLog", InferenceDiagnosticsLog.Columns); string fileNamePrefix = string.Format("{0}_{1}_{2}_", "InferenceDiagnosticsLog", InferenceDiagnosticsLog.ProcessName, InferenceDiagnosticsLog.ProcessId.ToString()); InferenceDiagnosticsLog.Logger = new Log(fileNamePrefix, new LogHeaderFormatter(InferenceDiagnosticsLog.Schema), "InferenceDiagnosticsLog"); InferenceDiagnosticsLog.Logger.Configure(InferenceDiagnosticsLog.LogPath, TimeSpan.FromDays(7.0), (long)ByteQuantifiedSize.FromGB(1UL).ToBytes(), (long)ByteQuantifiedSize.FromMB(10UL).ToBytes()); }