Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cqkA0-0005Pv-VO for pgsql-jdbc@arkaria.postgresql.org; Wed, 22 Mar 2017 17:35:01 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cqkA0-0006My-BM for pgsql-jdbc@arkaria.postgresql.org; Wed, 22 Mar 2017 17:35:00 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cqk9z-0006Mg-PS for pgsql-jdbc@postgresql.org; Wed, 22 Mar 2017 17:34:59 +0000 Received: from mail-wm0-x233.google.com ([2a00:1450:400c:c09::233]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1cqk9x-0005HI-39 for pgsql-jdbc@postgresql.org; Wed, 22 Mar 2017 17:34:58 +0000 Received: by mail-wm0-x233.google.com with SMTP id n11so43078819wma.1 for ; Wed, 22 Mar 2017 10:34:56 -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=nRnIsZ6hzS/B8IWDt00XeOWrtYT2t8liu1XsItRnA+Y=; b=SPNuYMx5oWHEMwFDKcBh/UrMfb5l6b/sK79H92pYLg9U5gHwYTdDgVkDm/Z4C+JZWa Smakqq1geX+NZpFbeBPi9zTsSRbBDuFEOfQeDicUbaAjRcujeliWZZTudEVXctHEVTFw cFQQknVXr66NN8yFsR7pmcUzTXUESl/xfGgOdBkbPLq0utOAf1wtBXO/664HZhnPJSF4 +N5/bpLqMm7dU7/UEK86FBH5MM0wz1nnaRRfj+RlqXh8IDRVKuYGsjlhUL0Lpia1LsbR wEIW811ZOtZzyEidVI7E1osHt56RZOoFnIySs7Xu30ayzM5nDaD/D9pTo7C1ksmRCSwQ 9R1Q== 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=nRnIsZ6hzS/B8IWDt00XeOWrtYT2t8liu1XsItRnA+Y=; b=BhaKYY483uzFKbzlewjwGPpAt+ljx/dta4fUo+Her8i0OASEEI9Lvi69YqrxafftuH 148+I/EskrWOBM92JwFjZ42S333AjF+b49uTqrNZV1pNURrhAyc4k/2v7fo4chROpvkr RoCz6YBhvgP0EneXfYVGLZBjL11JyNVlTtghNUZsndP6ePj47ST/BMMI2IFZTGXrlSXl i/peXipJyhR6DQE6ys4eQrcN8XLxMmmh5D+lWItytyo03E448flwYmRLWYTJaueX2GZq /r2AY19a994mGYMHlQqZTSPndFPR4CzHk2Fqnb1OgBbxGW+jBcqj1O3qxPhR6jm8/JOl 9IBg== X-Gm-Message-State: AFeK/H2VDNoOnben8zfM0rpNJP8MRF8ItNrZ4tnV8Tu7LCzuJqAG5bl5AgkOtHgB3WydHA== X-Received: by 10.28.210.133 with SMTP id j127mr9186679wmg.64.1490204095617; Wed, 22 Mar 2017 10:34:55 -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 q129sm9461681wmg.1.2017.03.22.10.34.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Mar 2017 10:34:55 -0700 (PDT) Subject: Re: 42.0.0.jre7, driver logging takes 30-40% of my server's time To: Dave Cramer References: <4195bb97-c924-8e19-9475-6c05a934afd0@googlemail.com> <10ae419f-d4b1-4b03-4a73-4403c2b8b519@googlemail.com> Cc: =?UTF-8?Q?Jorge_Sol=c3=b3rzano?= , List From: Konstantinos Kougios Message-ID: Date: Wed, 22 Mar 2017 17:34:53 +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="------------F82E63E6973B4C18C76BCF1A" X-Pg-Spam-Score: -2.7 (--) 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. --------------F82E63E6973B4C18C76BCF1A Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit It continues. It must be a misconfig of logback+common logging On 22/03/17 17:32, Dave Cramer wrote: > I'm confused when you say it passes this, does it return or continue > after this if statement ? > > Dave Cramer > > davec@postgresintl.com > www.postgresintl.com > > On 22 March 2017 at 13:24, Konstantinos Kougios > > > wrote: > > 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 >> >> >> > > --------------F82E63E6973B4C18C76BCF1A Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit
It continues. It must be a misconfig of logback+common logging

On 22/03/17 17:32, Dave Cramer wrote:
I'm confused when you say it passes this, does it return or continue after this if statement ?


On 22 March 2017 at 13:24, Konstantinos Kougios <kostas.kougios@googlemail.com> wrote:
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




--------------F82E63E6973B4C18C76BCF1A--