We are looking to port our web app into Azure and are using the Velocity cache for second level caching via a co-located cache role. However, it is taking about 5 minutes for the BuildSessionFactory method to execute on an instance of NHibernate.Cfg.Configuration when the first request fires. This executes almost instantly when using the SysCache provider. Is there something fundamentally wrong with our mapping / config (we are using old school xml mapping)? How would we zero in on the cause of this major slowdown in NH session factory initialisation?
Secondly, our app hasn't been designed with a distributed cache in mind so we have been using the second level cache as a bit of a crutch. This is fine when using SysCache but performance is abysmal when using a distributed cache. At the moment we are typically returning minimal data in a simple initial query and then traversing the object hierarchy to build out the majority of the data for the view. This results in many calls into the distributed cache which means it performs like a dog. So badly in fact that the app runs *much* quicker in Azure when we disable the second level cache altogether. Is the correct approach to write queries that return most of the required view data in one batch, i.e. via the use of Future queries? We do have quite a complex domain model with lots of objects required to produce a view so there could be many chained Future queries. I guess those queries can be cached though so that they don't hit the DB every time. Can anyone point me towards best practice documentation for optimising an NH application for a distributed environment? We would be willing to pay anyone for an expert in this area to provide some consultancy (we are based in Sydney Australia). -- You received this message because you are subscribed to the Google Groups "nhusers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/nhusers?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
