Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id ECCC0200D2B for ; Thu, 19 Oct 2017 06:05:21 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id E461B160BEB; Thu, 19 Oct 2017 04:05:21 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 0E35F160BEA for ; Thu, 19 Oct 2017 06:05:20 +0200 (CEST) Received: (qmail 88938 invoked by uid 500); 19 Oct 2017 04:05:15 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 88926 invoked by uid 99); 19 Oct 2017 04:05:14 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Oct 2017 04:05:14 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id CA3071A0274 for ; Thu, 19 Oct 2017 04:05:13 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 4.545 X-Spam-Level: **** X-Spam-Status: No, score=4.545 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=2, KAM_NUMSUBJECT=0.5, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, URI_HEX=1.313, URI_TRY_3LD=0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id BhLb5SW56McO for ; Thu, 19 Oct 2017 04:05:11 +0000 (UTC) Received: from mail-it0-f46.google.com (mail-it0-f46.google.com [209.85.214.46]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id E30425F121 for ; Thu, 19 Oct 2017 04:05:10 +0000 (UTC) Received: by mail-it0-f46.google.com with SMTP id n195so8396736itg.2 for ; Wed, 18 Oct 2017 21:05:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to; bh=OIh24vE9vrMHUhuq2ddjuLsH8GvHtFgiuz8ddkIrFk4=; b=oVJMTQEj4si/fm1EZXN9Il5kohlnyota5Im1UgcyfI5X4GJ0sZVy9b2yK7jyz1AyiJ Ya9nbuQGp8+nS5u1yJhU+o3HMX7IhCrbIpzNTCzcm2j6VQq9a4abc6OnPk/8uEoOXjDm Dt9qXR4E8VEj5PqgYkKVskUE72JmOYNBmzt4cIaUV2ShoyeeRe7cejBgueTDy4XkKbbH cqjIt4QmacWx+uXfnFuXNsN6dlmQrfVGKaPkyrRfI4zrUx4Vh1FyyIxndRPQkiLA8H3L WCUYSC2yel/yHso8e48tAGjpEyXUyLLZLsO57dwFEAlvhEa9M99a1e6Zzhp0tR9TVKti vnbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to; bh=OIh24vE9vrMHUhuq2ddjuLsH8GvHtFgiuz8ddkIrFk4=; b=OB/pUrOJ0shjFj+4Fq3UR78mOJgUlE0UL5rdQtmNv29Hqc0JlQ5FJIkVwCzuZjqYZJ UWa6ZBt8DkpSPS30dyGXjsI38rZVpmBII97StSbzBjfMs9fNASRnayjPAozKv30f4m1b xsM9SvwaLKF+mzcIWw+4OQ/Q7iNHktvWDJroRuzYitdLk07INBXLcGTRXMEaBbHDYKk3 QVCuI/WeGtQ4kxiNfqwGtTEzWOyUt0zDVeP0a50JUKkpaxyrkj6oG3/YMBwHR7Zp4+Pv ixCA3256aBkXJZ+flqo/9vDKiV9HUgn4zFOdeIEjtluTfnqu7CqG+UOg+j9pBSF+P5m1 fu0A== X-Gm-Message-State: AMCzsaUV1zqVoBDomJVyGeIXhJHrkvwcNrbxS3obJg+OkYDEl3yWllBh /Nx6x4XxjbwgkRiB8GHSdu9/OhFQWQU6GYZKUGaxyA== X-Google-Smtp-Source: ABhQp+R9OW031pUc2xVVXQGiKTCtZFlrnleL+wcj0nbkTTkwM0QrmGv4nDsAG7FIO2MfCVXQXFAGkkPMJwPdh6jzpLg= X-Received: by 10.36.95.2 with SMTP id r2mr764355itb.25.1508385909320; Wed, 18 Oct 2017 21:05:09 -0700 (PDT) MIME-Version: 1.0 Sender: tbain98@gmail.com Received: by 10.2.102.30 with HTTP; Wed, 18 Oct 2017 21:04:48 -0700 (PDT) In-Reply-To: <1507770290516-0.post@n4.nabble.com> References: <1506430286244-0.post@n4.nabble.com> <1507770290516-0.post@n4.nabble.com> From: Tim Bain Date: Wed, 18 Oct 2017 22:04:48 -0600 X-Google-Sender-Auth: WPPfjmTRMOZ1zSI7sQqjDbFRCDk Message-ID: Subject: Re: Kahadb index updates taking too much time on ActiveMQ 5.11 To: ActiveMQ Users Content-Type: multipart/alternative; boundary="001a11448ce04f3092055bde7650" archived-at: Thu, 19 Oct 2017 04:05:22 -0000 --001a11448ce04f3092055bde7650 Content-Type: text/plain; charset="UTF-8" Sorry for the delay in responding. I've got a number of follow-up questions/suggestions: 1. Can you take screenshots sorted by all four non-percentage columns (Self Time, Self Time (CPU), Total Time, Total Time (CPU))? The ones with CPU measure CPU time, while the ones without measure total elapsed time (of which some portion is CPU and some portion is things like sleeps and I/O waits). 2. Can you please take a screenshot of the Monitor tab after ActiveMQ finishes starting up? In particular I want to make sure that GC CPU usage looks reasonable. 3. From your screenshot entitled cpu-total-time.jpg, it's clear that there's a very significant amount of CPU time being spent calling org.apache.karaf.management.internal.MBeanInvocationHandler.invoke(), which is JMX-related. We need to figure out if this is relevant or is a red herring. To do that, please find that method in the Call Tree tab (you should be able to right-click on it in the Hot Spots tab and select something like "Find in Call Tree") and see if you can tell what's calling it and what it's calling and whether those calls are in any way related to ActiveMQ. I suspect that it might actually be related to the use of VisualVM, but we need to make sure before we write it off. 4. From your screenshot entitled cpu-self-time.jpg (which is in fact Self Time, *not* Self Time (CPU) as you said), it's clear that there's a significant amount of time being spent in org.apache.activemq.store.kahadb.MessageDatabase$3.run() as well as in various other ActiveMQ-related methods. You'll need to find those methods in the Call Tree tab and walk down the call stack looking for where the majority of the time (I'd focus on elapsed time rather than just CPU, because disk I/O may be part of your problem) is being spent. You can ignore any thread that doesn't eventually land you in something related to KahaDB or files; not every thread will be relevant to your slow startup time, so ignore the ones that aren't. It looks like a lot of time is being spent in RecoverableRandomAccessFile.readInt(), readFully(), and readByte(), so I suspect that those will be a large portion of where your time is being spent, but you may discover that there are other places where time is being spent that weren't visible from the screenshots you've shown so far. 5. If the time really is primarily spent in those three read*() methods, they simply call the equivalent methods in http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/java/io/RandomAccessFile.java while wrapped in try/catch statements, so either you're really spending that long reading the bytes from the files and doing shift-and-add operations on the read bytes (in which case you should probably examine both your NFS performance and your belief that you're only reading 5GB of data) or you're spending a ton of time doing exception-handling (in which case we may need to get a debugger in there to figure out what the exceptions are). I think those things will give us a good set of next steps to get closer to determining what's actually going on. Tim On Wed, Oct 11, 2017 at 7:04 PM, Devlin wrote: > Samples for cpu self-time, total-time, and memory usage: > > > > > > > > > > -- > Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User- > f2341805.html > --001a11448ce04f3092055bde7650--