[Qgis-developer] Fwd: Caching GetProjectSettings with Qgis server

Uros Preloznik uros00 at gmail.com
Thu Aug 28 03:44:29 PDT 2014


Alessandro,

Thanks for answering, yes I have fcgid enabled and I meant configuration
stuff especially getprojectsetting request which is taking very long on
certain project. So that is cached, in memory I assume?

Are there any settings, I would to keep the cache unless I saved the
project or restart server, which are obvious cases to remove cache. From
the code example I see that if the project is changed it is removed from
cache, I don't see any other cases.

Can I use apache cache modules to save the cache to disk?

How are anyone dealing with this on production servers?

regards,
Uros



2014-08-26 19:33 GMT+02:00 Alessandro Pasotti <apasotti at gmail.com>:

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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20140828/1ce00ca4/attachment.html>


More information about the Qgis-developer mailing list