<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Thanks René-Luc and Kimaidou,<br>
<br>
This sounds like a useful fix. I will test and report if I run into
issues.<br>
<br>
Do you have any numbers/observations how much this will speed up
services that use Postgis as storage? I mean very rough numbers
only.<br>
<br>
Anyway - I will test.<br>
<br>
Andreas<br>
<br>
<div class="moz-cite-prefix">On 16.09.2015 10:19, kimaidou wrote:<br>
</div>
<blockquote
cite="mid:CAMKXKO4yQpXMqhVsNeOdt-+2yx0N6N7tyby3qex54zS6295O2w@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>
<div>
<div>
<div>
<div>
<div>
<div>Hi all<br>
<br>
</div>
René-Luc has found why this appeared, essentially
with Lizmap. Lizmap send GetMap request to QGIS
Server with a non empty STYLES parameter (ex:
STYLES=default). This is to let the user choose the
style.<br>
<br>
</div>
In this case, QGIS Server did not use the maplayer
cache, so it had to get all information from the
provider to build the maplayer objet for each GETMAP
request ! This is why in this case, a new opening was
made on the file.<br>
</div>
The following commit fixes it : <br>
<a moz-do-not-send="true"
href="https://github.com/qgis/QGIS/commit/a5450a78ffcbba9a75afa8be43460ad741fea050">https://github.com/qgis/QGIS/commit/a5450a78ffcbba9a75afa8be43460ad741fea050</a><br>
<br>
</div>
It has been backported in branches release-2_8 and
release-2_10<br>
<br>
</div>
A very good side effect is with PostGIS layers :<br>
</div>
* before, QGIS Server sent many many queries to build the
whole maplayer for each GetMAP, such as : [1] if metadata were
available, and worse like [2] if metadata were not (for
example for PostGIS views or if the user had disabled "use
metadata" )<br>
</div>
* now only the main "get data" queries are sent for each GetMap,
like [3]<br>
<div><br>
</div>
<div>In [2], you can see some performance kiling queries (on big
datasets), such as <br>
<br>
SELECT count(distinct ""nb"")=count(""nb"") FROM (SELECT
row_number() OVER() AS nb, * FROM ""2013"".v_geo_parcelle<br>
) AS ""subQuery_0"""<br>
<br>
SELECT st_extent(""geom"") FROM (SELECT row_number() OVER() AS
nb, * FROM ""2013"".v_geo_parcelle<br>
) AS ""subQuery_0""<br>
</div>
<div><br>
[1] <a moz-do-not-send="true"
href="https://paste.sh/yguqyRWL#EPcHHVH3uuijGgEtzH0pAlHb">https://paste.sh/yguqyRWL#EPcHHVH3uuijGgEtzH0pAlHb</a><br>
[2] <a moz-do-not-send="true"
href="https://paste.sh/frCglZ9A#A1nQ6BXtdBeEiZWQmTJP8v9l">https://paste.sh/frCglZ9A#A1nQ6BXtdBeEiZWQmTJP8v9l</a><br>
[3] <a moz-do-not-send="true"
href="https://paste.sh/Rkvqf757#K1MCRitovIxMblBVils1VF7r">https://paste.sh/Rkvqf757#K1MCRitovIxMblBVils1VF7r</a><br>
<br>
<br>
</div>
<div>Thanks a lot to René-Luc for fixing this !<br>
<br>
</div>
<div>Cheers<br>
</div>
<div>Michaël<br>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">2015-09-14 8:39 GMT+02:00 Luca
Manganelli <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:luca76@gmail.com" target="_blank">luca76@gmail.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex"><span
class="">On Fri, Sep 11, 2015 at 5:09 PM, kimaidou <<a
moz-do-not-send="true" href="mailto:kimaidou@gmail.com"><a class="moz-txt-link-abbreviated" href="mailto:kimaidou@gmail.com">kimaidou@gmail.com</a></a>>
wrote:<br>
> I tested a quick and dirty patch, by replacing all
occurences of OGROpen byt<br>
> OGROpenShared in QGIS source, then rebuild and test
server side --> No locks<br>
> anymore ! QGIS Server works like a charm here,
without increasing the number<br>
</span>> ...<br>
<br>
This is a great fix! It's important to optimize resources,
expecially<br>
with qgis server.<br>
_______________________________________________<br>
Qgis-developer mailing list<br>
<a moz-do-not-send="true"
href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a><br>
<a moz-do-not-send="true"
href="http://lists.osgeo.org/mailman/listinfo/qgis-developer"
rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
</blockquote>
</div>
<br>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Qgis-developer mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/qgis-developer">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a></pre>
</blockquote>
<br>
</body>
</html>