Hi,
I am performing a load test of my web app and when I start hitting it with 75 concurrent threads all issuing a similar web request that interacts with NH, I start getting connection pool timeout errors after a few hundred requests.
I have enabled the NH SysCache so there is little actual DB traffic occuring but there seem to be some queries that are possibly not cached so each request does result in a small hit to the DB (would like to optimise this out possibly).
I find that the thread count on the IIS worker process shoots up at the same time to around 75 and then server 500 errors persist until I restart the app pool.
I am thinking that there is some kind of connection leak going on but I cannot see where that is happening as I am using an HTTP module that flushes and closes the session at the end of each HTTP request.
Code extract from the HTTP module:
if (HttpContext.Current.Items.Contains(SESSION_KEY))
{
session = (ISession)HttpContext.Current.Items[SESSION_KEY];
HttpContext.Current.Items.Remove(SESSION_KEY);
if (session != null && session.IsOpen)
{
session.Flush();
session.Close();
}
}
Error:
Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.
Any pointers to tracking this down?
Thanks,
Jason
PS. I am using NH 1.0.4
|