You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@uima.apache.org by swirl <sw...@yahoo.com> on 2013/07/17 04:38:47 UTC

Running Uima in Tomcat (loading of large model)

I am wrapping a Uima analysis engine in a Tomcat.

This AE loads and parses a large model file (300Mb).
The loading time of this model takes 3min. This is unacceptable if users have 
to wait so long to do analysis on one document.

What are the possible ways to reduce the loading time? 

One solution I can think of but need some confirmation of assumptions:
Run the AE in Uima AS. But does AS 
 i. allows pre-loading of the model to wait for requests to come in.
 ii. retains the model in memory so that there is no need to reload it for 
subsequent request?

Any other solution in Uima framework that I might have missed? 


Re: Running Uima in Tomcat (loading of large model)

Posted by Marshall Schor <ms...@schor.com>.
There are 2 APIs when working with UIMA:

1) The APIs for Annotator components

2) The APIs used to "embed" a UIMA Pipeline into something else.

The basic flow for #2 includes:

a) Feeding XML Descriptors of the UIMA pipeline to be instantiated to the UIMA
Framework, producing an "analysis engine", etc.; this action has a secondary
effect of invoking the "initialize" method on all the parts.  The initialize
method can be implemented by any part to do any setup it wants, including
loading other resources.

b) Running things through the pipeline, usually in a loop.

HTH.  See for more details:
http://uima.apache.org/d/uimaj-2.4.0/tutorials_and_users_guides.html

Chapter 3 talks about the embedding application and the APIs used there.

-Marshall
On 7/19/2013 5:15 AM, swirl wrote:
> Marshall Schor <ms...@...> writes:
>
>>
>> On 7/16/2013 10:38 PM, swirl wrote:
>>> I am wrapping a Uima analysis engine in a Tomcat.
>>>
>>> This AE loads and parses a large model file (300Mb).
>>> The loading time of this model takes 3min. This is unacceptable if users 
> have 
>>> to wait so long to do analysis on one document.
>>>
>>> What are the possible ways to reduce the loading time? 
>> The basic UIMA lifecycle includes the possibilities of loading the model 
> at
>> "startup" time, and then leaving it loaded.  Would this work for your 
> case?  No
>> need for UIMA-AS, here.  The pipeline would be loaded and "waiting" to 
> receive a
>> CAS to work on; the model would be retained in memory between calls to 
> process().
>  
>
> Thanks Marshall,
> I am intrigued by the possibility of Uima framework loading the model at 
> "startup" time, can you point out to me where I can start looking for this 
> function?
>
>
>


Re: Running Uima in Tomcat (loading of large model)

Posted by swirl <sw...@yahoo.com>.
Marshall Schor <ms...@...> writes:

> 
> 
> On 7/16/2013 10:38 PM, swirl wrote:
> > I am wrapping a Uima analysis engine in a Tomcat.
> >
> > This AE loads and parses a large model file (300Mb).
> > The loading time of this model takes 3min. This is unacceptable if users 
have 
> > to wait so long to do analysis on one document.
> >
> > What are the possible ways to reduce the loading time? 
> The basic UIMA lifecycle includes the possibilities of loading the model 
at
> "startup" time, and then leaving it loaded.  Would this work for your 
case?  No
> need for UIMA-AS, here.  The pipeline would be loaded and "waiting" to 
receive a
> CAS to work on; the model would be retained in memory between calls to 
process().
> 
 

Thanks Marshall,
I am intrigued by the possibility of Uima framework loading the model at 
"startup" time, can you point out to me where I can start looking for this 
function?



Re: Running Uima in Tomcat (loading of large model)

Posted by Marshall Schor <ms...@schor.com>.
On 7/16/2013 10:38 PM, swirl wrote:
> I am wrapping a Uima analysis engine in a Tomcat.
>
> This AE loads and parses a large model file (300Mb).
> The loading time of this model takes 3min. This is unacceptable if users have 
> to wait so long to do analysis on one document.
>
> What are the possible ways to reduce the loading time? 
The basic UIMA lifecycle includes the possibilities of loading the model at
"startup" time, and then leaving it loaded.  Would this work for your case?  No
need for UIMA-AS, here.  The pipeline would be loaded and "waiting" to receive a
CAS to work on; the model would be retained in memory between calls to process().

> One solution I can think of but need some confirmation of assumptions:
> Run the AE in Uima AS. But does AS 
>  i. allows pre-loading of the model to wait for requests to come in.
>  ii. retains the model in memory so that there is no need to reload it for 
> subsequent request?
UIMA-AS allows for scaling out parts of a pipeline across multiple machines.  It
does have the lifecycle of being able to load a model at "startup" and then wait
for requests to come in, but as stated above, so does base UIMA.  Running on a
separate machine would perhaps ease any memory contention issues you may have,
though.

-Marshall
>
> Any other solution in Uima framework that I might have missed? 
>
>