Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id D0C575F9CE9 for ; Tue, 24 Jul 2012 04:55:17 -0300 (ADT) Received: from mail06.mel.iprimus.net.au ([210.50.217.229]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1StZxY-0003IB-Ae for pgsql-performance@postgresql.org; Tue, 24 Jul 2012 07:55:17 +0000 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EAEpUDlDLhhz+/2dsb2JhbABFgkq3IYEHgiABAQUtXAIBCBEEAQEoB0YJCAEBBAESCIgEAgq8dotKGoV6YAOVSZANgnGBTQ X-IronPort-AV: E=Sophos;i="4.77,644,1336312800"; d="scan'208,217";a="793042790" Received: from mail.geometryit.com ([203.134.28.254]) by smtp06.mel.iprimus.net.au with ESMTP/TLS/AES128-SHA; 24 Jul 2012 17:54:56 +1000 Received: from echo.geometryit.com ([::1]) by echo.geometryit.com ([::1]) with mapi; Tue, 24 Jul 2012 17:54:55 +1000 From: Brett Walker To: Riaan van den Dool , "pgsql-performance@postgresql.org" Date: Tue, 24 Jul 2012 17:54:49 +1000 Subject: Re: Geoserver-PostGIS performance problems Thread-Topic: [PERFORM] Geoserver-PostGIS performance problems Thread-Index: Ac1pbRQSRONcMcBIR3yE9y1SP+i66AAA/rCw Message-ID: <4B95BC7335A13A42AD0D23462F91AE6F6163F14852@echo.geometryit.com> References: <500E690D020000DB000A78CC@pta-emo.csir.co.za> In-Reply-To: <500E690D020000DB000A78CC@pta-emo.csir.co.za> Accept-Language: en-US, en-AU Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US, en-AU Content-Type: multipart/alternative; boundary="_000_4B95BC7335A13A42AD0D23462F91AE6F6163F14852echogeometryi_" MIME-Version: 1.0 X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201207/281 X-Sequence-Number: 47462 --_000_4B95BC7335A13A42AD0D23462F91AE6F6163F14852echogeometryi_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Riaan, I am familiar if the Geoserver/Geotools package and I believe that the prob= lem is not Postgres/PostGIS but rather Geoserver. The DB Connection Closed message is not sent at the end of the query, but r= ather at the end of the rendering. There is more than just querying happeni= ng between the Select message and the Closed message. Brett From: pgsql-performance-owner@postgresql.org [mailto:pgsql-performance-owne= r@postgresql.org] On Behalf Of Riaan van den Dool Sent: Tuesday, 24 July 2012 5:21 PM To: pgsql-performance@postgresql.org Subject: [PERFORM] Geoserver-PostGIS performance problems Hi We have noticed something strange in the interaction between our Geoserver = instance and Postgres/PostGIS. After setting Geoserver's log level to include developer debugging, I manag= ed to capture a single request from Geoserver WMS to PostGIS. The (shortened) sequence of events and their timestamps: 12:31:22,658 - SELECT query for MSG is sent to Postgres 12:32:10,315 - Rendering for MSG layer starts 12:32:10,356 - DB Connection Closed =3D=3D=3D=3D=3D=3D=3D=3D ~ 48 seconds Interestingly enough, when I execute the same query (MSG) directly from PgA= dmin3: SELECT "frp_mw",encode(ST_AsBinary(ST_Force_2D("the_geom")),'base64') as "t= he_geom" FROM "public"."af_msg_abba_datetime_today" WHERE ("the_geom" && Ge= ometryFromText('POLYGON ((-27.67968749408379 -46.92207325648429, -27.679687= 49408379 -6.186892358058866, 75.67968748740275 -6.186892358058866, 75.67968= 748740275 -46.92207325648429, -27.67968749408379 -46.92207325648429))', 432= 6) AND (("frp_mw" >=3D -1 AND "frp_mw" <=3D 150) OR ("frp_mw" >=3D 151 AND = "frp_mw" <=3D 300) OR ("frp_mw" >=3D 301 AND "frp_mw" <=3D 600) OR ("frp_mw= " >=3D 601 AND "frp_mw" <=3D 50000))); I get 6515 rows in 380 ms. Ie Postgres is able to return the results of the query within 380ms if quer= ied from PgAdmin3 but Geoserver takes about 48 seconds to get hold of the s= ame resultset. Is this some kind of JDBC problem perhaps? Some details about our setup: Master Postgres database is on a separate VM from Geoserver, but we replica= te to a slave Postgres cluster on the Geoserver VM (same host). So Geoserve= r is referencing the 'localhost' read-only Postgres cluster for its queries= . The 380 ms response time shown above was from the slave Postgres cluster, s= ame one that Geoserver is using. All Linux (Ubuntu 11.10) based. Postgres 9.1 PostGIS 1.5 Geoserver 2.1.3 Riaan -- This message is subject to the CSIR's copyright terms and conditions, e-mai= l legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaime= r.html. This message has been scanned for viruses and dangerous content by MailScan= ner, and is believed to be clean. Please consider the environment before printing this email. --_000_4B95BC7335A13A42AD0D23462F91AE6F6163F14852echogeometryi_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

= Hi Riaan,

I am familiar if= the Geoserver/Geotools package and I believe that the problem is not Postg= res/PostGIS but rather Geoserver.

The DB Connection Closed message is not sent at the end of the quer= y, but rather at the end of the rendering. There is more than just querying= happening between the Select message and the Closed message.

Brett

F= rom: pgsql-performance-owner@postgresql.org [mailto:pgsql-p= erformance-owner@postgresql.org] On Behalf Of Riaan van den Dool
= Sent: Tuesday, 24 July 2012 5:21 PM
To: pgsql-performance@= postgresql.org
Subject: [PERFORM] Geoserver-PostGIS performance p= roblems

 

 

Hi

 

We have noticed something strange in the interact= ion between our Geoserver instance and Postgres/PostGIS. =

 

After setting Geoserver's log level to include= developer debugging, I managed to capture a single request from Geoserver = WMS to PostGIS.

 

The (shorten= ed) sequence of events and their timestamps:

 

12:31:22,658 - SELECT query for MSG is sent to Postgres

12:32:10,315 - Renderi= ng for MSG layer starts

12:32:10,356 - DB Connection Closed

=3D=3D=3D=3D=3D=3D=3D=3D

~ 48 seconds

 

Interestingly enough, when I execute the same query (MSG) directl= y from PgAdmin3:

 

SELECT &quo= t;frp_mw",encode(ST_AsBinary(ST_Force_2D("the_geom")),'base6= 4') as "the_geom" FROM "public"."af_msg_abba_datet= ime_today" WHERE ("the_geom" && GeometryFromText('PO= LYGON ((-27.67968749408379 -46.92207325648429, -27.67968749408379 -6.186892= 358058866, 75.67968748740275 -6.186892358058866, 75.67968748740275 -46.9220= 7325648429, -27.67968749408379 -46.92207325648429))', 4326) AND (("frp= _mw" >=3D -1 AND "frp_mw" <=3D 150) OR ("frp_mw&q= uot; >=3D 151 AND "frp_mw" <=3D 300) OR ("frp_mw"= >=3D 301 AND "frp_mw" <=3D 600) OR ("frp_mw" >= ;=3D 601 AND "frp_mw" <=3D 50000)));

 

I get 6515 rows in 380 ms.

 

Ie Postgres is able to return the results of the query= within 380ms if queried from PgAdmin3 but Geoserver takes about 48 seconds= to get hold of the same resultset.

 

Is this some kind of JDBC problem perhaps?

 

Some details about our setup:

 

Master Postgres database is on a separate VM fro= m Geoserver, but we replicate to a slave Postgres cluster on the Geoserver = VM (same host). So Geoserver is referencing the 'localhost' read-only Postg= res cluster for its queries.

 

The 380 ms response time shown above was from the slave Postgres cluster, = same one that Geoserver is using.  

 

All Linux (Ubuntu 11.10) based. Postgres 9.1 PostGIS 1.5 Geose= rver 2.1.3

 

Riaan






--
This message is subject to= the CSIR's copyright terms and conditions, e-mail legal notice, and implem= ented Open Document Format (ODF) standard.
The full disclaimer details = can be found at http://ww= w.csir.co.za/disclaimer.html.


This message has bee= n scanned for viruses and dangerous content by MailScanner,
and is believed to be clean. =


Please consider the environment before printing this email.=

= --_000_4B95BC7335A13A42AD0D23462F91AE6F6163F14852echogeometryi_--