ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam Gugliciello" <Ad...@emeta.com>
Subject RE: ThrottledPool hanging
Date Mon, 15 Aug 2005 18:15:46 GMT
we're throwing 900 VU at it, with a 5 second sleep time between requests. Of this, about 1/6th
ever hits ibatis. The boxen: client (.NET talking to java via Webservices), middle tier (java
application using RPC to bridge between axis and the class where ibatis lives) and the db,
all show <35% usage on resources. The issue seems to be that long after we stop the test,
the session pool is still throttled, and there are a number of requests left hanging out forever
waiting for their lock to release, despite the fact that no one is even executing right now,
and that the queued sessions should be getting released. I have set the max sessions to 128
for both boxes in the cluster amd will see if it stops blocking up under this load.


From: Clinton Begin [mailto:clinton.begin@gmail.com]
Sent: Mon 8/15/05 2:06 PM
To: user-java@ibatis.apache.org
Subject: Re: ThrottledPool hanging

Well, blocking is what the throttled pool is intended to do.  It should only block when the
pool is exhausted though.  Blocking alone isn't the problem.  Blocking is a good thing when
it is potentially releaving excessive strain on a particular resource (say a database).  So
ThrottledPool is meant to block.  

If you have incredible infrastructure, you could try increasing the maximum sessions to some
enormous number.

BTW:  Don't test using a for-loop with no idle time.  Only test using a reasonably realistic
user profile w/page timeouts.  There's a HUGE difference between enterprise performance and
for-loop execution times.


On 8/15/05, Adam Gugliciello <AdamG@emeta.com> wrote: 

	FYI: The execution code looks like, not that according to the dump it A) ever gets here or
B) are there any running threads in the pool which should be holding the synchronization object:
	    private static interface SqlMapTemplate
	        public void execute(SqlMapClient client) throws SQLException;
	               executeSqlMapTemplate(new SqlMapTemplate() 
	                    public void execute(SqlMapClient client) throws SQLException
	                        Map parameters = new HashMap();
	                        parameters.put("erightsUserId", new Integer(erightsUserId));
	                        parameters.put("groupingName", groupName);
	                        parameters.put("templateName", templateName);
	                        _log.debug("called, uid:" + erightsUserId + ", grp:" + groupName
+ ", template:" + templateName);
	                                new RowHandler()
	                                    public void handleRow(Object rowData)
	                                        QuestionRow row = (QuestionRow) rowData;
	                                            _log.debug("Row found:" + row);
	                                        catch (IOException e)
	                                            String message =
	                                                    "Unable to write: "
	                                                    + e.getClass().getName()
	                                                    + " : "
	                                                    + e.getMessage();
	                                            _log.error(message, e);
	                                            throw new RuntimeException(message);
	From: Adam Gugliciello [mailto:AdamG@emeta.com]
	Sent: Mon 8/15/05 1:31 PM
	To: "<user-java"@ibatis.apache.org
	Subject: RE: ThrottledPool hanging 
	It doesn't actually take a minute to get the connection, it's just a safe and reasonable
	From: Clinton Begin [mailto: clinton.begin@gmail.com <mailto:clinton.begin@gmail.com>
	Sent: Mon 8/15/05 1:19 PM
	To: user-java@ibatis.apache.org
	Subject: Re: FW:
	Why does it take a minute to get a connection?  With a connection pool, it should literally
be milliseconds.... 
	On 8/15/05, Adam Gugliciello <AdamG@emeta.com> wrote:
	        Under a heavy sustained load, the sqlmaps ThrottledPool seems to start to bind, the
the vast majority of them binding up and blocking waiting to build a new session, and stay
blocked long after the fact, even days after the request has been abandoned. Any help would
be appreciated, and I am attaching a thread dump.
	        My code looks like:
	         private void executeSqlMapTemplate(SqlMapTemplate t) throws SQLException
	                final Connection c =
	                                1 * 60 * 1000l); // Waits a minute for a connection
	                if (c == null)
	                    throw new IllegalStateException("Unable to retrieve JDBC Connection from
db pool.");
	                    SqlMapSession sess=this.sqlMapClient.openSession(c);

View raw message