Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cqk0r-0004zN-Nx for pgsql-jdbc@arkaria.postgresql.org; Wed, 22 Mar 2017 17:25:33 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cqk0r-0004oK-5g for pgsql-jdbc@arkaria.postgresql.org; Wed, 22 Mar 2017 17:25:33 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cqk0L-0003l0-Aw for pgsql-jdbc@postgresql.org; Wed, 22 Mar 2017 17:25:01 +0000 Received: from mail-wr0-x232.google.com ([2a00:1450:400c:c0c::232]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1cqk0E-0001gv-4H for pgsql-jdbc@postgresql.org; Wed, 22 Mar 2017 17:25:00 +0000 Received: by mail-wr0-x232.google.com with SMTP id g10so133276050wrg.2 for ; Wed, 22 Mar 2017 10:24:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to; bh=SHtlzU7O0gQ7hXdEYr1kyrjOIDfvNaZAEtDDUNLZQhU=; b=Jkvh/iOnksOjn0pXEXCF4mpQL1HWPiIvsDE0hlS1eD9Xu1XJJRgN+b2y3qqPqdx75T lzujA5eXe/FBe/JACPv/FG0gJu+F46rTE5rQiF/E0qMJirlxQDh9PM2cKfsJFAqwYJiT 4q+Kmy3m8SfFa5gEEr/UbIcHRhguLxOIDT5q7EGLEhOMhQJX5r6R+FHXURuaPbMcew/w WyKeeap+etgezmsjFXD7IRQIpd+DS1lAWyUjgWPpCol4ap2J2oCplfqaxpm5DmaHwFOx tzIP2f/i+VQ/DpUtNZxf/F4LDYRqA0fMwCGFcfVFo2bA+db5gzskDCXiIUEA38ws+SUu G5mA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to; bh=SHtlzU7O0gQ7hXdEYr1kyrjOIDfvNaZAEtDDUNLZQhU=; b=Zvl5gyQrdQONbjo1o6ooPQNwGY6AB6Oxeoi5ljCb65nTDYQXERz0lz8LmH9zwvoHfd aCz9O4JUB6JJxNVZkdLL8mUy7SX9o40pUEOv3AXhp7aci0JXF/SfeA2J1fNyrKH/7U3b zifk+NpY6zLMT23iqqz1MdbsBYJLoRxw26RDL/d4IOP1EYnUQkb+hn6SSX2DvvTGPr8C Fi6V5fvVhjW7CsNcARsqxNhonBgyS3SjZPg1ggwNupTlDgrS0vPo5nMIT1pnTRchUobp SZhjpggWQSDWXoYP3Fbx/pkIRUFuOVPVU/R2vnyTeReJiTgOrUfD7RV15oqA7OKRxb7e F24g== X-Gm-Message-State: AFeK/H3QT64EQOEWHtp01r03QLRxZbLBtFU1FuAO2O8ZtEhdmgJg7TRDTgjbL/M+a11Big== X-Received: by 10.223.171.76 with SMTP id r12mr41180660wrc.164.1490203492996; Wed, 22 Mar 2017 10:24:52 -0700 (PDT) Received: from ?IPv6:2a02:c7f:8219:6d00:2150:e954:8a82:94cb? ([2a02:c7f:8219:6d00:2150:e954:8a82:94cb]) by smtp.googlemail.com with ESMTPSA id w10sm1109645wmw.14.2017.03.22.10.24.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Mar 2017 10:24:52 -0700 (PDT) Subject: Re: 42.0.0.jre7, driver logging takes 30-40% of my server's time To: =?UTF-8?Q?Jorge_Sol=c3=b3rzano?= References: <4195bb97-c924-8e19-9475-6c05a934afd0@googlemail.com> Cc: List From: Konstantinos Kougios Message-ID: <10ae419f-d4b1-4b03-4a73-4403c2b8b519@googlemail.com> Date: Wed, 22 Mar 2017 17:24:51 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------AB75D3933E51F87496D7A70C" X-Pg-Spam-Score: -2.0 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org This is a multi-part message in MIME format. --------------AB75D3933E51F87496D7A70C Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit I am using logback and I don't see any postgres-driver related logging, so I assume it should be off Looking at the stacktrace of the profile though, it seems it passes this code: if (!isLoggable(level)) { return; } So it seems as if it is ON though it doesn't log anything. On 22/03/17 17:21, Jorge Solórzano wrote: > Have you enabled the Logger with a FINEST (TRACE) level? > > > > On Wed, Mar 22, 2017 at 11:13 AM, Konstantinos Kougios > > > wrote: > > I tried to paste an image with a profile, but my email was rejected. > > It seems logging is called in places like row.getInt(), > row.getString() etc without a check for the logging level. Then it > takes a lot of time for those to be processed, especially for > queries that get a lot of data. It goes down to parsing strings > and locale and it just is slow. I see postgres processing a query > for 1 sec but on the java side it takes 5 secs to get the data > back to my code. Part of this slowdown is due to the logging. Can > it be optimized, i.e. having a boolean to true/false if logging is > enabled and then do the calls? > > Thanks > > > > > -- > Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org > ) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-jdbc > > > --------------AB75D3933E51F87496D7A70C Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit
I am using logback and I don't see any postgres-driver related logging, so I assume it should be off

Looking at the stacktrace of the profile though, it seems it passes this code:
if (!isLoggable(level)) {
    return;
}

So it seems as if it is ON though it doesn't log anything.

On 22/03/17 17:21, Jorge Solórzano wrote:
Have you enabled the Logger with a FINEST (TRACE) level?



On Wed, Mar 22, 2017 at 11:13 AM, Konstantinos Kougios <kostas.kougios@googlemail.com> wrote:
I tried to paste an image with a profile, but my email was rejected.

It seems logging is called in places like row.getInt(), row.getString() etc without a check for the logging level. Then it takes a lot of time for those to be processed, especially for queries that get a lot of data. It goes down to parsing strings and locale and it just is slow. I see postgres processing a query for 1 sec but on the java side it takes 5 secs to get the data back to my code. Part of this slowdown is due to the logging. Can it be optimized, i.e. having a boolean to true/false if logging is enabled and then do the calls?

Thanks




--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc


--------------AB75D3933E51F87496D7A70C--