Return-Path: X-Original-To: apmail-manifoldcf-dev-archive@www.apache.org Delivered-To: apmail-manifoldcf-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1ADA917CB5 for ; Sun, 23 Nov 2014 16:57:13 +0000 (UTC) Received: (qmail 24019 invoked by uid 500); 23 Nov 2014 16:57:13 -0000 Delivered-To: apmail-manifoldcf-dev-archive@manifoldcf.apache.org Received: (qmail 23970 invoked by uid 500); 23 Nov 2014 16:57:13 -0000 Mailing-List: contact dev-help@manifoldcf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@manifoldcf.apache.org Delivered-To: mailing list dev@manifoldcf.apache.org Received: (qmail 23947 invoked by uid 99); 23 Nov 2014 16:57:13 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 23 Nov 2014 16:57:12 +0000 Date: Sun, 23 Nov 2014 16:57:12 +0000 (UTC) From: "Karl Wright (JIRA)" To: dev@manifoldcf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (CONNECTORS-1112) Heavy contention over repository connections 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/CONNECTORS-1112?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Karl Wright resolved CONNECTORS-1112. ------------------------------------- Resolution: Fixed > Heavy contention over repository connections > -------------------------------------------- > > Key: CONNECTORS-1112 > URL: https://issues.apache.org/jira/browse/CONNECTORS-1112 > Project: ManifoldCF > Issue Type: Improvement > Components: Framework core, JCIFS connector > Affects Versions: ManifoldCF 1.7.2 > Reporter: Aeham Abushwashi > Assignee: Karl Wright > Fix For: ManifoldCF 1.8, ManifoldCF 2.0 > > Attachments: CONNECTORS-1112.patch > > > On a recent test using (a slightly customised version of) the JCIFS repository connector, I noticed the Stuffer thread spends more than 50% of its time calling out to IRepositoryConnectorPool#grab (between wait() and talking to ZK). > I wondered if the StufferThread#run method could benefit from caching repository connections along the lines of CONNECTORS-1094 so I patched it up (see attachement) which took the time down a bit. Upon closer inspection I saw the calls to RepositoryConnectorPool#grab and RepositoryConnectorPool#releaseMultiple were constantly blocked waiting on a lock owned by the Idle cleanup thread. It turns out the Idle cleanup thread does some relatively expensive work ** at least for the JCIFS connector ** once it's acquired a lock on ConnectorPool#poolHash. It reads a config property in SharedDriveConnector#setThreadContext and that involves a trip to ZK and some XML parsing which results in loading and processing JAR files. I subsequently monitored other threads and found that many can be impacted for prolonged periods of time as they try to acquire and release repository connections. > Caching the values of config properties almost eliminates the time the Idle cleanup thread spends under lock and is easy enough to implement for the JCIFS connector. It would be great if this could be done in a way that is more generic to prevent a slight inefficiency in the code of one connector slowing down the entire system. -- This message was sent by Atlassian JIRA (v6.3.4#6332)