I have a webapp being hosted with a public hosting company, the site is not live yet, and I am still doing some testing with it. I am using nHibernate with Windsor Castle Container for dependency injection and the site seems to be responding very slow from time to time. I’ve contacted support but they said that it’s my app not their servers. Has anyone had similar performance issues with ORM based sites when being hosted at the public hosting companies?
Also, what hosting company would you recommend for hosting websites? I tried godaddy but couldn’t use them ’cause they don’t allow running website in full trust which is apparently required for nHibernate.
I configured nHibernate using xml configuration files, opening sessions in the following way:
using (ISession session = _sessionManager.OpenSession()) { ICriteria crit = session.CreateCriteria(typeof(Content)); return crit.List(); }
Also in the Application_Start I have the following code:
private static WindsorContainer container; if (container == null) { container = new WindsorContainer(new XmlInterpreter(filePath)); Application[Constant.CastleWindsorAppKey] = container; }
You don’t know how slow your application is when you don’t measure it. I’m using a timing http module during development to notice big performance issues fast. When one of your pages loads slow, you should use a profiler to find the exact bottle neck. I’m using NHibernate for my current project and I don’t have any performance issues with it. My most complex queries involve a complex object graph of 10 different classes and with their NHibernate mappings takes 0.082 seconds to execute. The main bottle-neck in that application is rendering the html aspx template to the response (that takes 0.5 seconds). Performance issues are often in dataaccess, but you can not be sure unless you measure it.