[Geoserver-users] gs:Unique performance over HTTP GET

I’m calling the following URL through a javascript application to obtain the unique neighborhood’s names of my neighborhood layer.

http://.../geoserver/wps?service=WPS&version=1.0.0&request=Execute&identifier=gs:Unique&DataInputs=attribute%3dnome;features%3d%40xlink%3ahref%3dhttp://.../geoserver/smurb/ows%3Fservice=WFS%26version=1.0.0%26request=GetFeature%26typeName=smurb:bairros_vigentes_3857%26propertyName%3dnome&RawDataOutput=result%3dformat%40mimetype%3dapplication%2Fjson

The problem is that this call takes like 10 seconds to execute and the layer has like 90 geometries only. If I make the “same” call through GeoServer’s WPS Request Builder, it executes almost instantaneously, but I suspect it doesn’t do HTTP requests.

Anyway, there are any tips to improve it’s performance? Other suggestion to obtain the same results are also accepted :slight_smile:

Additional info:

  • Geoserver 2.7.2
  • Linux machine
  • “…” in the URL means my GeoServer host
  • The response has 1.2 kb

On Tue, Nov 17, 2015 at 4:07 PM, César Augusto Ribeiro <carrbrpoa@anonymised.com4...>
wrote:

I'm calling the following URL through a javascript application to obtain
the unique neighborhood's names of my neighborhood layer.

http://
.../geoserver/wps?service=WPS&version=1.0.0&request=Execute&identifier=gs:Unique&DataInputs=attribute%3dnome;features%3d%40xlink%3ahref%3dhttp://…/geoserver/smurb/ows%3Fservice=WFS%26version=1.0.0%26request=GetFeature%26typeName=smurb:bairros_vigentes_3857%26propertyName%3dnome&RawDataOutput=result%3dformat%40mimetype%3dapplication%2Fjson

The problem is that this call takes like 10 seconds to execute and the
layer has like 90 geometries only. If I make the "same" call through
GeoServer's WPS Request Builder, it executes almost instantaneously, but I
suspect it doesn't do HTTP requests.

It indeed does a HTTP request, but it's a local one.
I would suggest against using GET requests though, indeed those requests in
WPS were problematic
enough that OGC dropped support for GET requests in WPS 2.0

The request builder can create the XML for a POST request for you, second
button at the bottom

Cheers
Andrea

--

GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

*AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*

Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo è consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.

-------------------------------------------------------

(Why spam?)

Hey Andrea,

I need to do these requests in an javascript application. I suppose I can’t rely on request builder to do it, I’m I wrong?
I understand that OGC dropped support, so the recommended way is to build the “xml” in my application and then POST it somehow?

Do you believe it would have any performance gain?

Thanks

···

2015-11-17 13:17 GMT-02:00 Andrea Aime <andrea.aime@…1107…>:

On Tue, Nov 17, 2015 at 4:07 PM, César Augusto Ribeiro <carrbrpoa@anonymised.com> wrote:

I’m calling the following URL through a javascript application to obtain the unique neighborhood’s names of my neighborhood layer.

http://.../geoserver/wps?service=WPS&version=1.0.0&request=Execute&identifier=gs:Unique&DataInputs=attribute%3dnome;features%3d%40xlink%3ahref%3dhttp://.../geoserver/smurb/ows%3Fservice=WFS%26version=1.0.0%26request=GetFeature%26typeName=smurb:bairros_vigentes_3857%26propertyName%3dnome&RawDataOutput=result%3dformat%40mimetype%3dapplication%2Fjson

The problem is that this call takes like 10 seconds to execute and the layer has like 90 geometries only. If I make the “same” call through GeoServer’s WPS Request Builder, it executes almost instantaneously, but I suspect it doesn’t do HTTP requests.

It indeed does a HTTP request, but it’s a local one.
I would suggest against using GET requests though, indeed those requests in WPS were problematic
enough that OGC dropped support for GET requests in WPS 2.0

The request builder can create the XML for a POST request for you, second button at the bottom

Cheers
Andrea

==
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information.

Ing. Andrea Aime

@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

AVVERTENZE AI SENSI DEL D.Lgs. 196/2003

Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy’s New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.


Atenciosamente,

César Augusto R. Ribeiro

On Tue, Nov 17, 2015 at 4:27 PM, César Augusto Ribeiro <carrbrpoa@anonymised.com4...>
wrote:

(Why spam?)

Don't know, the server of our mail provider adds it automatically...

Hey Andrea,

I need to do these requests in an javascript application. I suppose I
can't rely on request builder to do it, I'm I wrong?

You're not

I understand that OGC dropped support, so the recommended way is to build
the "xml" in my application and then POST it somehow?

Yes

Do you believe it would have any performance gain?

Honestly I don't know, but the request builder actually does a local HTTP
POST request, so, if it's fast,
that might be involved

Cheers
Andrea

--

GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

*AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*

Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo è consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.

-------------------------------------------------------

On 18/11/15 22:54, Andrea Aime wrote:

On Tue, Nov 17, 2015 at 4:27 PM, César Augusto Ribeiro <carrbrpoa@anonymised.com>
wrote:

(Why spam?)

Don't know, the server of our mail provider adds it automatically...

Looks like SpamAssassin, which adds this string to enable client-side filtering, running on the mail server. In addition to dubious senders and mail servers, SpamAssassin can also detect spam based on content. I suggest that words like "unique", "performance", and "neighborhood" in close proximity might look like spam. I have seen a beef jerky recipe that could not be delivered because it contained the word "meat" many times in close proximity (blocked by IronPort in that case). Our robot overlords never sleep.

Kind regards,

--
Ben Caradoc-Davies <ben@anonymised.com>
Director
Transient Software Limited <http://transient.nz/&gt;
New Zealand

Thanks for the support, Andrea.

I’ve done my tests:

I’m using AngularJS for the front-end and changed the request to POST. With the help of WPS Request Builder, I grabbed the XML it builds (needed to modify) and made a test request like this:

//

var xmlString = ‘<?xml version="1.0" encoding="UTF-8"?><wps:Execute version=“1.0.0” service=“WPS” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” xmlns=“http://www.opengis.net/wps/1.0.0” xmlns:wfs=“http://www.opengis.net/wfs” xmlns:wps=“http://www.opengis.net/wps/1.0.0” xmlns:ows=“http://www.opengis.net/ows/1.1” xmlns:gml=“http://www.opengis.net/gml” xmlns:ogc=“http://www.opengis.net/ogc” xmlns:wcs=“http://www.opengis.net/wcs/1.1.1” xmlns:xlink=“http://www.w3.org/1999/xlink” xsi:schemaLocation=“http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd”>ows:Identifiergs:Unique</ows:Identifier>wps:DataInputswps:Inputows:Identifierfeatures</ows:Identifier><wps:Reference mimeType=“text/xml” xlink:href=“http://…/geoserver/wfs” method=“POST”>wps:Body<![CDATA[]]></wps:Body></wps:Reference></wps:Input>wps:Inputows:Identifierattribute</ows:Identifier>wps:Datawps:LiteralDatanome</wps:LiteralData></wps:Data></wps:Input></wps:DataInputs>wps:ResponseForm<wps:RawDataOutput mimeType=“application/json”>ows:Identifierresult</ows:Identifier></wps:RawDataOutput></wps:ResponseForm></wps:Execute>’;

return $http({
url : rootUrl,
method : ‘POST’,
data : xmlString,
headers : {
‘Content-Type’ : ‘application/xml’
}
});

// </Test code>

PS: I’ve suffered to figure out the CDATA stuff and the xmlns:wfs inside wfs:GetFeature... (the modifications I pointed before)

The result is the same response time: like 10 seconds for 1.2kb ~ 1.3kb data.

I don’t know what I could try to monitor/make better, since the latency to the server is fine ( < 1ms).

I’m accepting ideas :wink:

···

2015-11-18 7:54 GMT-02:00 Andrea Aime <andrea.aime@anonymised.com>:

On Tue, Nov 17, 2015 at 4:27 PM, César Augusto Ribeiro <carrbrpoa@anonymised.com> wrote:

(Why spam?)

Don’t know, the server of our mail provider adds it automatically…

Hey Andrea,

I need to do these requests in an javascript application. I suppose I can’t rely on request builder to do it, I’m I wrong?

You’re not

I understand that OGC dropped support, so the recommended way is to build the “xml” in my application and then POST it somehow?

Yes

Do you believe it would have any performance gain?

Honestly I don’t know, but the request builder actually does a local HTTP POST request, so, if it’s fast,
that might be involved

Cheers

Andrea

==
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information.

Ing. Andrea Aime

@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

AVVERTENZE AI SENSI DEL D.Lgs. 196/2003

Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy’s New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.


Atenciosamente,

César Augusto R. Ribeiro