I'm using RavenDB .Net client 2.5.2700 and server build 2700.
Calls to DocumentStore.Initialize()
are taking 21 seconds and change even when the server is warm.
Watching with Fiddler the call to Raven/Databases/<database>
returns nearly immediately but the client waits for the call to databases/<database>/docs/Raven/Replication/Destinations
to return a 404 which takes quite a while. I do not have the replication bundle installed/enabled on the server and I'm fine with the client being aware of that fact.
Is there any way to configure the DocumentStore
on the .Net RavenDB client so it skips the replication check?
Here's the simplest example of my connection, this is with the default install of raven server on my local network.
private static void Main(string[] args)
{
Stopwatch sw = new Stopwatch();
using (var documentStore = new DocumentStore() { Url = @"http://hal9013s:8080/", DefaultDatabase = "Qonqr" })
{
//This takes away the replication check call but there's still a consistent 21 second pause
documentStore.Conventions.FailoverBehavior = FailoverBehavior.FailImmediately;
sw.Start();
documentStore.Initialize();
sw.Stop();
Console.WriteLine("At {0} it took {1} total seconds to initialize", DateTime.UtcNow, sw.Elapsed.TotalSeconds);
}
Console.WriteLine("Press Any Key To Exit");
Console.ReadKey(true);
}
Two sequential runs give the following results:
At 12/1/2013 8:55:15 AM it took 21.2308527 total seconds to initialize
At 12/1/2013 8:55:55 AM it took 21.2484128 total seconds to initialize
Edit: Changed the client from version 2750 to 2700 as Matt Johnson's comment suggested. Edit 2: Added example code