directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Irving, Dave" <>
Subject RE: [mina] Writing to an IoSession
Date Tue, 25 Oct 2005 12:24:54 GMT
Along sort of related lines....
When I've got something demonstratable (which shouldn't be too long),
I'd really like to get this open-sourced. I think it'd be one of the
first - if not the first - open source java asynchronous implementation
of HTTP. Id would be interesting to see if it got uptake for AJAX etc.
As its based on MINA, I'd really like to keep it @ apache if possible -
and I'd need a sponsor for a sandbox project. Is that something you
might consider doing - or do you know anyone that might?

Many thanks,


From: Trustin Lee [] 
Sent: 25 October 2005 12:38
To: Apache Directory Developers List
Subject: Re: [mina] Writing to an IoSession

Hi Dave,

2005/10/25, Irving, Dave <>: 

	Its still early days at the moment :o)
	Basically, I work on a product which is used as a gateway in
	scenarios (e.g, receive an multi-media message, send it out to
	(off-board) application, and return a response to the original
	when we receive a response from the application.
	In this example latency can be high (up to 20 secs per request).
	So, what I needed was high-throughput even at high latency.
	In tomcat, this means having a very large number of processor
threads - 
	(which can obviously cause scalability problems).

Most web applications nowadays uses external resources such as JDBC
connection, so this means that MINA-based (NIO-based strictly speaking)
HTTP server can outperform in overload situation.  

	So what Im doing is coming up with a through-and-through
asyncronous API
	for web applications, and a (NIO driven) web server to host such

	At the moment, its still early days. But I can give you an
example of a
	test I ran this morning:
	/          | Client Threadds | Server Threads | Requests | 
	Requests/second  \
	|AsyncWeb  |      50         |      21        | 50,000   |
	|Tomcat    |      50         |      50        | 50,000   |
	Tomcat had a simple Servlet configured which just gave a "hello
	reply to each HTTP request.
	Likewise, AsyncWeb had a simple AsyncHttpService configured
which gave 
	the same "hello world" replies.
	No connection keep alives were used (that comes later...).

The result shows 28.8% throughput improvement with less than half number
of threads.  Sounds cool. 

	Could you possibly tell me where to look to find out how to
control the 
	number of threads created for processing MINA events? I noticed
that I
	was receiving call-backs from MINA on 21 threads....

Are you using SimpleServiceRegistry?

You have to get an instance of IoThreadPoolFilter and call
setMaximumPoolSize() event: 

ServiceRegistry registry = new SimpleServiceRegistry();

IoThreadPoolFilter threadPoolFilter = ( IoThreadPoolFilter )
registry.getIoAcceptor( TransportType.SOCKET ).getFilterChain().get(
"threadPool" ); 
threadPoolFilter.setMaximumPoolSize( 10 );


what we call human nature is actually human habit

This e-mail and any attachment is for authorised use by the intended recipient(s) only. It
may contain proprietary material, confidential information and/or be subject to legal privilege.
It should not be copied, disclosed to, retained or used by, any other party. If you are not
an intended recipient then please promptly delete this e-mail and any attachment and all copies
and inform the sender. Thank you.

View raw message