You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@mina.apache.org by Steve Rehrauer <fo...@mac.com> on 2008/12/11 16:49:59 UTC
Questions on MINA as relates to SEDA, and web services
Hi -
I've spent the last couple of years on a team building a WAN server for an older LAN product.
The server design was fixed before I joined the team (not to cast blame, just to say that it was
in-flight and deemed immutable). The implementation uses JEE technologies (web services via
SOAP over HTTP). Scalability of this has been disappointing; we struggle to support 200
simultaneous users.
The client that connects to the server is based on the eclipse platform, and is rather greedy of
server resources (makes multiple simultaneous requests). Requests can take many minutes to
complete; this is due both to the flexible nature of the requests (i.e., the client can ask for huge
amounts of data), and to processing that takes place in the LAN component that is ultimately
being used. Connections stay open for the duration of these long-running requests. Each
request can consume multiple threads in the Java tier. Each client can make multiple requests
for a user gesture.
In a brief lull between releases, some of us have been casting about for alternatives that would
scale better. In particular, that reduce the number of threads running in the Java tier. This has
led us to Java NIO, thence to SEDA, and from there to MINA.
I have some (possibly naive :-) questions about MINA that I hope someone can answer.
First, does it even seem sensible to use MINA to try to implement an HTTP protocol? I've seen
references to the asyncWeb project, but it seems like it's perhaps still being baked? Put another
way, is anyone building and shipping a commercial product that uses it? Or, does anyone know
of another open-sourced HTTP solution built atop of Apache MINA? (We may have the freedom
to move away from web services & SOAP, but we'd still be using an HTTP-based protocol.)
Second, are there any reasonably-size worked examples out there of using MINA to implement
SEDA concepts? I see folks referring to the "excellent MINA documentation", and I confess I
feel stupid as a result. :-)
Have many more questions, but am curious to see responses to the above first.
Thanks, --Steve
Re: Questions on MINA as relates to SEDA, and web services
Posted by Ashish <pa...@gmail.com>.
Too see what people have used MINA for
http://mina.apache.org/testimonials.html
and the thread
http://www.nabble.com/What-do-you-use-Apache-MINA-for--to20678707.html#a20710025
Don't have answer to your question about use of MINA based HTTP implementation.
So far have been very happy using MINA,as it reduces the development
effort a lot
Your point on documentation and examples is well taken.
Though won't commit that things are going to change overnight, but yes we are
working to make the documentation better
--
thanks
ashish
Blog: http://www.ashishpaliwal.com/blog
My Photo Galleries: http://www.pbase.com/ashishpaliwal
Re: Questions on MINA as relates to SEDA, and web services
Posted by Emmanuel Lecharny <el...@gmail.com>.
Steve Ash wrote:
> I can't offer any answers, but have many of the same questions you do as
> it sounds.
>
> Also- I think anyone saying "excellent MINA documentation" must be
> speaking sarcastically.
Indeed ;)
> There are a few examples, but I have found the
> documentation lacking with regards to architecture, etc. Not knocking
> MINA- I use it and I like it, but would LOVE more comprehensive
> documentation with best practices, etc.
>
I will just push a little message here : any help from our users will be
greatly appreciated. This is an open source project, volunteers based,
and the current committers are working on MINA on top of their day job
(ie, night, week-end, hollidays, or while other are playing doom or mine
at the office...)
So, if you have improvement, suggestions, good exemples of usage, feel
free to create a JIRA and attach the doco :)
Many thanks !
--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org
RE: Questions on MINA as relates to SEDA, and web services
Posted by Steve Ash <St...@metavante.com>.
I can't offer any answers, but have many of the same questions you do as
it sounds.
Also- I think anyone saying "excellent MINA documentation" must be
speaking sarcastically. There are a few examples, but I have found the
documentation lacking with regards to architecture, etc. Not knocking
MINA- I use it and I like it, but would LOVE more comprehensive
documentation with best practices, etc.
Steve Ash
-----Original Message-----
From: Steve Rehrauer [mailto:foolyap@mac.com]
Sent: Thursday, December 11, 2008 9:50 AM
To: users@mina.apache.org
Subject: Questions on MINA as relates to SEDA, and web services
Hi -
I've spent the last couple of years on a team building a WAN server for
an older LAN product.
The server design was fixed before I joined the team (not to cast blame,
just to say that it was
in-flight and deemed immutable). The implementation uses JEE
technologies (web services via
SOAP over HTTP). Scalability of this has been disappointing; we
struggle to support 200
simultaneous users.
The client that connects to the server is based on the eclipse platform,
and is rather greedy of
server resources (makes multiple simultaneous requests). Requests can
take many minutes to
complete; this is due both to the flexible nature of the requests (i.e.,
the client can ask for huge
amounts of data), and to processing that takes place in the LAN
component that is ultimately
being used. Connections stay open for the duration of these
long-running requests. Each
request can consume multiple threads in the Java tier. Each client can
make multiple requests
for a user gesture.
In a brief lull between releases, some of us have been casting about for
alternatives that would
scale better. In particular, that reduce the number of threads running
in the Java tier. This has
led us to Java NIO, thence to SEDA, and from there to MINA.
I have some (possibly naive :-) questions about MINA that I hope someone
can answer.
First, does it even seem sensible to use MINA to try to implement an
HTTP protocol? I've seen
references to the asyncWeb project, but it seems like it's perhaps still
being baked? Put another
way, is anyone building and shipping a commercial product that uses it?
Or, does anyone know
of another open-sourced HTTP solution built atop of Apache MINA? (We
may have the freedom
to move away from web services & SOAP, but we'd still be using an
HTTP-based protocol.)
Second, are there any reasonably-size worked examples out there of using
MINA to implement
SEDA concepts? I see folks referring to the "excellent MINA
documentation", and I confess I
feel stupid as a result. :-)
Have many more questions, but am curious to see responses to the above
first.
Thanks, --Steve
Re: Questions on MINA as relates to SEDA, and web services
Posted by Ashish <pa...@gmail.com>.
Me and Emmanuel have already debated a lot on SEDA and I tend to agree
with him, that SEDA in real life is more
difficult to debug and manage, unless you have excellent techie who
really know things in and out.
To admit my defeat, I had changed my so called SEDA implementation to
simple MINA implementation
and more than satisfied with the performance.
Have been working on J2EE for quite a while, now 200 connections are
pretty normal scenario's for Containers.
So first thing is Have you identified what is the actual bottleneck,
coz of which you can't support 200 concurrent connection?
like Memory or CPU utilization or Server resources, external systems
taking longer than expected?
If you use SEDA, you may have more number of threads at different stages.
Try changing the J2EE Server, or WS implementation to newer version,
if it helps. Try making communication asynchronous, remove SOAP,
design your own protocol over HTTP.
Not jumping to conclusion, but trying to guess what else we can do, as
we can't see the code.
--
thanks
ashish
Blog: http://www.ashishpaliwal.com/blog
My Photo Galleries: http://www.pbase.com/ashishpaliwal
Re: Questions on MINA as relates to SEDA, and web services
Posted by Emmanuel Lecharny <el...@gmail.com>.
Steve Rehrauer wrote:
> First, thanks for the response!
>
>
> Emmanuel Lecharny-3 wrote:
>
>>> Anything that take minutes to give back an answer to a decent request
>>> needs to be reviewed, that's for sure :)
>>>
>> Well, I'm being a bit vague on purpose, to shield the innocent. :-)
>>
>> But suffice to say, this maybe isn't your typical Web app. It's an older
>> LAN app,
>> composed of multiple proprietary databases and servers. A "request" for
>> this app
>> can really take multiple minutes even when performed on the LAN, due to
>> the
>> complexity of what's being done. And such requests are basically
>> monolithic
>> operations, and can't be sensibly decomposed for the WAN-ism we've added.
>> And while this legacy LAN app is ours, it's not realistically going to be
>> rototilled
>> to change that.
>>
>> Can't say much more, sorry.
>>
Don't worry... Sometime, it's better to remain silent ;)
>>
>>> You can check the AsyncWeb project, which is a MINA subproject,
>>> implementing a web server on top of MINA. So, yes, it's sensible.
>>>
>> Is AsyncWeb an active project? Is it a reasonably stable component? (I
>> don't
>> mean to sound antagonistic, but need a realistic opinion of whether it's
>> ready
>> for commercial use?)
>>
It's up to you to decide. I never used it, it has not been released yet,
and it's not very active atm.
>>
>>> At this point, I'm really wondering what makes you think that MINA can
>>> solve the issues you have? Remember that MINA is _just_ a NIO
>>> framework...
>>>
>> Yes, but thanks for the reminder. We would hope only for it to be able to
>> reduce the number of active threads in the Java WAN component. We started
>> down this investigation path by wondering how we could get away from the
>> servlet model with its active-thread-per-connection. What seems likely to
>> kill
>> us, with our need for long-running requests, is keeping N threads alive
>> per each
>> of them.
>>
You could be interested in reading this :
http://www.classhat.com/tymaPaulMultithread.pdf
It debunks some myths about threads in Java.
>> We're not looking for any silver bullets, just trying to survey what's
>> possible.
>> Many of us came to this project with little Java server experience, and as
>> we've
>> learned what we've been asked to build, the selection of various JEE
>> technologies
>> used seem a bit like overkill to us. "Something lighter-weight" is what
>> we're
>> casting around for.
>>
Servlets, no EJBs. Tomcat. What else ? It should do the trick.
>> If forced to bet, I'd bet against us getting to anything other than tweak
>> what
>> we've got. But there are always other good reasons to learn better
>> approaches,
>> even if not applicable with the current employer, aren't there? :^)
>>
I can't say. The only think I know is that simplicity is always the best
solution.
>>
>>> MINA does not really implement any of the SEDA concept. This was the
>>> idea from day one, but soon it appears that it was not exactly easy to
>>> implement a SEDA server. <personnal opinion>And I serioulsy question
>>> those SEDA concepts when it comes to provide better scalability (I'm not
>>> alone ...) </personnal opinion>. Put in the MINA context, the way it
>>> works is pretty simple :
>>> - you have an Acceptor which create the incoming connection
>>> - a thread is then 'reacting' (MINA is following the Reactor pattern)
>>> and push the incoming requests to a chain of filters
>>>
>>> this is were we would expect the SEDA concepts to be present : ie, each
>>> filter push the result of the local processing into a queue, and the
>>> next filter pop the elements from the shared queue to process them. We
>>> don't have that.
>>>
>> Okay, thanks. I thought not from my reading, but good to get the
>> confirmation.
>>
>> The value of SEDA, it seems to me, is the feedback-based overload
>> mechanism?
>> The ability to throttle incoming requests in a graceful & automatic way to
>> reduce
>> pressure on the server?
>>
This is debated, to say the least. The problem is that you never know
which part has to be throttle, and up to which point... And also, when.
(you may have peaks in different part of the system depending on time -
batch running during night, morning peak when users arrive, etc - ).
Generally speaking, SEDA seems appealing on Slide Shows, but when it
comes to real application, tunning came become a nightmare, and i'm not
mentioning debugging. I know I'm a bit old school...
When it comes to MINA, again, I don't really see where it can helps, as
it's just a NIO framework, and at best, it will just manage incoming
requests. It's ok when it comes to manage thousands of connected users,
but as you are using web services, which is by essence a not connected
protocol, this is totally irrelevant. The time it takes to process
requests is not consumed in the HTTP server, but in the backend
processing. You'd better think about load balance the charge on many
small J2EE servers, IMHO...
>> But as I said, I'm still trying to figure all this out. I may've been
>> misled by various
>> mentions of MINA in the context of SEDA. It seems that MINA and SEDA
>> overlap
>> only in the sense of dividing the work-flow into a pipeline composed of
>> multiple
>> segments?
>>
It was much more related to some discussions about using SEDA to
implement a new NIO framework, but it was almost 4 years ago, before
MINA was even a sub project of Directory... 4 years later, after the
dust settled ...
--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org
Re: Questions on MINA as relates to SEDA, and web services
Posted by Steve Rehrauer <fo...@mac.com>.
First, thanks for the response!
Emmanuel Lecharny-3 wrote:
>
>> Anything that take minutes to give back an answer to a decent request
>> needs to be reviewed, that's for sure :)
>
> Well, I'm being a bit vague on purpose, to shield the innocent. :-)
>
> But suffice to say, this maybe isn't your typical Web app. It's an older
> LAN app,
> composed of multiple proprietary databases and servers. A "request" for
> this app
> can really take multiple minutes even when performed on the LAN, due to
> the
> complexity of what's being done. And such requests are basically
> monolithic
> operations, and can't be sensibly decomposed for the WAN-ism we've added.
> And while this legacy LAN app is ours, it's not realistically going to be
> rototilled
> to change that.
>
> Can't say much more, sorry.
>
>> You can check the AsyncWeb project, which is a MINA subproject,
>> implementing a web server on top of MINA. So, yes, it's sensible.
>
> Is AsyncWeb an active project? Is it a reasonably stable component? (I
> don't
> mean to sound antagonistic, but need a realistic opinion of whether it's
> ready
> for commercial use?)
>
>> At this point, I'm really wondering what makes you think that MINA can
>> solve the issues you have? Remember that MINA is _just_ a NIO
>> framework...
>
> Yes, but thanks for the reminder. We would hope only for it to be able to
> reduce the number of active threads in the Java WAN component. We started
> down this investigation path by wondering how we could get away from the
> servlet model with its active-thread-per-connection. What seems likely to
> kill
> us, with our need for long-running requests, is keeping N threads alive
> per each
> of them.
>
> We're not looking for any silver bullets, just trying to survey what's
> possible.
> Many of us came to this project with little Java server experience, and as
> we've
> learned what we've been asked to build, the selection of various JEE
> technologies
> used seem a bit like overkill to us. "Something lighter-weight" is what
> we're
> casting around for.
>
> If forced to bet, I'd bet against us getting to anything other than tweak
> what
> we've got. But there are always other good reasons to learn better
> approaches,
> even if not applicable with the current employer, aren't there? :^)
>
>> MINA does not really implement any of the SEDA concept. This was the
>> idea from day one, but soon it appears that it was not exactly easy to
>> implement a SEDA server. <personnal opinion>And I serioulsy question
>> those SEDA concepts when it comes to provide better scalability (I'm not
>> alone ...) </personnal opinion>. Put in the MINA context, the way it
>> works is pretty simple :
>> - you have an Acceptor which create the incoming connection
>> - a thread is then 'reacting' (MINA is following the Reactor pattern)
>> and push the incoming requests to a chain of filters
>>
>> this is were we would expect the SEDA concepts to be present : ie, each
>> filter push the result of the local processing into a queue, and the
>> next filter pop the elements from the shared queue to process them. We
>> don't have that.
>
> Okay, thanks. I thought not from my reading, but good to get the
> confirmation.
>
> The value of SEDA, it seems to me, is the feedback-based overload
> mechanism?
> The ability to throttle incoming requests in a graceful & automatic way to
> reduce
> pressure on the server?
>
> But as I said, I'm still trying to figure all this out. I may've been
> misled by various
> mentions of MINA in the context of SEDA. It seems that MINA and SEDA
> overlap
> only in the sense of dividing the work-flow into a pipeline composed of
> multiple
> segments?
>
>> "Excellent documentation" is a Politically Correct sentence. It
>> translates to "Absolutely fucked up and lacking documentation".
>> Hopefully, people like Ashish is killing is "Excellent body part" of him
>> improving the doco and providing good samples !
>
> :-)
>
> Well, I can be a slow learner, so was willing to believe it was just me.
>
>> Well, I don't know if it will be helpful, but let me say that before
>> thinking of switching to MINA in order to get better performance in your
>> system, you should stop a while, check your architecture, and see where
>> are the real bottlenecks. Some kind of profiling with J2EE tools
>> (performasure, for instance) could help you a bit.
>>
>> Sorry if I look like giving you advices about something you pretty much
>> know more than me, but decades of slashing bad code from bad
>> applications told me that technical factors are less likely to drive to
>> slow system than bad design from the beginning...
>
> Right. Well, like I said, I'm being vague on purpose. We've been using
> some
> profiling tools, and have many ideas as to where the bottlenecks are.
> Some
> of them are fixable in the implementation; some of them seem embedded in
> (what seems to me to be) a very inappropriate design. The thread-count is
> too high (IMO) for what is being accomplished, and that one factoid is
> what
> led myself & another engineer to sniff around NIO/SEDA/MINA.
>
> Thanks! --Steve
>
>
--
View this message in context: http://www.nabble.com/Questions-on-MINA-as-relates-to-SEDA%2C-and-web-services-tp20958345p20960379.html
Sent from the Apache MINA User Forum mailing list archive at Nabble.com.
Re: Questions on MINA as relates to SEDA, and web services
Posted by Emmanuel Lecharny <el...@gmail.com>.
Steve Rehrauer wrote:
> Hi -
>
> I've spent the last couple of years on a team building a WAN server for an older LAN product.
>
> The server design was fixed before I joined the team (not to cast blame, just to say that it was
> in-flight and deemed immutable). The implementation uses JEE technologies (web services via
> SOAP over HTTP). Scalability of this has been disappointing; we struggle to support 200
> simultaneous users.
>
> The client that connects to the server is based on the eclipse platform, and is rather greedy of
> server resources (makes multiple simultaneous requests). Requests can take many minutes to
> complete;
Holly ***** !
> this is due both to the flexible nature of the requests (i.e., the client can ask for huge
> amounts of data), and to processing that takes place in the LAN component that is ultimately
> being used. Connections stay open for the duration of these long-running requests. Each
> request can consume multiple threads in the Java tier. Each client can make multiple requests
> for a user gesture.
>
> In a brief lull between releases, some of us have been casting about for alternatives that would
> scale better.
Anything that take minutes to give back an answer to a decent request
needs to be reviewed, that's for sure :)
> In particular, that reduce the number of threads running in the Java tier. This has
> led us to Java NIO, thence to SEDA, and from there to MINA.
>
> I have some (possibly naive :-) questions about MINA that I hope someone can answer.
>
> First, does it even seem sensible to use MINA to try to implement an HTTP protocol?
You can check the AsyncWeb project, which is a MINA subproject,
implementing a web server on top of MINA. So, yes, it's sensible.
> I've seen
> references to the asyncWeb project, but it seems like it's perhaps still being baked?
It is.
> Put another
> way, is anyone building and shipping a commercial product that uses it?
I have no idea.
> Or, does anyone know
> of another open-sourced HTTP solution built atop of Apache MINA? (We may have the freedom
> to move away from web services & SOAP, but we'd still be using an HTTP-based protocol.)
>
At this point, I'm really wondering what makes you think that MINA can
solve the issues you have? Remember that MINA is _just_ a NIO framework...
> Second, are there any reasonably-size worked examples out there of using MINA to implement
> SEDA concepts?
MINA does not really implement any of the SEDA concept. This was the
idea from day one, but soon it appears that it was not exactly easy to
implement a SEDA server. <personnal opinion>And I serioulsy question
those SEDA concepts when it comes to provide better scalability (I'm not
alone ...) </personnal opinion>. Put in the MINA context, the way it
works is pretty simple :
- you have an Acceptor which create the incoming connection
- a thread is then 'reacting' (MINA is following the Reactor pattern)
and push the incoming requests to a chain of filters
this is were we would expect the SEDA concepts to be present : ie, each
filter push the result of the local processing into a queue, and the
next filter pop the elements from the shared queue to process them. We
don't have that.
> I see folks referring to the "excellent MINA documentation", and I confess I
> feel stupid as a result. :-)
>
"Excellent documentation" is a Politically Correct sentence. It
translates to "Absolutely fucked up and lacking documentation".
Hopefully, people like Ashish is killing is "Excellent body part" of him
improving the doco and providing good samples !
> Have many more questions, but am curious to see responses to the above first.
>
Well, I don't know if it will be helpful, but let me say that before
thinking of switching to MINA in order to get better performance in your
system, you should stop a while, check your architecture, and see where
are the real bottlenecks. Some kind of profiling with J2EE tools
(performasure, for instance) could help you a bit.
Sorry if I look like giving you advices about something you pretty much
know more than me, but decades of slashing bad code from bad
applications told me that technical factors are less likely to drive to
slow system than bad design from the beginning...
Hope it helps ...
--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org