/// <summary>Initializes, sets up and runs CouchDB (+couchdb-lucene) instance.</summary>
		public static CouchDBWatchdog Bootstrap(BootstrapSettings settings)
		{
			settings.Lock();

			RunStartupTasks(settings);
			var watchdog = new CouchDBWatchdog(settings);
			watchdog.Start();
			CouchDBReplicator.UpdateReplicationState(
				new IPEndPoint(IPAddress.Loopback, settings.EndpointToListenOn.Port), 
				settings.ReplicationSettings
			);
			return watchdog;
		}
		public override bool OnStart()
		{
			// Set the maximum number of concurrent connections 
			ServicePointManager.DefaultConnectionLimit = 12;
			var diagnosticsConfiguration = DiagnosticMonitor.GetDefaultInitialConfiguration();
			diagnosticsConfiguration.WindowsEventLog.ScheduledTransferPeriod = TimeSpan.FromMinutes(1);
			diagnosticsConfiguration.Logs.ScheduledTransferPeriod = TimeSpan.FromMinutes(1);
			diagnosticsConfiguration.DiagnosticInfrastructureLogs.ScheduledTransferPeriod = TimeSpan.FromMinutes(1);
			CouchDBAzureBootstrapper.ConfigureLogTransfer(diagnosticsConfiguration.Directories);
			diagnosticsConfiguration.Directories.ScheduledTransferPeriod = TimeSpan.FromMinutes(1);
			DiagnosticMonitor.Start(
				"Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString",
				diagnosticsConfiguration);

			//try {
			watchdog = CouchDBAzureBootstrapper.StartAndWaitForResult();
			//} catch { }

			return true;
		}