RavenDB查询响应时间长,而在服务器上处理速度非常快

Dmi*_*ich 2 .net ravendb

Raven.Server启动并绑定到端口8022.我按以下方式初始化DataStore:

        var store = new DocumentStore() { Url = "http://localhost:8022" };
        store.Initialize();
Run Code Online (Sandbox Code Playgroud)

然后我正在做这样的查询:

        using (var session = store.OpenSession())
        {
            Stopwatch watch = new Stopwatch();
            watch.Start();

            var result = session.LuceneQuery<Item>("Raven/DocumentsByEntityName")
                .WhereEquals("Tag", "Items")
                .ToList();

            watch.Stop(); // watch.ElapsedMilliseconds == ~550 ms

            return result;

        }
Run Code Online (Sandbox Code Playgroud)

并且watch.ElapsedMilliseconds总是~550毫秒.但是当我查看RavenDB控制台时,我看到该查询在3毫秒内处理完毕:

Request # 170: GET     -    3 ms - 200 - /indexes/Raven/DocumentsByEntityName?query=Tag%253A%255B%255BItems%255D%255D&start=0&pageSize=128
Run Code Online (Sandbox Code Playgroud)

因此,大约99.5%的时间不在RavenDB中.问题是什么?(RavenDB 147)

当我切换到RavenDB的自托管(即作为嵌入式客户端)时,一切都还可以(~3ms).

为了澄清该问题不在网络,http调试器,DNS服务器等.我也测试了这个:

            Stopwatch watch = new Stopwatch();
            watch.Start();

            WebClient client = new WebClient();
            var result = client.DownloadString("http://127.0.0.1:8022/indexes/Raven/DocumentsByEntityName?query=Tag%253A%255B%255BItems%255D%255D&start=0&pageSize=128");

            watch.Stop(); // watch.ElapsedMilliseconds == ~3-10ms
Run Code Online (Sandbox Code Playgroud)

快速.但切换到Raven.Client.Lightweight会增加响应时间200次(550-600 ms)

Dmi*_*ich 6

问题是因为我的电脑上的中间人 - NOD32.如果您还在使用它 - 取消选中以下复选框:

设置 - >高级设置 - >防病毒和反间谍软件 - >协议过滤 - >"启用应用程序协议内容过滤"

简单地禁用防病毒或防火墙无济于事!