<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body style='font-size: 10pt; font-family: Verdana,Geneva,sans-serif'>
<p>Hi Régis,</p>
<p>QGIS server is single-threaded. You can't simply turn on multi-threaded rendering in QGIS server. The other issue is that each Apache FCGI process has it's own set of cache. So if you have 5-10 parallel Apache threads or processes each thread/process has it's own cache. If your client hits a thread that has the cache unititialized you will have wait longer until this cache is fillled.</p>
<p>I once asked Marco whether one could</p>
<p>a) have a shared cache for all Apache threads or processes</p>
<p>b) support multi-threaded rendering</p>
<p>But he said it would be very complicated to implement a) and b), if not impossible. Maybe other devs have other views. Note that was about 2 years ago, when I last discussed this with Marco.</p>
<p>---------------------</p>
<p>Nevertheless I believe there would be room for performance improvements in QGIS server - if interested parties share their efforts (be it dev time or financial resources).</p>
<p>BTW:</p>
<p>did you switch of QGIS server python plugins? If you don't need them, I recommend you switch them off - both for security reasons, but also there was a huge performance problem with QGIS server Python plugins just recently. See <a href="http://hub.qgis.org/issues/13919">http://hub.qgis.org/issues/13919</a> - luckily this was fixed just recently. Depending on the version you use, this may have a negative impact on your installation.</p>
<p>Andreas</p>
<p>On 2016-02-23 15:20, Régis Haubourg wrote:</p>
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0"><!-- html ignored --><!-- head ignored --><!-- meta ignored -->
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">Hi all, <br /> we are working on using qgis server here and we face some performance issues<br /> on big data sets. Cache is not an option for those layers that will be<br /> edited by users. Currently performances are not acceptable for production<br /> uses.  Here is a couple of questions that I could not answer by myself on<br /> the net:<br /><br /> 1- Clarifying multithread on server side vs multithread on desktop:<br /><br /> We use qgis 2.12 server from qgis repository for debian on a 4 core Xeon<br /> (2.1Ghz) + 16Go RAM. <br /><br /> We configured apache2 with MPM worker and we have a pool of 10<br /> qgis_mapserv.fcgi waiting for client request. <br /> The behaviour here is that one client will only consume one fcgid process,<br /> when desktop can use several processes to make some parallel rendering of<br /> project layers. <br /> When having QGIS desktop  using only one thread, I have similar rendering<br /> time. The difference is purely proportionnal to CPU speed difference. <br /> Did we miss something in configuration process or is that the intended<br /> behavior? I did try to use QGIS_OPTION_PATH on a QGIS2.ini but I really<br /> can't be sure it is really being used.<br /> Do QGIS packages miss the multithread option on compile cmake options? <br /> If this is expected, does the web architecture would allow to have fcgid do<br /> parallel rendering like desktop? Would that be a big work (I could partly<br /> fund that)?<br /><br /><br /> 2- Overhead on first request with postgres complex view compared to<br /> shapefiles<br /><br /> We have almost only postgis views being used as QGIS layers. Qgis server<br /> builds get capabilities and requests views to get extent and primary keys.<br /> There is a severe overhead for the first wms request by a client session.<br /> When generating the image takes about 7s, the first request can take from 24<br /> to 30s. Desktop multihreaded will get the image in about 3s (same postgres<br /> server, same network). <br /> That overhead starts to become annoying on desktop side too, but it's only<br /> qgs loading time, once in a work session. Does someone have any idea that<br /> one day postgis could collect such metadata on views so that QGIS do not<br /> have to scan all rows when data are in views? Direct access to tables, or<br /> same project with shp datasources do not show that overhead on server nor in<br /> desktop.<br /><br /><br /> Thanks for your hints, <br /> Cheers<br /><br /> Régis<br /><br /><br /><br /> --<br /> View this message in context: <a href="http://osgeo-org.1560.x6.nabble.com/Server-performance-questions-tp5252233.html">http://osgeo-org.1560.x6.nabble.com/Server-performance-questions-tp5252233.html</a><br /> Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.<br /> _______________________________________________<br /> Qgis-developer mailing list<br /><a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a><br /> List info: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br /> Unsubscribe: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a></div>
</blockquote>
<p> </p>
<div> </div>
</body></html>