Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debugging With RavenDB Is Horrendously Slow

Tags:

ravendb

I'm using RavenDB version 2.0.3.0. When the debugger is attached, everything involving RavenDB runs horrendously slow. Every query takes several seconds to complete.

If I press pause while the debugger is just sitting there, I always see it hung up with the following call trace:

Lucene.Net.dll!Lucene.Net.QueryParsers.FastCharStream.Refill() Line 91 C# Lucene.Net.dll!Lucene.Net.QueryParsers.FastCharStream.ReadChar() Line 53 C# Lucene.Net.dll!Lucene.Net.QueryParsers.QueryParserTokenManager.JjMoveNfa_3(int startState, int curPos) Line 604 + 0x1b bytes C# Lucene.Net.dll!Lucene.Net.QueryParsers.QueryParserTokenManager.JjMoveStringLiteralDfa0_3() Line 94 + 0xd bytes C# Lucene.Net.dll!Lucene.Net.QueryParsers.QueryParserTokenManager.GetNextToken() Line 1379 + 0x9 bytes C# Lucene.Net.dll!Lucene.Net.QueryParsers.QueryParser.Jj_ntk() Line 1929 + 0x1d bytes C# Lucene.Net.dll!Lucene.Net.QueryParsers.QueryParser.Clause(string field) Line 1373 + 0x1d bytes C# Lucene.Net.dll!Lucene.Net.QueryParsers.QueryParser.Query(string field) Line 1301 + 0xc bytes C# Lucene.Net.dll!Lucene.Net.QueryParsers.QueryParser.TopLevelQuery(string field) Line 1287 + 0xc bytes C# Lucene.Net.dll!Lucene.Net.QueryParsers.QueryParser.Parse(string query) Line 223 + 0xf bytes C# Raven.Database.dll!Raven.Database.Indexing.QueryBuilder.BuildQuery(string query, Raven.Abstractions.Data.IndexQuery indexQuery, Raven.Database.Indexing.RavenPerFieldAnalyzerWrapper analyzer) Line 56 + 0xe bytes C# Raven.Database.dll!Raven.Database.Indexing.Index.IndexQueryOperation.GetLuceneQuery(string query, Raven.Abstractions.Data.IndexQuery indexQuery) Line 1120 + 0x1d bytes C# Raven.Database.dll!Raven.Database.Indexing.Index.IndexQueryOperation.GetLuceneQuery() Line 1081 + 0x28 bytes C# Raven.Database.dll!Raven.Database.Indexing.Index.IndexQueryOperation.Query() Line 803 + 0x26 bytes C# [External Code] Raven.Database.dll!Raven.Database.DocumentDatabase.Query.AnonymousMethod__8e(Raven.Database.Storage.IStorageActionsAccessor actions) Line 1220 + 0x145 bytes C# Raven.Database.dll!Raven.Database.DocumentDatabase.Query(string index, Raven.Abstractions.Data.IndexQuery query) Line 1237 C# Raven.Database.dll!Raven.Database.Queries.DynamicQueryRunner.ExecuteActualQuery(Raven.Abstractions.Data.IndexQuery query, Raven.Database.Data.DynamicQueryMapping map, System.Tuple touchTemporaryIndexResult, string realQuery) Line 82 + 0x32b bytes C# Raven.Database.dll!Raven.Database.Queries.DynamicQueryRunner.ExecuteDynamicQuery(string entityName, Raven.Abstractions.Data.IndexQuery query) Line 49 + 0x15 bytes C# Raven.Database.dll!Raven.Database.Queries.DynamicQueryExtensions.ExecuteDynamicQuery(Raven.Database.DocumentDatabase self, string entityName, Raven.Abstractions.Data.IndexQuery indexQuery) Line 19 + 0x11 bytes C# Raven.Client.Embedded.dll!Raven.Client.Embedded.EmbeddedDatabaseCommands.Query(string index, Raven.Abstractions.Data.IndexQuery query, string[] includes, bool metadataOnly, bool indexEntriesOnly) Line 389 + 0x47 bytes C# Raven.Client.Lightweight.dll!Raven.Client.Document.AbstractDocumentQuery>.ExecuteActualQuery() Line 535 + 0x50 bytes C# Raven.Client.Lightweight.dll!Raven.Client.Document.AbstractDocumentQuery>.InitSync() Line 518 C# Raven.Client.Lightweight.dll!Raven.Client.Document.AbstractDocumentQuery>.QueryResult.get() Line 505 C# Raven.Client.Lightweight.dll!Raven.Client.Linq.RavenQueryProviderProcessor.ExecuteQuery() Line 1425 + 0x1b bytes C# Raven.Client.Lightweight.dll!Raven.Client.Linq.RavenQueryProviderProcessor.Execute(System.Linq.Expressions.Expression expression) Line 1398 + 0x3d bytes C#

If I run without the debugger attached, everything performs fine and fast... I've never encountered this problem before yesterday.

I'm using an EmbeddableDocumentStore with DataDir=~\App_Data\RavenDB.

I tried deleting the RavenDB directory, but even with a completely fresh DB, Raven is still just as slow.

Any idea what's wrong or how I can troubleshoot?

like image 366
Jeff Avatar asked Nov 12 '22 07:11

Jeff


1 Answers

If you are using IntelliTrace, shut it down. In exception settings, mark Just My Code and don't stop on handled exceptions.

like image 143
Ayende Rahien Avatar answered Dec 21 '22 15:12

Ayende Rahien