app runs poorly when inside Jetty

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

app runs poorly when inside Jetty

Noel Bush-2
The summary of my question is: What is happening differently that might
affect performance between these two scenarios:

(a) my app "manages itself" and starts up an instance of Jetty, just
using a simple servlet to do its web interaction part, and

(b) my app is "embedded" -- an instance of it is created within a servlet

Here are more details.  All thoughts much appreciated!

[I have looked through the Jetty web site and can't find anything to
help me answer this.  I also tried searching the mailing list archives
with Gmane, but it seems their search facility is broken.  (I got zero
results in either list for "memory", as well as for "jetty".)]

I have an application that I usually run standalone.  In the past, I
have used Jetty with it to provide a web interface, but it has been the
app that controls the Jetty instance.  There is just a very simple
servlet that connects to the main application.  A reference to the core
object of the main application is passed to the servlet as a
ServletContext attribute.

Now I am trying to do things the other way around: Jetty is running the
show, and the core object of my main app is created and configured by a
ContextListener.  The same simple servlet as before still manages
interaction with the user via the web interface.

Here's the thing: my app has to load a huge amount of data into memory
as part of its startup phase.  It is not unusual for this to take
several minutes (although I'm due for another round of optimization, and
have been able to cut this way down previously).

In the first configuration, even if it does take several minutes, I can
load the data and the app can begin interacting via the web interface.
But in the second setup, where my app is created from within the
servlet, there seems to be a cap on the amount of data I can load.
Eventually, the program just hangs, doing nothing, never finishing the load.

I have tried allocating really large amounts of memory on the command
line.  I have used the "-server" switch.  Nothing seems to help.

Is my application running into some limits imposed because it is created
by the ContextListener?  Can it be that when I'm calling methods of my
app from within a servlet, there are some sorts of limitations?

I'm at a loss for what to try.  It seems to me that there must be
something I need to configure with Jetty to tell it to allow my app to
run unfettered.

All advice appreciated!

Thanks,
Noel


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
jetty-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-discuss
Reply | Threaded
Open this post in threaded view
|

Re: app runs poorly when inside Jetty

Greg Wilkins-5

Noel,

I can't think of anything that could cause the slowdown/problem that
you describe.

I guess the simple test is that you write a dummy ContextListener
that just allocates memory and perhaps sleeps in a similar pattern
to your real app.

This will reveal any memory or timing problems.  But Jetty does
not put any memory or time limits on the ContextListener.

The only real difference is that you will be using the jetty
ContextLoader as your context classloader.   If your init does
lots of work via the class loader, this may be the issue?

But try the dummy first, just so we can eliminate anything simple.

cheers


Noel Bush wrote:

> The summary of my question is: What is happening differently that might
> affect performance between these two scenarios:
>
> (a) my app "manages itself" and starts up an instance of Jetty, just
> using a simple servlet to do its web interaction part, and
>
> (b) my app is "embedded" -- an instance of it is created within a servlet
>
> Here are more details.  All thoughts much appreciated!
>
> [I have looked through the Jetty web site and can't find anything to
> help me answer this.  I also tried searching the mailing list archives
> with Gmane, but it seems their search facility is broken.  (I got zero
> results in either list for "memory", as well as for "jetty".)]
>
> I have an application that I usually run standalone.  In the past, I
> have used Jetty with it to provide a web interface, but it has been the
> app that controls the Jetty instance.  There is just a very simple
> servlet that connects to the main application.  A reference to the core
> object of the main application is passed to the servlet as a
> ServletContext attribute.
>
> Now I am trying to do things the other way around: Jetty is running the
> show, and the core object of my main app is created and configured by a
> ContextListener.  The same simple servlet as before still manages
> interaction with the user via the web interface.
>
> Here's the thing: my app has to load a huge amount of data into memory
> as part of its startup phase.  It is not unusual for this to take
> several minutes (although I'm due for another round of optimization, and
> have been able to cut this way down previously).
>
> In the first configuration, even if it does take several minutes, I can
> load the data and the app can begin interacting via the web interface.
> But in the second setup, where my app is created from within the
> servlet, there seems to be a cap on the amount of data I can load.
> Eventually, the program just hangs, doing nothing, never finishing the
> load.
>
> I have tried allocating really large amounts of memory on the command
> line.  I have used the "-server" switch.  Nothing seems to help.
>
> Is my application running into some limits imposed because it is created
> by the ContextListener?  Can it be that when I'm calling methods of my
> app from within a servlet, there are some sorts of limitations?
>
> I'm at a loss for what to try.  It seems to me that there must be
> something I need to configure with Jetty to tell it to allow my app to
> run unfettered.
>
> All advice appreciated!
>
> Thanks,
> Noel
>
>
> -------------------------------------------------------
> SF.Net email is Sponsored by the Better Software Conference & EXPO
> September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
> Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
> Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
jetty-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-discuss