Replies: 1 comment 3 replies
-
Are you using encrypted database? Unless we are talking about the network overflow, that should work. This is the exact scenario that streaming is for. I assume you ruled out an actual network hiccup? 25+ minutes is a pretty long time that may have caused it. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
We sometimes need to process a lot of data from the database. This is usually done by streaming the index results.
Sometimes, when the processing takes a long time, we first load the IDs of the relevant entities and then process the entities in batches (a new session for each batch). This is to prevent the networking buffers from overflowing and the connection from getting closed (https://ayende.com/blog/170401/timeouts-tcp-and-streaming-operations).
Sometimes, the processing is reasonably fast, and directly processing the data is feasible. However, recently, we have started receiving errors when the processing is finished.
From application logs, we can see that all the records from the database were received and processed. Then, the program fails with the following:
Also, the RavenDB servers are very, very slow immediately before such failure. After the program fails, the database servers recover on their own.
The most recent occurrence was when the program was only collecting the entity IDs, but we forgot to project the results. Because of that omission, the entire index content was sent to the client program. The processing was none in this case.
We are talking about processing several millions of records (2-4 million), which would mean several gigabytes of data, I think. The processing (network transfer basically, in this case) took around 25 minutes in this case.
I'm not 100% sure, but this seems to have started happening after our upgrade from 5.1.5 to 5.2.3. We have also added and changed some functionality in the relevant processing code, so that might not be related.
Is there some server-side cleanup task, which would explain why the server gets so slow, and the connection gets aborted?
Since streaming is meant for this kind of use, I don't think that warning against such use can be reasonably implemented. Warnings like those about huge documents and long queries are not very relevant here, right?
Any thoughts about how to investigate this would be appreciated.
Beta Was this translation helpful? Give feedback.
All reactions