Single vs Multiple sessions - performance #18312
Replies: 2 comments 3 replies
-
What you did here is submit a single 20K items task to the server. What happens is that you are building a buffer of 20K operations to run, send it to the server in one shot. Note that with In short, a session is meant to hold a reasonable amount of changes. |
Beta Was this translation helpful? Give feedback.
-
hey @ayende I am curious to know do you think it is worth to maintain such tests within our codebase where we occasionally try to test out patching thousands of documents and making sure Raven applies those update, such that it serves to make sure we are using Raven constructs appropriately such as in this case better utilization of sessions (since its all in-memory I believe it won't really provide a true test for us since as you mentioned we're skipping |
Beta Was this translation helpful? Give feedback.
-
I had an interesting case as I was messing around with patching some docs. I ran a simple test on patch 3 values on 20k documents.
I'm using
5.4.112
and executing all 20k document updates on a single session was twice as slow vs multiple sessions.Below is the unit test. FYI it's using the
RavenTestDriver
.I'm having trouble understanding why multiple sessions here is better than one. What is the guidance on session creation?
Beta Was this translation helpful? Give feedback.
All reactions