-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Connection pool errors when load testing web app
PostPosted: Tue Feb 19, 2008 8:16 am 
Senior
Senior

Joined: Sat Sep 03, 2005 12:54 am
Posts: 139
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


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 19, 2008 4:51 pm 
Senior
Senior

Joined: Sat Sep 03, 2005 12:54 am
Posts: 139
Oh man...that was stupid!

The copy of the site that we were load testing did not have the HTTP handler defined in the web.config so the session Close was not being called!!

Jason


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.