Hi there,
We're using RavenDB as part of our data import / processing side of things, as well as for display. We're running processes that will pull a document from Raven, process it and put it back in. Admittedly we can do this at pretty high speeds, we're using Windows Azure worker roles to do the heavy lifting before putting the data back.
What we're finding is even with indexing paused on the effected databases, the memory for RavenDB goes up and up and up until it reaches 99%, and then (understandably) it stops servicing responses and the database becomes unusable. Then the Azure worker roles get upset because they can't write to or read from Raven, and things just go south from there.
Is this because of sheer number of requests? We're not talking an unreasonable amount of incoming data here, definitely not enough to fill up the RAM with the documents alone at any one time.
On a probably related note, when we stop processing and restart the Raven service (we have to since it doesn't recover by itself), it will rightly start indexing stuff. This too leads to Raven committing memory suicide again.
What (if anything) are we doing wrong here? I'm happy to send server logs to someone looking into this, though I can't post it on this group as it contains the data as it starts being indexed again.
I have observed these exceptions occuring in the logs at around the time it all went weird and I'm posting them in case they help:
2014-08-14 14:25:10.3386,Raven.Database.Server.Abstractions.HttpListenerContextAdpater,Info,Failed to close response,"System.AggregateException: One or more errors occurred. ---> System.Net.HttpListenerException: The specified network name is no longer available
at System.Net.HttpResponseStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at Raven.Database.Util.Streams.BufferPoolStream.InternalFlush()
at Raven.Database.Util.Streams.BufferPoolStream.Flush()
at Raven.Database.Impl.ExceptionAggregator.Execute(Action action)
--- End of inner exception stack trace ---
at Raven.Database.Impl.ExceptionAggregator.ThrowIfNeeded()
at Raven.Database.Server.Abstractions.HttpListenerResponseAdapter.Close()
at Raven.Database.Server.Abstractions.HttpListenerContextAdpater.FinalizeResponse()
---> (Inner Exception #0) System.Net.HttpListenerException (0x80004005): The specified network name is no longer available
at System.Net.HttpResponseStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at Raven.Database.Util.Streams.BufferPoolStream.InternalFlush()
at Raven.Database.Util.Streams.BufferPoolStream.Flush()
at Raven.Database.Impl.ExceptionAggregator.Execute(Action action)<---
"
and in a non-aggregate flavour
2014-08-14 14:29:58.2577,Raven.Database.Server.HttpServer,Warn,Error on request,"System.Net.HttpListenerException (0x80004005): The specified network name is no longer available
at System.Net.HttpResponseStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at Raven.Database.Util.Streams.BufferPoolStream.InternalFlush()
at Raven.Database.Util.Streams.BufferPoolStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at System.IO.Compression.DeflateStream.WriteDeflaterOutput(Boolean isAsync)
at System.IO.Compression.DeflateStream.Write(Byte[] array, Int32 offset, Int32 count)
at System.IO.Compression.GZipStream.Write(Byte[] array, Int32 offset, Int32 count)
at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder)
at System.IO.StreamWriter.Write(Char[] buffer, Int32 index, Int32 count)
at Raven.Imports.Newtonsoft.Json.Utilities.JavaScriptUtils.WriteEscapedJavaScriptString(TextWriter writer, String s, Char delimiter, Boolean appendDelimiters, Boolean[] charEscapeFlags, StringEscapeHandling stringEscapeHandling)
at Raven.Imports.Newtonsoft.Json.JsonTextWriter.WriteValue(String value)
at Raven.Json.Linq.RavenJValue.WriteTo(JsonWriter writer, JsonConverter[] converters)
at Raven.Json.Linq.RavenJObject.WriteTo(JsonWriter writer, JsonConverter[] converters)
at Raven.Json.Linq.RavenJArray.WriteTo(JsonWriter writer, JsonConverter[] converters)
at Raven.Json.Linq.RavenJObject.WriteTo(JsonWriter writer, JsonConverter[] converters)
at Raven.Json.Linq.RavenJArray.WriteTo(JsonWriter writer, JsonConverter[] converters)
at Raven.Json.Linq.RavenJObject.WriteTo(JsonWriter writer, JsonConverter[] converters)
at Raven.Database.Extensions.HttpExtensions.WriteJson(IHttpContext context, RavenJToken obj)
at Raven.Database.Server.Responders.Index.GetIndexQueryResult(IHttpContext context, String index)
at Raven.Database.Server.HttpServer.DispatchRequest(IHttpContext ctx)
at Raven.Database.Server.HttpServer.HandleActualRequest(IHttpContext ctx)"
And slightly similarly:
2014-08-14 14:29:59.6774,Raven.Database.Server.Abstractions.HttpListenerContextAdpater,Info,Failed to close response,"System.AggregateException: One or more errors occurred. ---> System.Net.HttpListenerException: An operation was attempted on a nonexistent network connection
at System.Net.HttpResponseStream.Dispose(Boolean disposing)
at System.IO.Stream.Close()
at Raven.Database.Util.Streams.BufferPoolStream.Dispose(Boolean disposing)
at System.IO.Stream.Close()
at Raven.Database.Impl.ExceptionAggregator.Execute(Action action)
--- End of inner exception stack trace ---
at Raven.Database.Impl.ExceptionAggregator.ThrowIfNeeded()
at Raven.Database.Server.Abstractions.HttpListenerResponseAdapter.Close()
at Raven.Database.Server.Abstractions.HttpListenerContextAdpater.FinalizeResponse()
---> (Inner Exception #0) System.Net.HttpListenerException (0x80004005): An operation was attempted on a nonexistent network connection
at System.Net.HttpResponseStream.Dispose(Boolean disposing)
at System.IO.Stream.Close()
at Raven.Database.Util.Streams.BufferPoolStream.Dispose(Boolean disposing)
at System.IO.Stream.Close()
at Raven.Database.Impl.ExceptionAggregator.Execute(Action action)<---
"
This one happens pretty frequently during/after Raven tanks
2014-08-14 14:39:09.1043,Raven.Database.Server.HttpServer,Warn,Error on request,"System.OperationCanceledException: The operation was canceled.
at System.Threading.CancellationToken.ThrowIfCancellationRequested()
at Raven.Database.Indexing.Index.IndexQueryOperation.<Query>d__54.MoveNext()
at Raven.Database.Util.ActiveEnumerable`1..ctor(IEnumerable`1 enumerable)
at Raven.Database.DocumentDatabase.<>c__DisplayClass8f.<Query>b__84(IStorageActionsAccessor actions)
at Raven.Storage.Esent.TransactionalStorage.ExecuteBatch(Action`1 action, EsentTransactionContext transactionContext)
at Raven.Storage.Esent.TransactionalStorage.Batch(Action`1 action)
at Raven.Database.DocumentDatabase.Query(String index, IndexQuery query, CancellationToken externalCancellationToken, Action`1 headerInfo, Action`1 onResult)
at Raven.Database.DocumentDatabase.Query(String index, IndexQuery query, CancellationToken token)
at Raven.Database.Server.Responders.Index.PerformQueryAgainstExistingIndex(IHttpContext context, String index, IndexQuery indexQuery, CancellationToken token, Etag& indexEtag)
at Raven.Database.Server.Responders.Index.ExecuteQuery(IHttpContext context, String index, CancellationToken token, Etag& indexEtag)
at Raven.Database.Server.Responders.Index.GetIndexQueryResult(IHttpContext context, String index)
at Raven.Database.Server.HttpServer.DispatchRequest(IHttpContext ctx)
at Raven.Database.Server.HttpServer.HandleActualRequest(IHttpContext ctx)"
We're using server build number 2879 and running Raven as a service.
Hopefully that's enough starting info to make it clear to someone in the know.
Any help appreciated.
Cheers,
Craig