uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eddie Epstein <eaepst...@gmail.com>
Subject Re: Accessing uima as pipeline from a REST interface
Date Wed, 26 Feb 2014 14:17:28 GMT
Hi Mihaela,

The UimaAsynchronousEngine is designed to support multiple threads
accessing a service. The engine API object has a CAS pool size parameter
and initial CAS size parameters to support this.

>From the RunRemoteAsyncAE.java sample code:
    // Add the Cas Pool Size and initial FS heap size
    appCtx.put(UimaAsynchronousEngine.CasPoolSize, casPoolSize);
    appCtx.put(UIMAFramework.CAS_INITIAL_HEAP_SIZE,
Integer.valueOf(fsHeapSize / 4).toString());

Since the default CAS size is large, over 2MB, memory can be a problem for
large pool sizes and a significant memory requirement had by reducing the
initial size.

So the engine API object is initialized once, and then multiple threads can
call the same object's getCAS() and sendAndReceive(CAS) methods in
parallel. The CAS pool size can be used to limit the number of concurrent
requests.

Eddie



On Tue, Feb 25, 2014 at 2:15 PM, Mihaela M <mmihaela1985@yahoo.com> wrote:

> Hello,
>
> I have an Uima As pipeline that has more annotators running in parallel.
> On top of this I want to build a REST service that would invoke the
> pipeline for a given text and return the annotations found back to the
> client. The REST service should support a high number of concurrent
> requests.
>
>
> Because of the need of having a synchronous call to the pipeline I thought
> I should use UimaAsynchronousEngine's sendAndReceive(CAS) method, but
> because this method is synchronized and blocks until the pipeline returns
> the reply, if I have only one instance of UimaAsynchronousEngine and the
> processing time is not that good all the calls of the web service will be
> handled synchronously, not in parallel.
>
> In this case , is it feasible to create a pool of UimaAsynchronousEngine
> clients (the pool size will match the CAS pool size of the uima as
> pipeline, which will add also more running instances of each annotator) and
> in the web service have one of the available clients in the pool reused to
> call the uima as pipeline synchronously? I know that each such client opens
> some connections to the ActiveMQ broker (at least two) so I expect to add
> some overhead to the message broker and my web server but I don't know how
> bad could it be.
>
>
> If I tune the pipeline so that is supports high throughput, what would be
> the best approach for adding this REST client with high throughput as well?
>
> I'm looking forward for any feedback or suggestions.
>
> Thanks,
> Mihaela

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message