Ayende @ Rahien

My name is Oren Eini
Founder of Hibernating Rhinos LTD and RavenDB.
You can reach me by phone or email:


+972 52-548-6969

, @ Q c

Posts: 6,128 | Comments: 45,551

filter by tags archive

Raccoon Blog Performance

time to read 3 min | 510 words

Update: See below for details about the server load.

I just run into this tweet:


That isn’t the first time that we heard this, and it is actually surprising, not only was there no attention to performance given throughout the lifecycle of the project so far, we actually discovered some issues that theoretically should hurt performance.

The secret is that RavenDB is really good in optimizing itself based on usage patterns. That came out of the realization that we had to drop people into the Pit of Success as much as possible. Raccoon Blog shows that we were able to do just that.

Please note that I am testing this with a RavenDB server over the internet, to emphasis the actual costs involved.

For example, let us look at the current state of this blog, using RavenDB MVC Profiler:


Just to be clear, in order to actually show the problem, I am running this locally, while the RavenDB server is actually the production RavenDB server for this blog, in other words, the vast majority of the time is actually network traffic, making queries to RavenDB over the Internet.

Remember that I said that we didn’t pay attention to performance? Notice how many remote queries we are making. We have 5 sessions and 7 queries. Why is that?

The reason for that is that we are using the Session per Action approach for scoping the session, and we make heavy use of Child Actions, each of which is going to get its own session. Give me a moment to fix that…

Well, that took three minutes, mostly because I wanted to do it right. There are advantages for Infrastructure Ignorance, and one of them is the ease in which we can make such changes.


The change isn’t drastic, we went from having 5 sessions and 7 requests to 1 session and 6 requests, in the post details view, however, it saved us two requests.

The actual cost of opening a session is essentially zero, so it is more the requests that we are making than anything else. We can improve performance even further by applying additional tactics, such as aggressive caching or batched calls, but we will save those for another post.

Update: I was asked about the load, and I hopped off to Google Analytics and got a few numbers:


That isn’t super high, but it is respectable.


Calum Bett

Just wondering if you could share how you managed to get the 5 sessions and 7 requests to 1 session and 6 requests? I've been trying to get rid of this since I seen the warning in NHProf.

Ayende Rahien

Calum, That was mostly because we moved to a session per request, which included all of the child sessions, vs a session per action, which created a session per action. The benefit is that we now have better first level caching.

Calum Bett

Ah of course... thanks ayende.

Aidan Black

I am curious - what kind of load is the web server under? Have you published usage stats anywhere? I am wondering where the bottlenecks are in the system.

Ayende Rahien

Aidan, I updated the post to include server analytics

Daniel Lang

Ayende, I could not find any changes in the latest RaccoonBlog commits to github. The RavenActionFilterAttribute already did a check for child-actions. What has changed?

Ayende Rahien

David, Take a look at when this was posted. :-) That change happen a LONG while ago

Aidan Black

Ayende, That's great - thanks. Do you know of anyone who is using RavenDB in high traffic applications and sharing their experiences? Kind of like the Stack Overflow guys are doing with their application stack - http://highscalability.com/blog/2011/3/3/stack-overflow-architecture-update-now-at-95-million-page-vi.html

aaron navarro

That is impressive. 'Ludicrous' is not far off it.

Ayende Rahien

Aidan, Not yet, I am afraid.


Hm.. I think everybody are wrong - ayendes blog performance is realy terrible, it cant process more than 20 posts in half month :)

Ryan Heath

Your current/live profiler has rounding errors. See ie 37ms 12 requests vs session opened for 0ms for 12 requests. Also most requests are rounded to 1ms which would make a Total of more than 37ms. While your posted image contains ms up to 2 digits after the separator.

// Ryan

Ayende Rahien

Ryan, Yes, we are aware of that. We are trying to give you an estimate that you can use to figure things out, not actual hard numbers. At those levels, it is actually pretty hard to get accurate numbers, too


Do you plan on providing hosted version of Racoon blog for some fee?

Ayende Rahien

Giorgi, Of Raccon Blog? No, not at this time

Comment preview

Comments have been closed on this topic.


  1. The worker pattern - 8 hours from now

There are posts all the way to May 30, 2016


  1. The design of RavenDB 4.0 (14):
    26 May 2016 - The client side
  2. RavenDB 3.5 whirl wind tour (14):
    25 May 2016 - Got anything to declare, ya smuggler?
  3. Tasks for the new comer (2):
    15 Apr 2016 - Quartz.NET with RavenDB
  4. Code through the looking glass (5):
    18 Mar 2016 - And a linear search to rule them
  5. Find the bug (8):
    29 Feb 2016 - When you can't rely on your own identity
View all series


Main feed Feed Stats
Comments feed   Comments Feed Stats