[Qgis-developer] Caching GetProjectSettings with Qgis server

Alessandro Pasotti apasotti at gmail.com
Tue Aug 26 10:33:40 PDT 2014


2014-08-26 19:05 GMT+02:00 Uros Preloznik <uros00 at gmail.com>:
> Hi,
>
> I would like to have more information regarding Qgis server caching certain
> requests and how to control that. I didn't find any documentation regarding
> this, so I ask.
>
> Example:
> On my environment (ubuntu 12.04, apache 2.2.22, qgis 2.4) I do
> GetProjectSettings request on certain project. If I restart Apache or save
> the project the request is not cached (I assume) and it takes from 20 - 65
> seconds. In order to avoid Server Error after 40second I added this line to
> Apache configuration
>
> FcgidIOTimeout 80
>
> So, after this long request, next same request is immediately so it must be
> cached, right? I tested with different clients and must be on server. But I
> do not control this, because after unknown amount of time the cache is
> removed.
>
> Can anyone explain this and should I explore basic Apache caching tehniques
> like this:
> http://httpd.apache.org/docs/2.2/caching.html
>
> Right now I don't have any caching modules enabled in Apache.
>
> Another question is why is it taking so long, but I will ask that extra.
>
> thanks
>
> Uros
>

Hi Uros,

I might be wrong but I think that request are not cached in the
standard sense, the startup delay is due to the application startup
time ant to the first time parsing of the project file that also needs
to instanciate many objects.

What is cached are project configurations (parsed project files) for
the available services, layers, getcapabilities and getprojectsettings
requests, but the caches are invalidate whenever the project file
changes on disk, for instance see:

https://github.com/elpaso/QGIS/blob/master/src/mapserver/qgsconfigcache.cpp#L36

 The end of the story is that there at the first request there is the
application startup time + the configuration parsing for the
particular service and project tuple, the next requests for the same
service and project is considerably faster because it doesn't have to
start the application nor to parse the project file and instanciate
all the stuff.

Of course, all this goodies come only with FCGI, if you run the server
in CGI mode, then all requests are treated as the first one.

-- 
Alessandro Pasotti
w3:   www.itopen.it


More information about the Qgis-developer mailing list