Ayende @ Rahien

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

ayende@ayende.com

+972 52-548-6969

, @ Q c

Posts: 5,953 | Comments: 44,408

filter by tags archive

What is making us slow (for the first time, after an idle period)?


We recently covered this question in several iterations in the ravendb mailing list.

The actual content of the discussion wasn’t so interesting as the number of ways idle time can make you life… interesting. In order to avoid having issues with idle time, you need to:

  • Disable IIS unloading for inactive websites.
  • Disable RavenDB  unloading for inactive databases.
  • Make sure that the HD doesn’t spin down during inactivity.
  • You need to make sure that the system doesn’t got to idle / hibenration.
  • Check that the server hasn’t been paged.
  • Check that the CPU hasn’t moved to low power mode.
  • Check authentication timeouts.

In the end, it was actually the last one that caused the problem. By default, Windows Auth token expire after 15 minutes, so you have to re-authenticate again, and that may make the first query after a while a little slower.

Just for fun, by default, all of the above happen. And that is just when running on a physical machine. When running on VMs (or in the cloud), you need to do all of those checks for the VM and the host machines.


Comments

Aleksander Oven

Hi, Oren! This idle delay issue has been bugging me for some time now. I've been eagerly awaiting this post since I first saw it in your queue. But you've left me with a couple of cliffhangers... I hope you don't mind clearing them up for me:

["Disable RavenDB unloading for inactive databases."] I'm not sure I understand what exactly gets unloaded here. Does this apply only to RavenDB's IIS integration, or is there a setting of some sort for when RavenDB is running as an independent Windows service? To be clear, I only really care about the service mode.

["Check that the server hasn’t been paged."] You probably meant to say "Check that the RavenDB process hasn't been paged out to disk by the OS's memory management". There's little that can be done about that from the outside - except having a dummy client poll RavenDB from time to time to keep it active. Doesn't this seem like something that RavenDB could be tought to take care by itself? :)

["Check authentication timeouts."] I have no idea how to do that or what I should do once I determine they're (probably) too short... Simply extending them feels like a global solution to a local problem. Assuming a secure environment, where RavenDB can only be accessed by local processes, is there any way to completely disable these auth checks?

Thanks!

Ayende Rahien

Hi Aleksander, You want to look at this config option: Raven/Tenants/MaxIdleTimeForTenantDatabase See: http://ravendb.net/docs/server/administration/configuration

And we can force our memory to be RAM resident, but that wouldn't play nice with other stuff, and we want to do that.

As for auth timeout, if you are on a secure environment, don't use auth.

Frank

I wish all these "interesting" things were documented in one place instead of having to trawl blog posts. On the "How to setup RavenDB" page seems like the logical place.

Lukasz Zwierko

And when working with iSCSI connected HDDs, you might want to watch out for ethernet level packet sized. These guys dont reall work well when typical (1500 bytes or something) value is set.

Ayende Rahien

Frank, They are documented, ravendb.net/docs

Comment preview

Comments have been closed on this topic.

FUTURE POSTS

No future posts left, oh my!

RECENT SERIES

  1. The RavenDB Comic Strip (3):
    28 May 2015 - Part III – High availability & sleeping soundly
  2. Special Offer (2):
    27 May 2015 - 29% discount for all our products
  3. RavenDB Sharding (3):
    22 May 2015 - Adding a new shard to an existing cluster, splitting the shard
  4. Challenge (45):
    28 Apr 2015 - What is the meaning of this change?
  5. Interview question (2):
    30 Mar 2015 - fix the index
View all series

Syndication

Main feed Feed Stats
Comments feed   Comments Feed Stats