From dev-return-30912-archive-asf-public=cust-asf.ponee.io@geode.apache.org Fri Apr 5 15:23:59 2019 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 36A2118060F for ; Fri, 5 Apr 2019 17:23:59 +0200 (CEST) Received: (qmail 41308 invoked by uid 500); 5 Apr 2019 15:23:58 -0000 Mailing-List: contact dev-help@geode.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@geode.apache.org Delivered-To: mailing list dev@geode.apache.org Received: (qmail 41285 invoked by uid 99); 5 Apr 2019 15:23:57 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Apr 2019 15:23:57 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 1BBEFC1DB9 for ; Fri, 5 Apr 2019 15:23:57 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.663 X-Spam-Level: X-Spam-Status: No, score=0.663 tagged_above=-999 required=6.31 tests=[KHOP_DYNAMIC=1.363, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id 7KkevmmYkj2z for ; Fri, 5 Apr 2019 15:23:55 +0000 (UTC) Received: from mx0b-00296801.pphosted.com (mx0b-00296801.pphosted.com [148.163.153.148]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 9F6DE5F10C for ; Fri, 5 Apr 2019 15:23:54 +0000 (UTC) Received: from pps.filterd (m0114586.ppops.net [127.0.0.1]) by mx0b-00296801.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x35FLm0g019300 for ; Fri, 5 Apr 2019 15:23:53 GMT Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) by mx0b-00296801.pphosted.com with ESMTP id 2rkgdgw0u8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 05 Apr 2019 15:23:53 +0000 Received: by mail-pg1-f197.google.com with SMTP id z12so4276094pgs.4 for ; Fri, 05 Apr 2019 08:23:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:date:references:to:in-reply-to:message-id; bh=uiiFnwSM2qYWXA3EcWMMJuZ9NhjWE8YBZfeBdSk9zlU=; b=UXFpGBFSRLAja/lQpep/Km1grwXhlJ+oyHSHHBs92BjtnKpvnlDtlX9pDCW30H7OIt irShajGWvvUxKBOpvdPid3wK9ejNWBxu/pu5OXpuiLd02ndGeo4h6q44ZAFrocsKhozR 9rVyV/sK8+xDZ4JFA8SPWy5sGAfBJRGskKPW7i49sSvJz1Zeo4hcKtdf/Qpe/l5fMKAC z2xwWILRY9VttmsdTGjNPGLjnlu09dt3bMO9GB++Fm89yDN6X39XYo89NvMAh1V2iZB5 Jp/4M15kPQqXTz5ORj5xgNCKVNt0h3xzWgnLL9f61hS0ATe2rHhSBywc54nkVa+6YEPl bnVg== X-Gm-Message-State: APjAAAVGvxDRr/5caVB5aW1eQo144ngIB69u4woN2kC3y+AS+V1ZwkBa G7LoH9WBzwD0fFSwWsAiKHRpb8oVyjb63T+YwA+Y+8e6oFn1BVvllOohArQJTLfa3x1BGeu4xOH lJ695QKZWbHlcUnFnNW23wXGvO6e+H9TN1XRKy/4= X-Received: by 2002:a63:c104:: with SMTP id w4mr12760691pgf.409.1554477831910; Fri, 05 Apr 2019 08:23:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqweK1Kfx08KJeS+vlQ0fLpDZ2M1uvxUsKxLa4sDW5wlWxhC2tYRvnzLZ8BX/czV7IM0JRgtQg== X-Received: by 2002:a63:c104:: with SMTP id w4mr12760652pgf.409.1554477831482; Fri, 05 Apr 2019 08:23:51 -0700 (PDT) Received: from [10.118.20.92] (50-203-225-134-static.hfc.comcastbusiness.net. [50.203.225.134]) by smtp.gmail.com with ESMTPSA id z8sm28043048pgz.3.2019.04.05.08.23.50 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Apr 2019 08:23:50 -0700 (PDT) From: Anthony Baker Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.1 \(3445.101.1\)) Subject: Re: [Discuss] Removal of Thread Local Connection Pooling Date: Fri, 5 Apr 2019 08:23:34 -0700 References: To: dev@geode.apache.org In-Reply-To: Message-Id: X-Mailer: Apple Mail (2.3445.101.1) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-04-05_11:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1904050104 One question: if I=E2=80=99m using thread-local connections ho does = that affect pool sizing? Are thread-local connections included in the = overall pool size or accounted for separately? We may want some explicit release notes if a user would need to resize = their pools during an upgrade. Anthony > On Apr 5, 2019, at 6:34 AM, Jacob Barrett wrote: >=20 > Devs, >=20 > The current connection pooling implementation contains a setting that = enables a secondary pool that is thread local. See ClientCacheFactory. = setPoolThreadLocalConnections method for details. This thread local = pooling was added to reduce contention on the primary connection pool = under high thread count or load. As of the completion of GEODE-6515 = there is no longer a contention issue in the primary pool under high = thread count or load, effectively rendering thread local pooling a = no-op. Thread local pooling also introduces many complexities into the = primary pool management of connections since a connection can either be = in the primary pool or a pool for each thread. Connection idle timeout, = lifetime expiration and load conditioning all have to work around thread = local connections making for some interesting relationships and = behavior. Additionally clients of thread local connections needed to = call Pool.releaseThreadLocalConnections prior to the thread terminating = or connections would be held until the GC finalized the thread local = storage. Use of thread local connections typically mean significantly = high connection counts on the servers since each thread could horde = connections to each server regardless of current workload need. >=20 > I propose that we deprecate all the public APIs for thread local = connections and immediately remove the behavior. The API methods will go = from an effective no-op to an actual no-op. A warning will be logged = when ClientCacheFactory. setPoolThreadLocalConnections is used. = Internally all thread local connection implementation will be removed. = The net effect to the client will be the same as promised with thread = local connections, that content on the primary pool is reduced for high = thread count and load. Additionally, the connection count to each server = will be reduced since threads won=E2=80=99t be holding connections to = servers they are not actively communicating with. All in all this will = be a net-positive improvement for the consuming client and the = distributed system as a whole. Internally this will be huge win as it = removes complexity and opens a path to removing even more complexity in = idle connection timeouts, connection lifetime expiration, and load = conditioning. Please see GEODE-6594 for more details. >=20 > I realize this is sort of a grey area. An obvious questions is, = =E2=80=9Cdoesn=E2=80=99t this violate semver by removing a feature in a = minor?=E2=80=9D My answer is a solid, =E2=80=9Cnope!=E2=80=9D The = feature is defined as =E2=80=9Creducing contention on the connection = pool=E2=80=9D, which is provided now by default in the refactored = connection pool. All that is being done is deprecating and warning that = a useless API is being removed in the next major release. The feature = remains intact and client code does not need to be re-compiled or = changed.=20 >=20 > I would love to hear if anyone has any concerns, questions or = dissenting opinions about this proposal. PR 3394 has been opened for = review of the code changes related to the removal. Please provide = feedback in the PR relating only to the code and discussions about the = merits of he proposal here in this email thread. >=20 > Thanks, > Jake >=20 > GEODE-6515 - https://issues.apache.org/jira/browse/GEODE-6515 = > GEODE-6594 - https://issues.apache.org/jira/browse/GEODE-6594 = > PR 3394 - https://github.com/apache/geode/pull/3394 = >=20