You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ctakes.apache.org by "Miller, Timothy" <Ti...@childrens.harvard.edu> on 2021/03/25 14:26:03 UTC

multi-threads on REST client?

Just wondering what the logistics of this are. The REST interface has a
CAS pool of 10, and when it gets a new request, it grabs a CAS and
sends it into a pipeline. So what happens if the REST endpoint is
getting hit by tons of different requests at the same time? I'm
experimenting with this in python and getting hard to understand errors
(best as I can tell it looks like it's complainin that the output is
None). Just wondering if anyone has any insight about what's going on
on the server side and whether a) this _should_ work, b) it _could_
work if done properly.

Thanks
Tim


Re: multi-threads on REST client?

Posted by gandhi rajan <ga...@gmail.com>.
You can also spin up multiple rest containers to balance your incoming load
and still let them talk to the same mysql DB that contains dictionary
details for better performance.

On Thu, Mar 25, 2021 at 10:47 PM Peter Abramowitsch <pa...@gmail.com>
wrote:

> I did a different implementation in my own rest service where I
> instantiated not only a fresh cas, but fresh pipeline for each threadpool
> object.  It's memory hungry but safe - running for weeks with 35
> simultaneous threads & zero errors.   I wasn't convinced that all the AEs
> were thread-safe to let them be shared.  So have a look at how the REST
> server sets up its threadpool and what it does after the service has
> completed a request in terms of releasing resources.  On RHEL, you may also
> need to increase your ulimit if you're getting connection refused errors
> under heavy load.  I discovered that....
>
> Peter
>
> On Thu, Mar 25, 2021 at 3:26 PM Miller, Timothy <
> Timothy.Miller@childrens.harvard.edu> wrote:
>
> > Just wondering what the logistics of this are. The REST interface has a
> > CAS pool of 10, and when it gets a new request, it grabs a CAS and
> > sends it into a pipeline. So what happens if the REST endpoint is
> > getting hit by tons of different requests at the same time? I'm
> > experimenting with this in python and getting hard to understand errors
> > (best as I can tell it looks like it's complainin that the output is
> > None). Just wondering if anyone has any insight about what's going on
> > on the server side and whether a) this _should_ work, b) it _could_
> > work if done properly.
> >
> > Thanks
> > Tim
> >
> >
>


-- 
Regards,
Gandhi

"The best way to find urself is to lose urself in the service of others !!!"

Re: multi-threads on REST client?

Posted by Peter Abramowitsch <pa...@gmail.com>.
I did a different implementation in my own rest service where I
instantiated not only a fresh cas, but fresh pipeline for each threadpool
object.  It's memory hungry but safe - running for weeks with 35
simultaneous threads & zero errors.   I wasn't convinced that all the AEs
were thread-safe to let them be shared.  So have a look at how the REST
server sets up its threadpool and what it does after the service has
completed a request in terms of releasing resources.  On RHEL, you may also
need to increase your ulimit if you're getting connection refused errors
under heavy load.  I discovered that....

Peter

On Thu, Mar 25, 2021 at 3:26 PM Miller, Timothy <
Timothy.Miller@childrens.harvard.edu> wrote:

> Just wondering what the logistics of this are. The REST interface has a
> CAS pool of 10, and when it gets a new request, it grabs a CAS and
> sends it into a pipeline. So what happens if the REST endpoint is
> getting hit by tons of different requests at the same time? I'm
> experimenting with this in python and getting hard to understand errors
> (best as I can tell it looks like it's complainin that the output is
> None). Just wondering if anyone has any insight about what's going on
> on the server side and whether a) this _should_ work, b) it _could_
> work if done properly.
>
> Thanks
> Tim
>
>