<div dir="ltr"><div><div><div><div><div><div>Hi !<br><br></div>Paolo : the bug has been backported in branches "release-2_8" and "release-2_10", so it would be included in 2.8.4 whenever it is released.<br><br></div>Andreas : This fix is only relevant for WMS clients using a non empty STYLES parameter in GetMap. In this cases, this would greatly improve the speed if :<br><br></div><div>* the WMS client do use a non empty STYLES parameter. If not, QGIS Server already used the cached layer.<br></div><div>* the WMS client sends a lot of GetMap queries, for example if you have many users or if you use tiles.<br></div>* the underlying data are big or complex, because the queries "SELECT extent()" and "SELECT count(id)=count(DISTINCT id) will not be sent, and theses queries can be slow.<br><br></div>In Lizmap client for example, we use STYLES with 'default' for each layer, and we usually have map built with tiles. So it will be significant here.<br><br></div>Cheers,<br></div>Michaël<br><div><div><div><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-09-16 10:54 GMT+02:00 Andreas Neumann <span dir="ltr"><<a href="mailto:a.neumann@carto.net" target="_blank">a.neumann@carto.net</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div 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.<span class="HOEnZb"><font color="#888888"><br>
<br>
Andreas</font></span><div><div class="h5"><br>
<br>
<div>On 16.09.2015 10:19, kimaidou wrote:<br>
</div>
<blockquote 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 href="https://github.com/qgis/QGIS/commit/a5450a78ffcbba9a75afa8be43460ad741fea050" target="_blank">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 href="https://paste.sh/yguqyRWL#EPcHHVH3uuijGgEtzH0pAlHb" target="_blank">https://paste.sh/yguqyRWL#EPcHHVH3uuijGgEtzH0pAlHb</a><br>
[2] <a href="https://paste.sh/frCglZ9A#A1nQ6BXtdBeEiZWQmTJP8v9l" target="_blank">https://paste.sh/frCglZ9A#A1nQ6BXtdBeEiZWQmTJP8v9l</a><br>
[3] <a href="https://paste.sh/Rkvqf757#K1MCRitovIxMblBVils1VF7r" target="_blank">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 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>On Fri, Sep 11, 2015 at 5:09 PM, kimaidou <<a href="mailto:kimaidou@gmail.com" target="_blank"></a><a href="mailto:kimaidou@gmail.com" target="_blank">kimaidou@gmail.com</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 href="mailto:Qgis-developer@lists.osgeo.org" target="_blank">Qgis-developer@lists.osgeo.org</a><br>
<a 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></fieldset>
<br>
<pre>_______________________________________________
Qgis-developer mailing list
<a href="mailto:Qgis-developer@lists.osgeo.org" target="_blank">Qgis-developer@lists.osgeo.org</a>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a></pre>
</blockquote>
<br>
</div></div></div>
<br>_______________________________________________<br>
Qgis-developer mailing list<br>
<a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a><br>
<a 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>