From user-return-21826-archive-asf-public=cust-asf.ponee.io@ignite.apache.org Wed Sep 12 21:29:42 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id F127F180630 for ; Wed, 12 Sep 2018 21:29:41 +0200 (CEST) Received: (qmail 38477 invoked by uid 500); 12 Sep 2018 19:29:40 -0000 Mailing-List: contact user-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@ignite.apache.org Delivered-To: mailing list user@ignite.apache.org Received: (qmail 38467 invoked by uid 99); 12 Sep 2018 19:29:40 -0000 Received: from mail-relay.apache.org (HELO mailrelay2-lw-us.apache.org) (207.244.88.137) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Sep 2018 19:29:40 +0000 Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com [209.85.208.176]) by mailrelay2-lw-us.apache.org (ASF Mail Server at mailrelay2-lw-us.apache.org) with ESMTPSA id B70EC2269 for ; Wed, 12 Sep 2018 19:29:39 +0000 (UTC) Received: by mail-lj1-f176.google.com with SMTP id l15-v6so2616841lji.6 for ; Wed, 12 Sep 2018 12:29:39 -0700 (PDT) X-Gm-Message-State: APzg51BQm3o/TH4B5SW2fVZK5WBkx6IINrpTGfPd4Yojo9qIeSsrLBHU 2OpVWEssLenFz+DLYIDEjDTWgkvV5saStigKewC3pw== X-Google-Smtp-Source: ANB0Vdbj4KQidVa8kgmUqm9c+7FgF+BFRewq43FzbJGWWMaeBErjYRRqy1ZD/pM1jC6gWs5yXpgO0x2sjOjBUDO2EFs= X-Received: by 2002:a2e:7014:: with SMTP id l20-v6mr2422055ljc.141.1536780578538; Wed, 12 Sep 2018 12:29:38 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Denis Magda Date: Wed, 12 Sep 2018 15:29:11 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: How to throttle/limit the cache-store read threads? To: user@ignite.apache.org Content-Type: multipart/alternative; boundary="0000000000007b68070575b19c19" --0000000000007b68070575b19c19 Content-Type: text/plain; charset="UTF-8" System thread pool is used for cache and cache store operation. However, I would discourage you from limiting it to 1 thread. In general, extend the cache store implementation you use and forward all CacheStore.read() operations to your single-threaded pool. -- Denis On Sun, Sep 9, 2018 at 11:41 AM Saikat Maitra wrote: > Hi Mridul, > > Have you considered the option of creating a dedicated Threadpool for the > cache store operations. Here is an example > > http://commons.apache.org/dormant/threadpool/ > > Another option would be to consider Hystrix Command Threadpool since you > mentioned that the cache store is remote web service. > > https://github.com/Netflix/Hystrix/wiki/How-To-Use#Command%20Thread-Pool > > HTH > Regards > Saikat > > On Sun, Sep 9, 2018 at 6:04 AM, Mridul Chopra > wrote: > >> Hello, >> >> I have implemented a cache store for read-through ignite caching, whenever >> there is a read-through operation through the cache-store, I want to limit >> this to single thread or at max 2. The reason behind the same is due to >> the >> fact that the underlying cache store is a remote Rest based webservice >> that >> can only support limited number of connections. Hence I want to have >> limited number of requests being sent for read-through. Please note that >> if >> I configure publicThreadPoolSize =1 , this would mean all cache.get and >> cache.getAll operations would be single threaded. Hence this behaviour is >> not desired, I want to have throttling at the cache store level only. >> Thanks, >> Mridul >> > > --0000000000007b68070575b19c19 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
System thread pool is used for cache and cache store opera= tion. However, I would discourage you from limiting it to 1 thread.
In general, extend the cache store implementation=C2=A0you use = and forward all CacheStore.read() operations to your single-threaded pool.<= /div>

--
Denis


<= div class=3D"gmail_quote">
On Sun, Sep 9, 2018 at 11:41 AM = Saikat Maitra <saikat.maitra@= gmail.com> wrote:
Hi Mridul,

Ha= ve you considered the option of creating a dedicated Threadpool for the cac= he store operations. Here is an example=C2=A0


Ano= ther option would be to consider Hystrix Command Threadpool since you menti= oned that the cache store is remote web service.

<= a href=3D"https://github.com/Netflix/Hystrix/wiki/How-To-Use#Command%20Thre= ad-Pool" target=3D"_blank">https://github.com/Netflix/Hystrix/wiki/How-To-U= se#Command%20Thread-Pool

HTH
Reg= ards
Saikat
On Sun, Sep 9, 2018 at 6:04 AM, Mridul Chopra <= span dir=3D"ltr"><mridulchopra@gmail.com> wrote:
Hello,

I have implemented a cache store for read-through ignite caching, whenever<= br> there is a read-through operation through the cache-store, I want to limit<= br> this to single thread or at max 2. The reason behind the same is due to the=
fact that the underlying cache store is a remote Rest based webservice that=
can only support limited number of connections. Hence I want to have
limited number of requests being sent for read-through. Please note that if=
I configure publicThreadPoolSize =3D1 , this would mean all cache.get and cache.getAll operations would be single threaded. Hence this behaviour is not desired, I want to have throttling at the cache store level only.
Thanks,
Mridul

--0000000000007b68070575b19c19--