Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 75A3C5F9CE9 for ; Tue, 24 Jul 2012 05:11:07 -0300 (ADT) Received: from ls-mx3.csir.co.za ([146.64.10.248]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1StaCr-00064m-VA for pgsql-performance@postgresql.org; Tue, 24 Jul 2012 08:11:06 +0000 Received: from pta-emo.csir.co.za (pta-emo.csir.co.za [146.64.100.109]) by ls-mx3.csir.co.za (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id q6O8ARTo002551 for ; Tue, 24 Jul 2012 10:10:29 +0200 Received: from PTA-EMO-MTA by pta-emo.csir.co.za with Novell_GroupWise; Tue, 24 Jul 2012 10:10:03 +0200 Message-Id: <500E7478020000DB000A78E9@pta-emo.csir.co.za> X-Mailer: Novell GroupWise Internet Agent 8.0.2 Date: Tue, 24 Jul 2012 10:10:00 +0200 From: "Riaan van den Dool" To: "Brett Walker" , "pgsql-performance@postgresql.org" Subject: Re: Geoserver-PostGIS performance problems References: <500E690D020000DB000A78CC@pta-emo.csir.co.za> <4B95BC7335A13A42AD0D23462F91AE6F6163F14852@echo.geometryit.com> In-Reply-To: <4B95BC7335A13A42AD0D23462F91AE6F6163F14852@echo.geometryit.com> Mime-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.9 (ls-mx3.csir.co.za [146.64.10.248]); Tue, 24 Jul 2012 10:10:29 +0200 (SAST) X-CSIR-MailScanner-Information: Please contact the ISP for more information X-CSIR-MailScanner-ID: q6O8ARTo002551 X-CSIR-MailScanner: Found to be clean X-CSIR-MailScanner-From: rvddool@csir.co.za X-CSIR-MailScanner-Watermark: 1343722229.43674@XTB0esR5wL9YaOiaou37OA X-Spam-Status: No X-Pg-Spam-Score: -2.6 (--) Content-Type: multipart/alternative; boundary="=__Part26177548.3__=" X-Archive-Number: 201207/282 X-Sequence-Number: 47463 This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part26177548.2__= Content-Type: multipart/alternative; boundary="=__Part26177548.3__=" --=__Part26177548.3__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Thank you for this response.=20 It turns out our performance problems were solved when I switched off 'Prep= ared statements' in Geoserver for the PostGIS data store. It makes quite a = huge difference.=20 Riaan >>> Brett Walker 7/24/2012 09:54 AM >>> Hi Riaan,=20 I am familiar if the Geoserver/Geotools package and I believe that the prob= lem is not Postgres/PostGIS but rather Geoserver.=20 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.=20 Brett=20 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=20 =20=20 =20=20 Hi=20 =20=20 We have noticed something strange in the interaction between our Geoserver = instance and Postgres/PostGIS.=20 =20=20 After setting Geoserver's log level to include developer debugging, I manag= ed to capture a single request from Geoserver WMS to PostGIS.=20 =20=20 The (shortened) sequence of events and their timestamps:=20 =20=20 12:31:22,658 - SELECT query for MSG is sent to Postgres=20 12:32:10,315 - Rendering for MSG layer starts=20 12:32:10,356 - DB Connection Closed=20 =3D=3D=3D=3D=3D=3D=3D=3D=20 ~ 48 seconds=20 =20=20 Interestingly enough, when I execute the same query (MSG) directly from PgA= dmin3:=20 =20=20 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)));=20 =20=20 I get 6515 rows in 380 ms.=20 =20=20 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.=20 =20=20 Is this some kind of JDBC problem perhaps?=20 =20=20 Some details about our setup:=20 =20=20 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= .=20 =20=20 The 380 ms response time shown above was from the slave Postgres cluster, s= ame one that Geoserver is using.=20=20=20 =20=20 All Linux (Ubuntu 11.10) based. Postgres 9.1 PostGIS 1.5 Geoserver 2.1.3=20 =20=20 Riaan=20 -- 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.=20 This message has been scanned for viruses and dangerous content by MailScan= ner ( http://www.mailscanner.info/ ), and is believed to be clean.=20 Please consider the environment before printing this email.=20 -- 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.=20 This message has been scanned for viruses and dangerous content by MailScan= ner ( http://www.mailscanner.info/ ), and is believed to be clean.=20 Please consider the environment before printing this email. --=20 This message is subject to the CSIR's copyright terms and conditions, e-mai= l legal notice, and implemented Open Document Format (ODF) standard.=20 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,=20 and is believed to be clean. Please consider the environment before printing this email. --=__Part26177548.3__= Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Description: HTML =20=20=20=20

Thank you for this response. =


=20=20=20=20=20=20

It turns out our performance problem= s were solved when I switched off 'Prepared statements' in Geoserve= r for the PostGIS data store. It makes quite a huge difference. <= /p>
=20=20=20=20=20=20

Riaan

>>> Bre= tt Walker <brett.walker@geometryit.com> 7/24/2012 09:54 AM >>&g= t;

Hi Riaan,

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

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

Brett =

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

 

 

Hi

 

We have noticed so= mething strange in the interaction between our Geoserver instance and Postg= res/PostGIS.

 

After setting Geos= erver's log level to include developer debugging, I managed to capt= ure 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

==== 1;====

~ 48 seco= nds

 

Interestingly enou= gh, when I execute the same query (MSG) directly from PgAdmin3:=

 

SELECT "frp_m= w",encode(ST_AsBinary(ST_Force_2D("the_geom"= )),'base64') as "the_geom" FROM "pub= lic"."af_msg_abba_datetime_today" WHERE ("the_geom&= quot; && GeometryFromText('POLYGON ((-27.6796874940= 8379 -46.92207325648429, -27.67968749408379 -6.186892358058866, 75.= 67968748740275 -6.186892358058866, 75.67968748740275 -46.92207325648429= , -27.67968749408379 -46.92207325648429))', 4326) A= ND (("frp_mw" >= -1 AND "frp_mw" <= 1; 150) OR ("frp_mw" >= 151 AND "frp_mw"= <= 300) OR ("frp_mw" >= 301 AND "frp_= mw" <= 600) OR ("frp_mw" >= 601 AND &q= uot;frp_mw" <= 50000)));

 

I get 6515 rows in= 380 ms.

 

Ie Postgres is abl= e 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 da= tabase is on a separate VM from Geoserver, but we replicate to a slave = Postgres cluster on the Geoserver VM (same host). So Geoserver is r= eferencing the 'localhost' read-only Postgres cluster for its queri= es.

 

The 380 ms respons= e time shown above was from the slave Postgres cluster, same one that G= eoserver is using.  

 

All Linux (Ubu= ntu 11.10) based. Postgres 9.1 PostGIS 1.5 Geoserver 2.1.3

 

Riaan





<= SPAN STYLE=3D'FONT-FAMILY:"Verdana,sans-serif" ;FONT-SIZE:"7.5pt"'>
--
T= his message is subject to the CSIR's copyright terms and conditions,= ; e-mail legal notice, and implemented Open Document Format (ODF= 1; standard.
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.
=

<= SPAN STYLE=3D'FONT-FAMILY:"Verdana,sans-serif" ;FONT-SIZE:"7.5pt"'>
This message has been scanned for viruses and dangerous content by = MailScanner,
and is believed to= be clean.

<= SPAN STYLE=3D'FONT-FAMILY:"Verdana,sans-serif" ;FONT-SIZE:"7.5pt"'>
Please consider the environment before printing this email.
=


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


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


Please consider the environment before printing this email.


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


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


Please consider the environment before printing this email.
--=__Part26177548.3__=-- --=__Part26177548.2__=--