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 1D029200D18 for ; Wed, 11 Oct 2017 23:39:05 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 186031609E5; Wed, 11 Oct 2017 21:39:05 +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 5D8251609BB for ; Wed, 11 Oct 2017 23:39:04 +0200 (CEST) Received: (qmail 19773 invoked by uid 500); 11 Oct 2017 21:39:03 -0000 Mailing-List: contact issues-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list issues@activemq.apache.org Received: (qmail 19762 invoked by uid 99); 11 Oct 2017 21:39:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Oct 2017 21:39:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id C277DC34DD for ; Wed, 11 Oct 2017 21:39:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id WoGH1WkzuHce for ; Wed, 11 Oct 2017 21:39:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 22BFD5F19C for ; Wed, 11 Oct 2017 21:39:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 56D8EE02C7 for ; Wed, 11 Oct 2017 21:39:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 11E4F25397 for ; Wed, 11 Oct 2017 21:39:00 +0000 (UTC) Date: Wed, 11 Oct 2017 21:39:00 +0000 (UTC) From: "Volker Kleinschmidt (JIRA)" To: issues@activemq.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (AMQ-2520) Oracle 10g RAC resource usage VERY high from the passive servers SQL requests to the Database. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 11 Oct 2017 21:39:05 -0000 [ https://issues.apache.org/jira/browse/AMQ-2520?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16200986#comment-16200986 ] Volker Kleinschmidt edited comment on AMQ-2520 at 10/11/17 9:38 PM: -------------------------------------------------------------------- Also note that if you use the FOR UPDATE NOWAIT or FOR UPDATE WAIT N forms of the locking query (as should be the default!!!), you will get an exception from the attempt to lock. Currently these are being logged at "info" or "warn" level depending on the locker implementation you use, so they will flood your logs with something that should be perfectly ignored, as this exception is the expected state 99.99% of the time (it should at most be logged at debug level). So there's definitely a need for code change here. was (Author: volkerk): Also note that if you use the FOR UPDATE NOWAIT or FOR UPDATE WAIT N forms of the locking query (as should be the default!!!), you will get an exception from the attempt to lock. Currently these are being logged at "warn" level, so they will flood your logs with something that should be perfectly ignored, as this exception is the expected state 99.99% of the time (it should at most be logged at debug level). So there's definitely a need for code change here. > Oracle 10g RAC resource usage VERY high from the passive servers SQL requests to the Database. > ---------------------------------------------------------------------------------------------- > > Key: AMQ-2520 > URL: https://issues.apache.org/jira/browse/AMQ-2520 > Project: ActiveMQ > Issue Type: Bug > Components: Broker > Affects Versions: 5.3.0, 5.4.0 > Environment: Redhat Enterprise Linux 5, Oracle 10g RAC > Reporter: Thomas Connolly > Fix For: 5.x > > > Two active MQ brokers are installed on RH EL 5 servers (one per server). > They're configured as a JDBC master / slave failover (as per examples). Failover is tested and working and messages delivered. > Oracle is used for synchronisation (ACTIVEMQ_ tables), persistence etc. > We run a durable subscriber, and the client connects via a failover operation. > The SELECT * FROM ACTIVEMQ_LOCK FOR UPDATE is causing spin lock on the Oracle database. > Basically the indefinite waiting from the passive mq instance is causing high resource usage on Oracle. > After a short period Oracle dashboard shows a high number of active sessions from Active MQ due to the continuous execution of > UPDATE ACTIVEMQ_LOCK SET TIME = ? WHERE ID = 1 > in the keepAlive method in > https://svn.apache.org/repos/asf/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/DatabaseLocker.java > As a workaround we've had to push out the lockAcquireSleepInterval to 5 minutes in the configuration of ActiveMQ, but this didn't work. > > We're currently changing the broker to poll rather than block so in Statement.java we've added a WAIT 0 that throws an exception if the lock is not acquired. > public String getLockCreateStatement() { > if (lockCreateStatement == null) { > lockCreateStatement = "SELECT * FROM " + getFullLockTableName(); > if (useLockCreateWhereClause) { > lockCreateStatement += " WHERE ID = 1"; > } > lockCreateStatement += " FOR UPDATE WAIT 0"; > } > return lockCreateStatement; > } > Any suggestions to this issue, this seems to be a quite fundamental issue? -- This message was sent by Atlassian JIRA (v6.4.14#64029)