You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Martin Marinov (JIRA)" <ji...@apache.org> on 2014/04/16 19:26:18 UTC

[jira] [Updated] (CAMEL-7374) Slow message processing due to unnecessary logging

     [ https://issues.apache.org/jira/browse/CAMEL-7374?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Marinov updated CAMEL-7374:
----------------------------------

    Attachment: hotspot_bad.JPG

A screenshot of the JProfile session during which we found the issue. We were receiving 100000 events and the onMessage method was invoked 100000 times.

> Slow message processing due to unnecessary logging
> --------------------------------------------------
>
>                 Key: CAMEL-7374
>                 URL: https://issues.apache.org/jira/browse/CAMEL-7374
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core, camel-jms
>    Affects Versions: 2.12.1
>         Environment: Windows 7 Enterprise 64 bit, Oracle JRE 1.7.0.51
>            Reporter: Martin Marinov
>         Attachments: hotspot_bad.JPG
>
>
> org.apache.camel.component.jms.EndpointMessageListener.onMessage, line 68:
> LOG.debug("{} consumer received JMS message: {}", endpoint, message);
> When debug logging is disabled, the log string from above will not be output anywhere. Nevertheless, it will still be generated. The problem is that DefaultEndpoint.toString() calls URISupport.sanitizeUri() which uses regex pattern matching and replacing to process the passed endpoint URL. The java.util.regex.Matcher.replaceFirst methods turned out to be rather time consuming, thus slowing down the message processing and decreasing the message throughput under high loads. 
> The same problem is observed in org.apache.camel.processor.SendProcessor.process(). It causes slower sending.
> Commenting the LOG.debug invocations at these places improved the message throughput almost 3 times! The solution, of course is not comment these lines, but probably to put them inside
> if (LOG.isDebugEnabled()) { } blocks.



--
This message was sent by Atlassian JIRA
(v6.2#6252)