简体   繁体   English

RavenDB服务器模式性能

[英]RavenDB Server Mode Performance

I'm trying to get data from my RavenDB database. 我正在尝试从我的RavenDB数据库中获取数据。 I created a static index and tried to do my request through my webservice using the recommended DLL Raven.Client.Lightweight. 我创建了一个静态索引,并尝试使用推荐的DLL Raven.Client.Lightweight通过我的Web服务发出请求。 This step takes 3 seconds to get data. 此步骤需要3秒钟来获取数据。

But if i do the same query through the RavenDB interface, I get the data in 10 ms (see fewer). 但是,如果我通过RavenDB接口执行相同的查询,则会在10毫秒内获得数据(请参阅更少的内容)。

Have you any idea why the execution time is slow in server mode ? 您知道为什么在服务器模式下执行时间会很慢吗?

Thanks! 谢谢!

EDIT : Here some code : I initialize my document in the global.asax of my webservice : 编辑:这里有一些代码:我在我的Web服务的global.asax中初始化我的文档:

public class Global : System.Web.HttpApplication
{
    public static DocumentStore store;
    protected void Application_Start(object sender, EventArgs e)
    {
        store = new DocumentStore { Url = Settings.Default.Url };
        store.Initialize();
        store.Conventions.AllowQueriesOnId = true;
    }
}

My Request : public static class ServiceBusiness { private static IDocumentSession Session = GetSession("programs"); 我的请求:公共静态类ServiceBusiness {私有静态IDocumentSession会话= GetSession(“程序”);

    public void MyTestMethod (string MyParamId, string PageNume, string  NbItems)
    {
        List<Content> contents = new List<Content>();
        using (var Session = Global.store.OpenSession("MyDb"))
            {
                contents = Session.Query<Content>("Test")
                                .Where(x => x.Programs.Any(y => y.Products.Any(z => z.Values.Any(w => w.Id == MyParamId))))
                                .Skip((int.Parse(PageNum) - 1) * int.Parse(NbItems))
                                .Take(int.Parse(NbItems))
                                .ToList();
            }
    }
}

Finally, the high response time is due to the size of packets sent in the network (limited to 1514 bytes). 最后,高响应时间归因于网络中发送的数据包的大小(限制为1514字节)。 We spend many time to assemble all the packets. 我们花费很多时间来组装所有数据包。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM