From user-return-6612-apmail-zookeeper-user-archive=zookeeper.apache.org@zookeeper.apache.org Tue Jul 23 21:54:33 2013 Return-Path: X-Original-To: apmail-zookeeper-user-archive@www.apache.org Delivered-To: apmail-zookeeper-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3DE3D10703 for ; Tue, 23 Jul 2013 21:54:33 +0000 (UTC) Received: (qmail 80177 invoked by uid 500); 23 Jul 2013 21:54:32 -0000 Delivered-To: apmail-zookeeper-user-archive@zookeeper.apache.org Received: (qmail 80145 invoked by uid 500); 23 Jul 2013 21:54:32 -0000 Mailing-List: contact user-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@zookeeper.apache.org Delivered-To: mailing list user@zookeeper.apache.org Delivered-To: moderator for user@zookeeper.apache.org Received: (qmail 28872 invoked by uid 99); 23 Jul 2013 20:52:19 -0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of VGlushak@luxoft.com designates 217.74.46.15 as permitted sender) From: "Glushak, Vladimir" To: "user@zookeeper.apache.org" Subject: High CPU utilization by zookeeper Thread-Topic: High CPU utilization by zookeeper Thread-Index: Ac6H5SPAdaVDTzS1TCK7xqWH1/lCAw== Date: Tue, 23 Jul 2013 20:51:50 +0000 Message-ID: Accept-Language: ru-RU, en-US Content-Language: ru-RU X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.30.81.14] Content-Type: multipart/alternative; boundary="_000_DFEDBF0F9F6F61468B464D5C17FBA2D2052499DBMBOX05dbdcluxof_" MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org --_000_DFEDBF0F9F6F61468B464D5C17FBA2D2052499DBMBOX05dbdcluxof_ Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: quoted-printable Hello Zookeeper community, I've found that our application with high CPU usage. I've done some profiling and found out that root cause of this issue is thr= ead responsible for connecting to zookeeper. After some more investigation, i've found out that my application (one proc= ess) has few separate sessions (clients ) that connect to zookeeper. I've r= efactored it and decrease number of sessions to 1. The CPU usage decreased. But still thread responsible for interaction with = zoo-server is consuming a lot of resources: main-SendThread(zoo.addr:zoo.port) 7,044,378.96 [ms] 984.896 ms / sec The application is currently in "sleep mode" - it does nothing, but this th= read is really busy. Should it be such? I've found out that this thread is currently works in infinity loop: com.db.itrac.router.context.SendThread -> run method, especially < clientC= nxnSocket.doTransport(to, pendingQueue, outgoingQueue); > consumes most o= f resources. To connecting zookeeper I'm using netflix CuratorFramework with default con= figuration. Maybe I'm doing smth wrong, please advice? Also I have two questions: 1. Should such high CPU consumption thread exists in app? Is it proper beha= vior? 2. Can one application has few separate sessions to zookeeper server? Is it= expected behavior to increase of CPU utilization? ________________________________ This e-mail and any attachment(s) are intended only for the recipient(s) na= med above and others who have been specifically authorized to receive them.= They may contain confidential information. If you are not the intended rec= ipient, please do not read this email or its attachment(s). Furthermore, yo= u are hereby notified that any dissemination, distribution or copying of th= is e-mail and any attachment(s) is strictly prohibited. If you have receive= d this e-mail in error, please immediately notify the sender by replying to= this e-mail and then delete this e-mail and any attachment(s) or copies th= ereof from your system. Thank you. --_000_DFEDBF0F9F6F61468B464D5C17FBA2D2052499DBMBOX05dbdcluxof_--