Return-Path: X-Original-To: apmail-curator-dev-archive@minotaur.apache.org Delivered-To: apmail-curator-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D1501179DD for ; Tue, 16 Jun 2015 01:53:00 +0000 (UTC) Received: (qmail 58900 invoked by uid 500); 16 Jun 2015 01:53:00 -0000 Delivered-To: apmail-curator-dev-archive@curator.apache.org Received: (qmail 58855 invoked by uid 500); 16 Jun 2015 01:53:00 -0000 Mailing-List: contact dev-help@curator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@curator.apache.org Delivered-To: mailing list dev@curator.apache.org Received: (qmail 58843 invoked by uid 99); 16 Jun 2015 01:53:00 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Jun 2015 01:53:00 +0000 Date: Tue, 16 Jun 2015 01:53:00 +0000 (UTC) From: "Jordan Zimmerman (JIRA)" To: dev@curator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CURATOR-223) PathChildrenCache (wastefully) creates a thread per monitored node. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CURATOR-223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14587316#comment-14587316 ] Jordan Zimmerman commented on CURATOR-223: ------------------------------------------ There are already versions of PathChildrenCache's ctor that take an ExecutorService. It seems that ServiceCacheBuilder should have a way to set this. > PathChildrenCache (wastefully) creates a thread per monitored node. > ------------------------------------------------------------------- > > Key: CURATOR-223 > URL: https://issues.apache.org/jira/browse/CURATOR-223 > Project: Apache Curator > Issue Type: Improvement > Components: Recipes > Affects Versions: 2.7.1 > Reporter: Tom Dyas > > PathChildrenCache creates a single-threaded executor. In the aggregate, this means there is a thread for every monitored node. > In my company's use case, we use ServiceCache (which uses PathChildrenCache) to monitor service discovery nodes for the locations of many sharded immutable key/value stores used by our services. We saw in excess of 250 threads devoted to the PathChildrenCache's used by ServiceCache. These threads were all parked so there was negligible CPU impact, but there is still the memory/stack impact of having so many idle threads. We would like to avoid that impact. > I'd like to modify PathChildrenCache to take an ExecutorService as an alternate to the ThreadFactory it currently takes. This would allow me to pass in a thread pool for my company's use case. > Are there any issues with which I should be concerned concerning PathChildrenCache's use of separate threads? (Non-reentrancy from watcher-invoked code? Binary compatibility?) -- This message was sent by Atlassian JIRA (v6.3.4#6332)