RavenDB: How can I prevent high RAM utilization?

杀马特。学长 韩版系。学妹 提交于 2019-12-06 03:16:47
Jim G.

@Ayende Rahein knows infinitely more about RavenDB than I do, but here is what worked for me:

  1. Take(300) was too much. I needed to change this to Take(128) .
  2. With a 3.10 GHz quad core client machine, I was peppering a 2.50 GHz single core server with queries inside of a Parallel.ForEach loop. I needed to specify the degree of parallelism: Parallel.ForEach(objects, new ParallelOptions { MaxDegreeOfParallelism = 3 }, currentObject => { /* My Query */ });
  3. I needed to configure the following options on my DocumentStore instance: _store.Conventions.DisableProfiling = true; _store.Conventions.ShouldCacheRequest = url => false; _store.DisableAggressiveCaching();
  4. And in cases where I needed to page my query and make multiple batch requests within a single session, I needed the following:
    ravenSession.Advanced.Evict(doc); // for each loaded doc

I hope this helps somebody else!

Jim, Do no assume that this is a cache issue. I would assume it is your indexing. Do you have a map/reduce index with multiple from clauses or a SelectMany?

Also, the best place to handle such issues is the mailing list for ravendb.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!