I have been working with nHibernate for a few months now and think it has a lot going for it. I must admit I do not missing writing T-SQL at all. I still consider myself to be a novice at nHibernate best practices.
Let me describe what I'm working on...
Primarily an intranet web application, ASP.Net 1.1, SQL Server 2000 database, approx 200 tables, multi-tiered (MVC), roughly 200 full-time users, a few web services will be running off this also. You get the idea.
At the moment on my development workstation, while running and using the application, my ASPNET worker process will range from 120-150MB. Seems a bit high to me. I have not done any type of load testing on this application. I am concerned what is going to happen to my app server once 200 users start having their way with it.
On a separate, but related note - I am developing a small WinForms web crawler in my spare time. The process is very simple. I grab a page, check to see if it exists in the database, if not it adds the page content to a single table.
Meta code...
session.Clear();
IPage page = session.GetPageByUrl(url);
if(page==null)
session.StartNewTransaction(); //probably dont need to do this
//create new page and set properties
session.Update(page);
//if everything okay
transaction.Commit();
That's it. Everytime I want to process a new page I clear down the Session and either add a new Page to the database or do nothing. Pretty straightforward.
I ran this application overnight and in the morning I had processed 30,000 web pages - but my application gobbled up 1.4GB of RAM and threw an OutOfMemory exception.
This got me worried. I realised that nHibernate may not be the proper technology to do what I need it to do; probably could use a more direct SQL-based approach to get the data in the database. I can understand that.
However, I got a little concerned about the web application and how it is going to perform under pressure.
So, I guess the advice I'm looking for is:
Am I using the right technology? Or, am I being overly optimistic about nHibernate? Or, go back to sleep, you have nothing to worry about?
Any thoughts or opinions welcome.
Thank you
Ron
|