Ayende @ Rahien

Refunds available at head office

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
04/17/2013 11:36 AM by
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
04/17/2013 12:22 PM by
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
04/20/2013 04:14 AM by
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
04/20/2013 10:17 PM by
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
04/21/2013 08:46 AM by
Ayende Rahien

Frank, They are documented, ravendb.net/docs

Comments have been closed on this topic.